Freevo config


Basic freevo setup is easy, but if you want some special features or lots of additional plugins it gets harder. I especially like the idlebar plugins - if it was for me, we could have two idlebars ;-) But first things first, lets start with the basic setup.

Basic Setup

Since I'm receiving analog cabel tv instead of analog free-to-air via antenna for a few weeks now it makes sense to record tv. I can even watch soccer now - with tv via antenna I always thought there are 44 players on the sports field and it was snowing even in July! Basic setup also includes music- (audio cd, mp3), movie- (dvd, vcd, xvid) and image-configuration.

Watch TV

First step is to get the program guide information. Not having a dsl flatrate I don't want to use xmltv. So I choosed nxtvegp, which grabs this info directly from the cable tv. In Germany there are three channels providing epg data. You can configure nxtvepg to grab the data from all three channels and merge the information to receive as much epg data as possible. This step has to be done with the nxtvepg-gui. See [1] for details. Once configured, you can refresh the epg data from within command line. I grab the epg data on system startup. Therefore add:
/usr/bin/nxtvepg -daemon -acqonce full -rcfile /root/.nxtvepgrc
/usr/bin/nxtvepg -dump xml -provider ff -rcfile /root/.nxtvepgrc > /tmp/TV.xml
to a startup file. See my freevo_init at the download page.

Next step is to set up basic freevo variables for tv. I downloaded a channel list from my cabel tv provider, but soone I had to realise that it doesn't fit with the channels I'm able to watch.... So I copied the frequency of each channel from my tv tuner to TV_CHANNELS in My TV_CHANNELS looks like:

