Software

Freevo Installation HOWTO: Build your own media box with Freevo and Linux
Prev | Chapter 2. Prerequisites | Next

# 2.3. Software

## 2.3.1. Linux Kernel

This setup will require a kernel recompile. Specifically, you will need to download the latest version of the kernel. I used version 2.4.20 in my initial tests, but had problems with audio/video syncing while watching TV.

### 2.3.1.1. BTTV

I use a BTTV capture card because it's the most widely supported TV capture card for Linux. Because Video4Linux is constantly changing and it is widely documented elsewhere I won't cover it in great detail in this document. You should find all you need to get your BTTV (or other tuner cards) working successfully at the BTTV/Video4Linux main website or by checking out the The BTTV Mini-HOWTO. I will point out that I was not able to get my Matrox Marvel TV Tuner card to work and, even if I had, it would not have supported full screen TV in framebuffer mode.

### 2.3.1.2. Matrox Frame Buffer

Freevo uses the frame buffer to display graphics. At the time of this writing the most widely supported video card was the Matrox G400 card. In the "Console drivers" section of the kernel config menu you need to go to "Frame-buffer support" and enable "Support for frame buffer devices". Below is an example of my Matrox G400 setup:

      <*>   Matrox acceleration (EXPERIMENTAL) (NEW)
      [ ]     Millennium I/II support (NEW)
      [ ]     Mystique support (NEW)
      [*]     G100/G200/G400/G450/G550 support (NEW)
      < >       G450/G550 second head support
      [*]     Multihead support (NEW)

I chose to include Matrox frame buffer support compiled directly into the kernel instead of a module. Either way should work, but remember to load the modules during your boot sequence.

You may also want to check out Matrox G450/550 TV-out as well as the The Matrox Millenium G400 TV/OUT Mini-HOWTO

### 2.3.1.3. General

I would also recommend installing support for EXT3 into your kernel, which is default in 2.4 kernels. If your Freevo box is going to be a stand alone box you won't be wanting to force check drives if the power goes out. Other things you should think about are your sound card drivers (if you're not using ALSA), network cards, etc.

## 2.3.2. XMLTV

XMLTV is used to grab your local TV listings. Freevo uses these files for its internal TV guide. My distro, Debian, has packages for XMLTV in its unstable branch, which worked fine for me.

If your distribution does not have XMLTV packages you will have to compile XMLTV from source. You can grab the latest source from the official XMLTV website. After you have downloaded the XMLTV source follow the installation guide included with the source.

After you have the XMLTV sources compiled and installed you will want to create a script that downloads the XML files and sets up the link to /tmp/TV.xml. Below is an example of what I used.

    #!/bin/sh

    todayis=`date +%Y%m%d`

    tv_grab_na --days 1 | tv_sort > /usr/local/freevo/xmltv/listings_$todayis.xml
    rm -f /tmp/TV.xml
    ln -s /usr/local/freevo/xmltv/listings_$todayis.xml /tmp/TV.xml

## 2.3.3. tvtime

When I first started working on my Freevo box I was unable to get MPlayer to work properly with live TV. Basically, my audio and video were out of sync, which made watching live TV like watching an old crappy version of Godzilla. Luckily, someone created a tvtime plugin, which works perfectly for me.

The first thing you need to do is is download and install tvtime, which can be found at tvtime.sourceforge.net. Follow the instructions to install tvtime. When you are done open up your freevo.conf file and change the tvtime variable to the path of your newly installed tvtime.

After you have tvtime set up in your freevo.conf file you will want to open up freevo_config.py and enable the tv.tvtime plugin and disable the tv.mplayer plugin. Search for 'tvtime' and you will see what I'm talking about.

### 2.3.3.1. stationlist.xml

tvtime installs all of its configuration files in $HOME by default. If you wish to change it's default behavior you will need to go into the home directory of the user which Freevo runs as. My configuration runs as root so changing to /root/.tvtime did it for me. In there you will find a file called stationlist.xml, which defines how stations are shown onscreen in tvtime. A sample line follows.

        <station name="CNN" active="1" position="18"
                 band="US Cable" channel="18"/>

The name attribute defines what text shows up on the onscreen display when tvtime changes to that specific channel. As far as I can tell there isn't any real limit as to what you can place in this field.

### 2.3.3.2. VBI Support

VBI stands for vertical blanking interval and is the standard for NTSC which allows data besides video to be sent to your TV. Such data includes closed captioning, station information, show information and ratings, etc. If you want tvtime's onscreen display to show such information (such as TV show names, ratings, time start and time stop) you will need to turn this on in your $HOME/.tvtime/tvtime.xml file. Below is an example.

      <!--
        Set this to 1 to enable VBI decoding.  tvtime supports decoding of
        closed captions and XDS channel information data.  Both of these
        standards are specific to NTSC regions, since that's what the
        tvtime authors use. :)
      -->
      <option name="UseVBI" value="0"/>

      <!--
        This sets which device to use for VBI decoding.
      -->
      <option name="VBIDevice" value="/dev/vbi0"/>

This information is completely independend of your TV.xml listings and is read directly from data coming from your cable provider.

## 2.3.4. MPlayer

MPlayer is an advanced media player for Linux that supports a wide range of video codecs. Freevo uses MPlayer for TV playback, CD/DVD playing, and TV recording. As of this writing MPlayer was not in any of the Debian branches. A binary version of MPlayer is included with Freevo, but was not compiled with TV or CD support as of the latest version (1.3.2-pre4).

As a result I had to compile MPlayer from source, which isn't a difficult task by any means, but does require a few extra steps. First you will need the latest version of MPlayer, which can be downloaded from MPlayer's website.

In order to play DVD's or TV at full screen using the frame buffer you will need to compile and install the mga_vid drivers included with MPlayer. The default frame buffer drivers do not include support for hardware scaling. In my experience this led to a 1 inch black border around my TV and DVD playback.

Before you can compile MPlayer you need to create the mga_vid device. MPlayer will not compile the mga output driver if /dev/mga_vid does not exist.

    [user@host]$ mknod /dev/mga_vid 178 0

After you have the source and have created the mga_vid device you need to compile it.

    [user@host]$ ./configure
    [user@host]$ make
    [user@host]$ make install

MPlayer should recognize that /dev/mga_vid exists and compile your setup accordingly. MPlayer will NOT compile TV support if your TV tuner card has not been properly set up.

Once you have compiled MPlayer you will need to compile the mga_vid kernel module which is found in the drivers director of the MPlayer source. Change into that directory and compile the driver.

    [user@host]$ cd ./drivers
    [user@host]$ make
    [user@host]$ insmod mga_vid.o mga_ram_size=16

Setting the RAM size is optional. I found that in order for the driver to work properly you have to set the RAM size for cards that only have 16MB of RAM, without setting it the driver assumed the card had 32MB of RAM. Make sure your kernel driver is working by running the test program included in the drivers directory.

Prev | Home | Next
Hardware | Up | Installing / Configuring Freevo