TV_CHANNELS = [ ( 'CNI0DC1', 'ARD', '210.00MHz' ),
( 'CNI0DC2', 'ZDF', '196.00MHz' ),
( 'CNI0DD4', 'NDR', '189.00MHz' ),
First row is the xmltv-id, second the channel name showing up in the freevo tv guide and third is either the frequency (in my special case) or the channel-id (e.g. "S1", "E9", "K1"). You can get these infos from your TV.xml which was created by nxtvepg. Just run a:
cat /tmp/TV.xml | grep "channel id=\"" -A 1 | sed -e "s/<channel id=\"//g;s/<[/d]*.splay-name>//g;s/\"/ =/g"
I choosed mplayer to view tv, tried several commands and parameters in the shell with no success. So I deactivated mplayer for tv and activated tvtime. After some googling I realized that tvtime is the program of choice for live tv, because of its common and very good deinterlacer (DScaler). If you want to use tvtime just add:
to your Tvtime needs a valid stationlist.xml in its home-directory (~/.tvtime). "Valid" means here that every channel in freevo's TV_CHANNELS variable needs a corresponding section in tvtime's stationlist.xml:
<list audio='bg' frequencies='freevo' norm='PAL'>
 <station name='ARD' band='Custom' active='1' position='0' xmltvid='CNI0DC1' channel='210.00MHz'/>
<station name='ZDF' band='Custom' active='1' position='1' xmltvid='CNI0DC2' channel='196.00MHz'/>
<station name='NDR' band='Custom' active='1' position='2' xmltvid='CNI0DD4' channel='189.00MHz'/>
Now we are almost done! Set TV_SETTINGS to your personal needs; in Germany the tv-norm is PAL, input on the tv-card is televison. The chanellist doesn't have any affect on my setup, because I use the custom setup using frequencies as described earlier. You should watch tv in full PAL resolution so set:
TV_SETTINGS = 'pal television europe-west /dev/video0'
TV_VIEW_SIZE = (768, 576)
That's it. Quite enough work just to watch tv, eh? But we have allready done some steps we need for recording tv as well.

Depending on your system setup (nvidia driver version, graphic card, etc.) you'll maybe facing nasty blue borders around the live tv picture (or only on one or two borders). That has something to do with xv overlay; didn't wanted to go into detail there so I just addded:

OSD_SDL_EXEC_AFTER_STARTUP = "/usr/bin/xvattr -a XV_COLORKEY -v 0"
to my This turns the blue borders black and it doesn't bothers any more.

One last hint on the tv guide: If you want station logos to show up instead of the channel names you can download them e.g. from and save them as PNG-file. Rename them so that the filename fits the xmltv-id. For my setup I would need:

For me it didn't worked to store the files in the standard directory freevo suggests. I changed TV_LOGOS to:
TV_LOGOS = '/root/.freevo/logos/'

Record TV

There is not much to do to get recording working. I moved the whole recording stuff from to my own bash script For me it gets more cleary this way, besides bash is the language I like most. Adding:
VCR_CMD = ('/root/bin/ %(channel)s %(seconds)s "%(filename)s"')
to activates the script. Let's switch to the bash script. On startup (from the recordserver) it loads the btaudio kernel module. I wasn't able to get recording from soundcard line-in working. I googled, RTFMed, searched through the freevo wiki [2] (which, by the way, gets better day by day...), tried hundreds of command line options without success. My only chance was to get the sound directly from the tv card (aka "DMA sound"). My tv card has mono capabilities only, but that's better then nothing, right ? The only advantage is that you don't need to bother about audio/video-sync issues. I tried the digital audio device on the tv card first, but it resulted in a mencoder crash. The analog device works, but only if the parameters are stated in exactly the following sequence "analog=1 digital=0":
modprobe btaudio analog=1 digital=0
dmesg should report that a new audio device /dev/dsp1 (depends on the amount of soundcards you have enabled) is present. Be aware that afaik btaudio can record at 32000Hz rate only:
Well, right, forcechan=2 doesn't really help if your hardware is mono, but it can help if you have stereo hardware but the driver reports mono. The rest of the script should be self-explanatory if you have worked with mencoder before. I distinguished between the setup of the Audio- (${AUDIO}) and Video- (${VIDEO}) _Encoding-part_ and the setup of the Video- (${TV}) and Audio- (${DSP}) _Hardware-part_.

When using frequencies in TV_CHANNELS you have to cut the "MHz" of before you start mencoder. If you use channel-ids instead of frequencies just replace freq=${CHAN} with channel=${CHAN}. On my system recording eats about 30% cpu, so there's enough performance left to watch a dvd while recording. To watch the recorded stuff with xine, change ratio manually to 4:3 (press "a" twice).

Watch a movie

I prefer xine to watch movies. I can change subtitles and audio on the fly, zoom in and out of the picture and change the aspect ratio. Xine setup has been done while setting up the system, it depends on your hardware config. The only thing do to is add:
I'll have to take a closer look at the mplayer args in, it seems that they are not working the way they did within my old freevo. You can change the player when pressing "e" on the file you want to watch. I'll update this section soon.

Listen to music

Mplayer and xine have both all the capabilities that are necessary to play the full range of digital audio media. Nevertheless I encountered the following problems: Using xine I wasn't able to play audio cds in a way I expected. When a new title starts, the dvd-drive starts spinning up to maximum rpms and returning to normal after two seconds. Awful! I wasn't able to change this by neither xine settings nor hdparm settings. So I removed xine for audio and set mplayer as preferred player:
But with mplayer I'm facing another problem. The title list doesn't changes when a new one starts. It seems as mplayer doesn't report when switching to the next item in playlist when running in slave mode. I'll figure this out.

Look at pictures

Nothing to say here. It all worked out of the box.

Freevo plugins

Now that we have the basic setup completed, we can switch to the plugins. Some of them come with the freevo-package, some have to be downloaded from the freevo addons page [3]. In my opinion the plugins are what makes the system really interesting when up and running. It's a bit like playing with the old model railway. It's never complete and you can always enhance your system. And with a lot of plugins up and running, it's really impressive if you want to show off when your friends visit ;-)

Main menu plugins

Every htpc comes with a weather plugin. It seems as it is one of the most important functionalities of a media pc :-). I don't watch the weather forecast on the tv news, but I like the way it is presented on a htpc. The icons of the weather plugin are afaik from mythtv. I replaced them with the ones from MediaPortal, which provides far more icons for different weather status'. The headline-plugin is extremely valuable if you find rss-feeds which provide more than only headline and url, meaning content! The amount of content that the "Tagesschau"-feed provides is excellent. Do you know any other content-rich rss-feed either in German or English language?
plugin.activate('weather', level=45)
PLUGIN_WEATHER_LOCATIONS = [ ("GMXX0049", 1, "Hamburg") ]
plugin.activate('headlines', level=40)
HEADLINES_LOCATIONS = [ ("Tagesschau",""),
("SPIEGEL ONLINE",",5291,,00.xml"),
("Pressedienst, News, Analysen zu Inet-Marketing + Suchmaschinen",""),
(" - Coding, Culture and Arts",""),
("Heise News",""),
("Heise Security",""),
("Heise Mobil",""),
("Polarluft - Neue Webseiten und Online-Artikel zum Thema Computer und Internet","") ]

Submenu plugins

I have two usb sticks which are mounted automagically by the automounter. If they are plugged in, a new submenu item appears and you can access the stick, delete old files or copy new files from hdd/dvd to the stick (see shoppingcart-plugin). If you plug in one of the sticks, both menu items appear - this behaviour will change with freevo 2.0.
plugin.activate('usbstorage', type='video', args=('USB Stick CruzerMini', '/media/usb-SNDK3EE5941133000104:0:0:0p1'))
plugin.activate('usbstorage', type='audio', args=('USB Stick CruzerMini', '/media/usb-SNDK3EE5941133000104:0:0:0p1'))
plugin.activate('usbstorage', type='image', args=('USB Stick CruzerMini', '/media/usb-SNDK3EE5941133000104:0:0:0p1'))
plugin.activate('usbstorage', type='video', args=('USB MP3-Player', '/media/usb-0002F5CB080E4D88:0:0:0p1'))
plugin.activate('usbstorage', type='audio', args=('USB MP3-Player', '/media/usb-0002F5CB080E4D88:0:0:0p1'))
plugin.activate('usbstorage', type='image', args=('USB MP3-Player', '/media/usb-0002F5CB080E4D88:0:0:0p1'))
I love DILBERT. I get my daily dose through this plugin.
For all users with dsl flatrate there is a nice plugin to browse through the current movie trailers site provided by apple and watch them. It works out of the box with your preferred freevo video player.
My old tv card may have crappy video capabilities, but it _has_ a FM radio tuner. I downloaded a station list from my cable tv provider - same result as with the tv channels. Again I had to do it manually. Scan the whole range with
radio -i
and you will get a list of all radio stations you are receiving. Activate both radio and radioplayer plugin - works.
RADIO_STATIONS = [ ('Radio Hamburg','88.05'),
('DeutschlandRadio Berlin','88.50'),
('Radio Bremen 4','107.80') ]

Option menu plugins

These plugins show up if you press "e" (for d"e"tails ?) on a selected file in each submenu. "df" shows free disk space of the current partition, "shoppingcart" activates a mechanism to collect files and copy them into a directory. For me it crashes when I try to copy a whole directory.
To use the coversearch plugin you have to register as a developer on your local amazon-site, but it's worth it.
The audio-cd ripping plugin provides mp3, ogg, flac and wav capabilities. Dvdimage enables playback of dvd images which have been saved on hdd. You can copy a dvd to hdd with "vobcopy -m" after mounting it to /dvd.
AUDIO_BACKUP_DIR = '/medialib/music/rips'
CD_RIP_PN_PREF = '%(artist)s/%(album)s/%(track)s - %(artist)s - %(song)s'
LAME_CMD = 'lame'
CD_RIP_LAME_OPTS = '--vbr-new -b 192 -h'
CDPAR_CMD = 'cdparanoia'

Idlebar plugins

I like the idlebar to get a quick and extensive overwiev of my system status. Of course it looks very "computerized" (for a tv application), but I like it anyway. First activate the idlebar and afterwards load the plugins:
plugin.activate('idlebar.clock',level=50, args=('%a %H:%M', ))
plugin.activate( '', level=50, args=( 24) )
HOLIDAYS = [ ('01-01', 'newyear.png'),
('01-15', 'birthday.png'),
('12-26', 'christmas.png'),
plugin.activate('idlebar.volume', level=50)
HDDTEMP_HOST = "localhost"
plugin.activate('idlebar.hddtemp',level=10,args=(["/dev/hda"], 30, 45))
I can now monitor the temperatur progression of the system with harddisk-, cpu- and motherboard-temperature. The hddtemp-daemon was tricky to setup, because the rpm-package provided by SuSE didn't worked in daemon-mode. I had to fetch the current version from [4] and compile it. No problems afterwards.

Activate the hddtemp-daemon on system startup with:

/usr/local/sbin/hddtemp -d /dev/hda
Run a:
netcat localhost 7634
to check if the daemon is working properly. You should see an output like "|/dev/hda|HTS548040M9AT00|46|C|". See my freevo_init on the download page.

For the holiday plugin I copied some icons from the kde crystal directory to /usr/share/freevo/icons/holidays/. Anyone interested ?