<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN">

<book>
  <bookinfo>
    <title>Freevo Installation HOWTO</title>
    <subtitle>Build your own media box with Freevo and Linux</subtitle>

  <copyright>
    <year>2003</year>
    <holder>Joseph C. Stump</holder>
  </copyright>

  <legalnotice>
    <para>
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license can be obtained at http://www.gnu.org/licenses/fdl.html and is included as an appendix in this document.
    </para>
  </legalnotice>

  <author>
    <firstname>Joseph</firstname>
    <surname>Stump</surname>
    <authorblurb>
      <para>
        <email>freevo at joestump dot net</email>
      </para>
    </authorblurb>
  </author>

  <abstract>
    <para>
How to create your own Freevo based Linux powered PVR/Media Box. This includes information on setting up the video card, packages required, compiling MPlayer and tweeking the base installation of Freevo to suite your needs. NOTE! This merely documents what has worked for me. I DO NOT GUARANTEE THIS WILL WORK FOR YOU!
    </para>
  </abstract>

  </bookinfo>

  <toc>
  </toc>

  <chapter>
  <title>Introduction</title>

  <sect1>
    <title>Introduction</title>
    <para>
When I first decided to pursue creating my own Linux based PVR I started with a desire and a computer. Unfortunately, there wasn't much else on the Internet in the way of documentation. The Freevo team has done a great job in creating software, which hasn't left much time for good documentation, which is why I decided to create this document. Through this document I hope to enable other people to build their own Freevo based PVR / Media boxes.
    </para>
    <para>
If I have missed anything or completely messed up something please email me with suggestions, bugfixes and corrections. This document is not, by any means, a complete document.
    </para>
  </sect1>

  <sect1>
    <title>Credits</title>
    <para>
In producing this document, I have gathered information from the Freevo mailing list, the Freevo documentation and the MPlayer documentation. Without these two projects my dream of creating a Linux based PVR and the creation of this document would not be possible.
    </para>
  </sect1>

  <sect1>
    <title>Disclaimer</title>
    <para>
This document is available for free, and, while I have done the best I can to make it accurate and up to date, I take no responsibility for any problems you may encounter resulting from the use of this document.
    </para>
    <para>
I have documented exactly what works for me. From time to time I will include documentation that others submit. I can not verify the integrity of these submissions nor can I garantee that the contents of this document will help you in any ay.
    </para>
  </sect1>
  <sect1>
    <title>Contact / Feedback</title>
    <para>
If you have found this HOWTO to be helpful or you have found errors in this HOWTO please feel free to contact me at <email>freevo at joestump dot net</email>. Do NOT contact me with specific questions regarding your Freevo installation. 
    </para>
    <para>
If you are having problems installing Freevo or configuring your hardware you should subscribe to <ulink url="http://sourceforge.net/mail/?group_id=46652">Freevo's mailing lists</ulink> and ask your questions there. 
    </para>
  </sect1>
  <sect1>
    <title>Revision History</title>
    <para>

<revhistory>
  <revision>
    <revnumber>v0.25.0</revnumber>
    <date>2003-05-21</date>
    <authorinitials>JCS</authorinitials>
    <revremark>Initial Release</revremark>
  </revision>
</revhistory>
<revhistory>
  <revision>
    <revnumber>v0.50.0</revnumber>
    <date>2003-08-18</date>
    <authorinitials>JCS</authorinitials>
    <revremark>Added tvtime section and updated FAQ</revremark>
  </revision>
</revhistory>
<revhistory>
  <revision>
    <revnumber>v0.50.1</revnumber>
    <date>2003-08-18</date>
    <authorinitials>JCS</authorinitials>
    <revremark>Update TV Guide Time Format section and moved to a three point version number</revremark>
  </revision>
</revhistory>

    </para>
  </sect1>
  <sect1>
    <title>Obtaining This Document</title>
    <para>
You can obtain the latest release of this document in SGML, PDF, HTML, and as a TAR archive from <ulink url="http://zebulon.miester.org/~jstump/doc/freevo">http://zebulon.miester.org/~jstump/doc/freevo</ulink>. 
    </para>
  </sect1>
  </chapter>
 
  <chapter> 
    <title>Prerequisites</title>

  <sect1>
    <title>General</title>
    <para>
It is assumed that you have successfully installed Linux on your soon-to-be-a-PVR machine and that you have a good knowledge of Linux. Furthermore, it is assumed that you have previously recompiled a kernel and know how that process works. 
    </para>
    <para>
If you are new to Linux or you have never recompiled your kernel you might want to check out <ulink url="http://www.tldp.org/HOWTO/Kernel-HOWTO/index.html">The Linux Kernel HOWTO</ulink> and <ulink url="http://www.linux.org/docs/index.html">the linux.org documentation section</ulink>.
    </para>
  </sect1>

  <sect1>
    <title>Hardware</title>
    <para>
The hardware outlined in this section is the hardware that I use and can personally attest to working. Other hardware, besides the ones mentioned, may or may not work. I can not be held responsible if your hardware does not work or gets damaged during the process.
    </para>

    <sect2>
      <title>CPU / Motherboard</title>
      <para>
The Freevo homepage states that a 400MHz computer should be fine for simple TV viewing and CD/MP3 playback. However, if you would like to watch DVD's, record TV or use the more advanced features of Freevo it is generally accepted that at least a 1GHz CPU is required. 
      </para> 
    </sect2>
    <sect2>
      <title>Video Card</title>
      <para>
Without hesitation I would recommend you run like crazy to eBay and purchase a G400 that supports TV out. As documented across the Internet the Matrox G400 is the best supported video card by the frame buffer drivers. 
      </para>
      <para>
That being said, any card that supports TV out should work with Freevo. Your mileage may vary depending on how nice of a card it is, what type of card it is, and how well the cards are supported by the frame buffer drivers.
      </para>
    </sect2>
    <sect2>
      <title>TV Tuner Card</title>
      <para>
By far the most widely supported TV tuner cards for linux are the BT8x8 chipsets. A common and reasonably priced ($40.00 at CompUSA at the time of this writing) is the Hauppage WinTV card. If you want to use the TV support in Freevo you must have a TV tuner card.
      </para>
    </sect2>
    <sect2>
      <title>Motherboard</title>
      <para>
The only requirement for motherboards is that they support DMA. If your motherboard doesn't support the use of DMA then you will need to upgrade. Please note that DMA support is really only required if you are planning to watch DVD's with Freevo.
      </para>
    </sect2>
    <sect2>
      <title>CD/DVD/CDRW Drives</title>
      <para>
Obviously, you need a DVD drive if you plan on watching DVD movies. If you don't plan on watching DVD movies then any CD or CDRW drive will be sufficient to listen to CD's. I personally use a Samsung DVD/CDRW combo drive, which works great.
      </para>
    </sect2>
  </sect1>
  <sect1>
    <title>Software</title>
    <sect2>
      <title>Linux Kernel</title>
      <para>
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. 
      </para>
      <sect3>
        <title>BTTV</title>
        <para>
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 <ulink url="http://bytesex.org/">BTTV/Video4Linux main website</ulink> or by checking out the <ulink url="http://www.tldp.org/HOWTO/mini/BTTV.html">The BTTV Mini-HOWTO</ulink>. 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.
        </para>
      </sect3>
      <sect3>
        <title>Matrox Frame Buffer</title>
        <para>
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:
        </para>
        <para>
        <screen>
  <*>   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)                        
        </screen>
        </para>
        <para>
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.
        </para>
        <para>
You may also want to check out <ulink url="http://www.bglug.ca/matrox_tvout/g450_tvout_howto.html">Matrox G450/550 TV-out</ulink> as well as the <ulink url="http://davedina.apestaart.org/download/doc/Matrox-TVOUT-HOWTO-0.1.txt">The Matrox Millenium G400 TV/OUT Mini-HOWTO</ulink>
        </para>
      </sect3>
       <sect3>
        <title>General</title>
        <para>
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.
        </para>
      </sect3>
    </sect2>
     
    <sect2 id="xmltv">
      <title>XMLTV</title>
      <para>
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. 
      </para>
      <para>
If your distribution does not have XMLTV packages you will have to compile XMLTV from source. You can grab the latest source from <ulink url="http://membled.com/work/apps/xmltv/">the official XMLTV website</ulink>. After you have downloaded the XMLTV source follow the installation guide included with the source.
      </para>
      <para>
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.
      </para>
      <para>
      <screen>
#!/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
      </screen>
      </para>
    </sect2>
    <sect2 id="tvtime">
      <title>tvtime</title>
      <para>
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.      
      </para>
      <para>
The first thing you need to do is is download and install tvtime, which can be found at <ulink url="http://tvtime.sourceforge.net">tvtime.sourceforge.net</ulink>. 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. 
      </para>
      <para>
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.
      </para>
      <sect3>
        <title>stationlist.xml</title>
        <para>
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.
        </para>
        <para>
        <screen>
    &lt;station name="CNN" active="1" position="18"
             band="US Cable" channel="18"/&gt;
        </screen>
        </para>
        <para>
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.
        </para>
      </sect3>
      <sect3>
        <title>VBI Support</title>
        <para>
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.
        </para>
        <para>
        <screen>
  &lt;!--
    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. :)
  --&gt;
  &lt;option name="UseVBI" value="0"/&gt;

  &lt;!--
    This sets which device to use for VBI decoding.
  --&gt;
  &lt;option name="VBIDevice" value="/dev/vbi0"/&gt;
 
         </screen>
        </para>
        <para>
This information is completely independend of your TV.xml listings and is read
directly from data coming from your cable provider.
        </para>
      </sect3>
    </sect2>
    <sect2>
      <title>MPlayer</title>
      <para>
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).
      </para>
      <para>
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 <ulink url="http://www.mplayerhq.hu/homepage/design6/dload.html">from MPlayer's website</ulink>. 
      </para>

      <para>
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.
      </para>

      <para>
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.
      </para>

      <para>
<screen>
<prompt>[user@host]$</prompt> <command>mknod /dev/mga_vid 178 0</command>
</screen>
      </para>

      <para>
After you have the source and have created the mga_vid device you need to compile it. 
      </para>
    
      <para>
<screen>
<prompt>[user@host]$</prompt> <command>./configure</command>
<prompt>[user@host]$</prompt> <command>make</command>
<prompt>[user@host]$</prompt> <command>make install</command>
</screen>
      </para> 
      <para>
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.
      </para>

      <para>
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.
      </para>
<screen>
<prompt>[user@host]$</prompt> <command>cd ./drivers</command>
<prompt>[user@host]$</prompt> <command>make</command>
<prompt>[user@host]$</prompt> <command>insmod mga_vid.o</command> <replaceable>mga_ram_size=16</replaceable>
</screen>

      <para> 
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.
      </para> 

    </sect2>
  </sect1>
  </chapter>

  <chapter>
    <title>Installing / Configuring Freevo</title>
  <sect1>
    <title>Installing Freevo</title>
    <para>
It wouldn't be a PVR / Media box without Freevo! I downloaded the binary distribution from <ulink url="http://sourceforge.net/project/showfiles.php?group_id=46652">the official Freevo website</ulink>, which should include everything you need to start up Freevo. Once you have untar'd Freevo do the following:
    </para>

    <screen>
    <prompt>[user@host]$</prompt> <command>./configure</command>
    <prompt>[user@host]$</prompt> <command>cp freevo_config.py local_config.py</command>
    <prompt>[user@host]$</prompt> <command>ln -s /path/to/freevo_source /usr/local/freevo</command>
    </screen>

    <para>
That's pretty much it. After you have done the above you will need to start configuring Freevo's config files. 
    </para>
  </sect1>
  <sect1>
    <title>Configuring Freevo</title>
    <para>
There are three main configuration files for Freevo. The first is freevo.conf, which stores basic information about resolution, binary paths, and drivers. The second is freevo_config.py that stores everything else. The third local_config.py overrides all settings in freevo_config.py. The Freevo team suggest making changes to local_config.py and leaving freevo_config.py as it was when you first installed Freevo. Since I'm a rebel I did all of my changes in freevo_config.py. Just make sure that local_config.py isn't overwriting your changes.
    </para>
    <sect2>
      <title>freevo.conf</title> 
      <para>
This is could be called the config file's config file. The variables in freevo.conf are used within the main (and larger) config file freevo_config.py. The main variables that you need to pay attention to are; display, geometry, mplayer, and tv. Below is an example of my version. Make sure to change the mplayer variable to your newly compiled mplayer binary, which should be /usr/local/bin/mplayer.
      </para>
      <para>
      <screen>
chanlist = us-cable
display = mga
geometry = 768x576
jpegtran = ./runtime/apps/jpegtran
mplayer = /usr/local/bin/mplayer
tv = ntsc
version = 1.0
      </screen>
      </para>
    </sect2>
    <sect2 id="freevoconfig">
      <title>freevo_config.py</title>
      <para>
The main config file. You can alternatively make changes to local_config.py, which superseeds this file. In this document freevo_config.py and local_config.py can be used interchangeably.
      </para>
      <sect3>
        <title>Channel List</title>
        <para>
Freevo requires that you edit the channel list manually to your local settings. It takes a few minutes, but actually is a feature in the long run. In freevo_config.py look for the variable named TV_CHANNELS. It should look something like this:
        </para>
        <para>
        <screen>
TV_CHANNELS = [('69 COMEDY', 'COMEDY', '69'),
               ('56 HISTORY', 'HISTORY', '56'),
               ('2 KTVI', 'KTVI', '2'),
               ('4 KMOV', 'KMOV', '4'),
               ('5 KSDK', 'KSDK', '5'),
               ('6 TBS', 'TBS', '6'),
               ('11 KPLR', 'KPLR', '11'),
               ...
        </screen>
        </para>
        <para>
The first field is the XMLTV "channel id", which is basically the channel number and the short name (ESPN, COMEDY, etc.). The second is the name which Freevo displays in the TV Guide and the third is the "tv channel name". I just set the third field to the channel number. Note: If you are downloading the logos Freevo will use a logo instead of the designated "display name" in the second field.
        </para>
        <para>
The advantage of doing it this way is that you can strip out channels you never watch (like the local college channels) to make your TV Guide shorter and easier to use.
        </para>
      </sect3>
    </sect2>
     <sect2>
      <title>local_config.py</title>
      <para>
See <link linkend="freevoconfig">freevo_config.py</link> for more information.
      </para>
    </sect2>
  </sect1>
  </chapter>
  <chapter>
    <title>DVD Playback</title>
    <para>
Freevo should automatically recognize your DVD and play it accordingly with MPlayer. There are a few things you can do to make sure DVD playback is smooth. If you are having problems after doing all of the following I highly recommend contacting the mailing lists or upgrading your processor/RAM.
    </para>
    <sect1>
      <title>Enabling DMA for DVD Playback</title>
      <para>
When I first started watching DVD's I noticed some choppy playback. This was extermely minimal, but annoying. One thing that helped immensely was enabling DMA on my DVD drive. 
      </para>
      <para>
      <screen>
      <prompt>[user@host]$</prompt> <command>hdparm -d 1 /dev/hdX</command>
      </screen>
      </para>
      <para>
Make sure to change X to the appropriate number of your DVD drive. You may also want to enable DMA on your hard drives as well. Also, you should add this to your startup scripts so this option is enabled during boot up.
      </para>
    </sect1>
    <sect1>
      <title>Increasing MPlayer Cache</title>
      <para>
I noticed that by adding more cache to the mplayer command that Freevo used helped with my DVD playback as well. It didn't completely solve the problem, but it did help. What finally solved my problem was enabling DMA, but your mileage may vary. In freevo_config.py look for the variable MPLAYER_ARGS_DVD. It should look something like this:
      </para>
      <para>
      <screen>
MPLAYER_ARGS_DVD     = '-cache 8192 -dvd %s'
      </screen>
      </para>
      <para>
I upped it to 32768 (32MB). You can change it to whatever you like using the following equation: 1024 * MB where MB is the number of MB you want to cache.
      </para>
    </sect1>
  </chapter>

  <chapter>
    <title>Skin Files</title>
    <para>
Despite what was said in all of the documentation Freevo didn't properly scale the skin to my TV. Why this was happening I don't know, but the fix was rather easy. All it required was changing some of the sizes in the skin files. This section will also cover some of the other changes I made to make Freevo look nicer on the screen.
    </para>
    <sect1>
      <title>Introduction</title>
      <para>
Freevo uses XML files to define the layout of Freevo. This makes changing the layout farily easy for anyone who knows how to use a text editor. However, the directory structure can be a little confusing at first.
      </para>
    </sect1>

    <sect1>
      <title>Changing the Default Skin</title>
      <para>
The skin files reside in skins/xml/type1/blue_round1.fxd. Freevo comes with a few variations of its default skin, Blue Round, as well as one called Grey. If you want to change your skin you need to open freevo_config.py and change the variable SKIN_XML_FILE. Change it to the name of the file of your desired skin minus the '.fxd'. 
      </para>
      <para>
        <screen>
        # Change the default skin to Grey (skins/xml/type1/grey1.fxd)
        SKIN_XML_FILE = 'grey1'
        </screen>
      </para>
    </sect1>

    <sect1>
      <title>Modifying Screen Layout</title>
      <para>
One of the problems I had building my Freevo box was that the top of the screen spilled off of my TV screen. To fix this I first copied the default skin, skins/xml/type1/blue_round1.fxd, to my own fxd file (you can name it whatever you want).
      </para>
      <para>
      <screen>
      <prompt>[user@host]$</prompt> <command>cd ./skins/xml/type1</command>
      <prompt>[user@host]$</prompt> <command>cp blue_round1.fxd</command> <replaceable>myskin.fxd</replaceable>
      </screen>
      </para>
      <para>
Once you have a new skin file you need to change your default skin in freevo_config.py to your new skin file. After you have changed the default skin it's time to start editing the fxd file.
      </para>
    </sect1>
    <sect1>
      <title>Changing Icons</title>
      <para>
It's pretty easy to change the icons. There are a few ways to change it. You can change the icon path in your skins XML file, or your can copy new images over the current skin's image files. Being a lazy person and not wanting to break anything I decided to copy my new image files over the old ones. If you are using the Blue Round skin the icon files are located in skins/icons/AquaFusion and are aptly named "tv.png" and the like. I downloaded the images from <ulink url="http://halfempty.com/bright/pics/freevo">http://halfempty.com/bright/pics/freevo</ulink>, which look great.
      </para>
    </sect1>
  </chapter>
  <chapter>
    <title>Misc.</title>
    <sect1>
      <title>Changing TV Guide Time Format</title>
      <para>
By default Freevo uses a 24 hour military format. This is great if your dad was in the military, but quite confusing for us civilian folks. As of version 1.3.2 this is defined in freevo_config.py with the TV_TIMEFORMAT variable. By default it is set to '%H:%M'. To change it to a 12 hour format change it to '%I:%M'.
      </para>
      <para>
You will want to check out <ulink url="http://www.python.org/doc/current/lib/module-time.html">Python's strftime documentation</ulink> to format it exactly how you want it. 
      </para>
    </sect1>

    <sect1>
      <title>Downloading TV Logos</title>
      <para>
Freevo comes with a helper application that downloads the logos specified in the TV.xml file created by XMLTV. Freevo then uses these images in its TV guide, which makes it easier to browse the various channels.
      </para>
      <para>
      <screen>
      <prompt>[user@host]$</prompt> <command>./freevo execute helpers/makelogos.py</command>
      </screen>
      </para>
    </sect1>
    <sect1>
      <title>Booting into Freevo</title>
      <para>
It is possible to boot directly into Freevo. This option will be mainly used by those who wish to use Freevo as a stand alone media box. To do so you should be familiar with Linux runlevels and how the startup process works for your specific distribution.
      </para>
      <para>
First you will need to create a script that starts freevo and does any resultion settings, module configs, etc. Once you have created the script put it in your distributions startup script directory (/etc/init.d in Debian). After that you need to link it to the correct runlevel. Here is an example in Debian:
      </para>
      <para>
      <screen>
      <prompt>[user@host]$</prompt> <command>cd /etc/rc2.d</command>
      <prompt>[user@host]$</prompt> <command>ln ../init.d/freevo S98freevo</command>
      </screen>
      </para>
      <para>
Your default runlevel may change as well as where you want your Freevo startup script to run within that runlevel. Change to suite your specific needs/distro.
      </para>
    </sect1>
    <sect1>
      <title>Automating Freevo with Cron</title>
      <para>
If you truly plan on your Freevo box being a stand alone media box you will want to set up your XMLTV and record scripts in cron. This will ensure that your box runs smoothly without any problems.
      </para>
      <sect2>
        <title>XMLTV</title>
        <para>
If you have created the script mentioned in the XMLTV setup section then it should be fairly easy to automate the XMLTV channel grabbing. You might want to add a few lines to your XMLTV script that grabs the TV logos as well. Once you have your script working properly add the following to your crontab:
        </para>
        <para>
        <screen>
0 0 * * * /path/to/xmltv_script.sh
        </screen>
        </para>
        <para>
Make sure to change the path above to the correct path to your XMLTV script. See <link linkend="xmltv">the XMLTV section</link> for more information.
        </para>
      </sect2>
      <sect2 id="freevorecord">
        <title>Freevo Recording Daemon</title>
        <para>
It's not technically a daemon per se, but you will need to run it via cron every minute so that it can check for programs to record and start recording them if it is time. Some people run it every hour or half hour as well. I personally would hate to miss the first few minutes of a program though so I choose to run it every minute. Once you have set up your directories in freevo_config.py you will need to add the following entry to your cron:
        </para>
        <para>
        <screen>
* * * * * /usr/local/freevo/freevo execute src/tv/record_daemon.py
        </screen>
        </para>
      </sect2>
    </sect1>
    <sect1>
      <title>Related Documents / Websites</title>
      <para>
There are a number of websites and documents that are directly related to this one and may be of some use.
      </para>
      <para>
<itemizedlist>
<listitem>
<para>
<ulink url="http://www.freevo.org">The Freevo Homepage</ulink>
</para>
</listitem>
<listitem>
<para>
<ulink url="http://www.tldp.org/HOWTO/mini/BTTV.html">The BTTV Mini-HOWTO</ulink>
</para>
</listitem>
<listitem>
<para>
<ulink url="http://davedina.apestaart.org/download/doc/Matrox-TVOUT-HOWTO-0.1.txt">The Matrox Millenium G400 TV/OUT Mini-HOWTO</ulink>
</para>
</listitem>
</itemizedlist>
      </para>
    </sect1>
  </chapter>
  <chapter>
    <title>Frequently Asked Questions</title>
    <qandaset>
    <qandaentry>
      <question><para>Does Freevo support DVD menus?</para></question>
      <answer><para>
There is initial support as of Freevo 1.3.2, which allows you to browse to
different chapters on the DVD, however actual DVD menus are not currently 
supported. Xine does support DVD menus are there is currently a plugin in 
development that may work with DVD menus, however I have not tried it.
      </para>
      </answer>
    </qandaentry>
    <qandaentry>
      <question><para>Does Freevo rip/encode CD's?</para></question>
      <answer><para>
There is a CD ripping plugin that should be available in CVS. For more information regarding this plugin you may wish to consult the mailing list.
      </para>
      </answer> 
    </qandaentry>
    <qandaentry>
      <question><para>Why are the audio and video out of sync while watching live TV?</para></question>
      <answer><para>
Apparently, this is an MPlayer problem. Currently, the Freevo team is looking int possible fixes to the problem. The problem is that MPlayer reads video directly from your captuer card (usually /dev/video0) and sound from your sound card. The sound however, is routed through your sound card from your TV tuner card, resulting in a/v sync problems. 
      </para>
      <para>
The solution that works for me is outlined in <link linkend="tvtime">the tvtime section</link>. The tvtime plugin works perfectly for me. It also offers VBI support and other onscreen display goodies.
      </para>
      </answer> 
    </qandaentry>

    </qandaset>
  </chapter>


  <chapter>
    <title>Freevo User Manual</title>
    <para>
This section is dedicated to actually using your Freevo box. After you have your box all set up and working properly you will want to actually use it. If you want, print this section out and put it on your coffee table for quick reference.
    </para>
    <sect1>
      <title>General</title>
      <sect2>
        <title>Navigation</title>
        <para>
To navigate the menus use the arrow keys for navigation and the ENTER key to select an item. To go back to the previous menu hit the ESC key.
        </para>
      </sect2>
      <sect2>
        <title>Help</title> 
        <para>
To view the on screen help menu hit the "h" key.
        </para>
      </sect2>
    </sect1>
    <sect1>
      <title>TV Guide</title>
      <sect2>
        <title>Changing Stations</title>
        <para>
There are two ways in which you can change stations. If you are currently watching a channel and would like to go up or down a channel type "c" or "v". Another option is to press "ESC" to return to the TV Guide and then use the arrow keys to navigate to the correct channel. Hit "ENTER" once you have found the desired station.
        </para>
      </sect2>
      <sect2>
        <title>Recording Shows</title>
        <para>
To record a show you need to go to the TV Guide. Once you are in the TV Guide browse the listings using the arrow keys. After you have highlighted the show you wish to record hit "F6" to bring up the recording menu.
        </para>
        <para>
Please note that shows may not be recorded properly unless you have set Freevo up to check for recordings via Cron. See <link linkend="freevorecord">Freevo Recording Daemon</link> for more information.
        </para>
      </sect2>
    </sect1>
    <sect1>
      <title>DVD Player</title>
      <sect2>
        <title>Fastforward / Rewind</title>
        <para>
Simple use the right and left arrow keys to fastforward or rewind your DVD. 
        </para>
      </sect2>
    </sect1>
    <sect1>
      <title>Music Player</title>
      <sect2>
        <title>Selecting a Track</title>
        <para>
If you are currently listening to a CD you can use the right and left arrows to select tracks or you can hit ESC and select the desired track from the Freevo menu.
        </para>
      </sect2>
    </sect1>
  </chapter>

<appendix id="gfdl">
<title>GNU Free Documentation License</title>
<subtitle>Version 1.2, November 2002</subtitle>

<blockquote id="fsf-copyright">
 <para>Copyright (C) 2000,2001,2002  Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</para>
</blockquote>

<section id="gfdl-0"><title>PREAMBLE</title>

<para>The purpose of this License is to make a manual, textbook, or
other functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it, with
or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible for
modifications made by others.</para>

<para>This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense.  It
complements the GNU General Public License, which is a copyleft license
designed for free software.</para>

<para>We have designed this License in order to use it for manuals for
free software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does.  But this License is not limited to software manuals; it
can be used for any textual work, regardless of subject matter or
whether it is published as a printed book.  We recommend this License
principally for works whose purpose is instruction or reference.</para>
</section>

<section id="gfdl-1"><title>APPLICABILITY AND DEFINITIONS</title>

<para id="gfdl-doc">This License applies to any manual or other work, in
any medium, that contains a notice placed by the copyright holder saying
it can be distributed under the terms of this License.  Such a notice
grants a world-wide, royalty-free license, unlimited in duration, to use
that work under the conditions stated herein.  The "Document", below,
refers to any such manual or work.  Any member of the public is a
licensee, and is addressed as "you".  You accept the license if you
copy, modify or distribute the work in a way requiring permission under
copyright law.</para>

<para id="gfdl-mod-ver">A "Modified Version" of the Document means any
work containing the Document or a portion of it, either copied verbatim,
or with modifications and/or translated into another language.</para>

<para id="gfdl-secnd-sect">A "Secondary Section" is a named appendix or
a front-matter section of the Document that deals exclusively with the
relationship of the publishers or authors of the Document to the
Document's overall subject (or to related matters) and contains nothing
that could fall directly within that overall subject.  (Thus, if the
Document is in part a textbook of mathematics, a Secondary Section may
not explain any mathematics.)  The relationship could be a matter of
historical connection with the subject or with related matters, or of
legal, commercial, philosophical, ethical or political position
regarding them.</para>

<para id="gfdl-inv-sect">The "Invariant Sections" are certain Secondary
Sections whose titles are designated, as being those of Invariant
Sections, in the notice that says that the Document is released under
this License.  If a section does not fit the above definition of
Secondary then it is not allowed to be designated as Invariant.  The
Document may contain zero Invariant Sections.  If the Document does not
identify any Invariant Sections then there are none.</para>

<para id="gfdl-cov-text">The "Cover Texts" are certain short passages of
text that are listed, as Front-Cover Texts or Back-Cover Texts, in the
notice that says that the Document is released under this License.  A
Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at
most 25 words.</para>

<para id="gfdl-transparent">A "Transparent" copy of the Document means a
machine-readable copy, represented in a format whose specification is
available to the general public, that is suitable for revising the
document straightforwardly with generic text editors or (for images
composed of pixels) generic paint programs or (for drawings) some widely
available drawing editor, and that is suitable for input to text
formatters or for automatic translation to a variety of formats suitable
for input to text formatters.  A copy made in an otherwise Transparent
file format whose markup, or absence of markup, has been arranged to
thwart or discourage subsequent modification by readers is not
Transparent.  An image format is not Transparent if used for any
substantial amount of text.  A copy that is not "Transparent" is called
"Opaque".</para>

<para>Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML or
XML using a publicly available DTD, and standard-conforming simple HTML,
PostScript or PDF designed for human modification.  Examples of
transparent image formats include PNG, XCF and JPG.  Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the machine-generated
HTML, PostScript or PDF produced by some word processors for output
purposes only.</para>

<para id="gfdl-title-page">The "Title Page" means, for a printed book,
the title page itself, plus such following pages as are needed to hold,
legibly, the material this License requires to appear in the title page.
For works in formats which do not have any title page as such, "Title
Page" means the text near the most prominent appearance of the work's
title, preceding the beginning of the body of the text.</para>

<para id="gfdl-entitled">A section "Entitled XYZ" means a named subunit
of the Document whose title either is precisely XYZ or contains XYZ in
parentheses following text that translates XYZ in another language.
(Here XYZ stands for a specific section name mentioned below, such as
"Acknowledgements", "Dedications", "Endorsements", or "History".)  To
"Preserve the Title" of such a section when you modify the Document
means that it remains a section "Entitled XYZ" according to this
definition.</para>

<para>The Document may include Warranty Disclaimers next to the notice
which states that this License applies to the Document.  These Warranty
Disclaimers are considered to be included by reference in this License,
but only as regards disclaiming warranties: any other implication that
these Warranty Disclaimers may have is void and has no effect on the
meaning of this License.</para>
</section>

<section id="gfdl-2"><title>VERBATIM COPYING</title>

<para>You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies to
the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License.  You may not use
technical measures to obstruct or control the reading or further copying
of the copies you make or distribute.  However, you may accept
compensation in exchange for copies.  If you distribute a large enough
number of copies you must also follow the conditions in section 3.
</para>

<para>You may also lend copies, under the same conditions stated above,
and you may publicly display copies.</para>
</section>

<section id="gfdl-3"><title>COPYING IN QUANTITY</title>

<para>If you publish printed copies (or copies in media that commonly
have printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover Texts:
Front-Cover Texts on the front cover, and Back-Cover Texts on the back
cover.  Both covers must also clearly and legibly identify you as the
publisher of these copies.  The front cover must present the full title
with all words of the title equally prominent and visible.  You may add
other material on the covers in addition.  Copying with changes limited
to the covers, as long as they preserve the title of the Document and
satisfy these conditions, can be treated as verbatim copying in other
respects.</para>

<para>If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.</para>

<para>If you publish or distribute Opaque copies of the Document
numbering more than 100, you must either include a machine-readable
Transparent copy along with each Opaque copy, or state in or with each
Opaque copy a computer-network location from which the general
network-using public has access to download using public-standard
network protocols a complete Transparent copy of the Document, free of
added material.  If you use the latter option, you must take reasonably
prudent steps, when you begin distribution of Opaque copies in quantity,
to ensure that this Transparent copy will remain thus accessible at the
stated location until at least one year after the last time you
distribute an Opaque copy (directly or through your agents or retailers)
of that edition to the public.</para>

<para>It is requested, but not required, that you contact the authors of
the Document well before redistributing any large number of copies, to
give them a chance to provide you with an updated version of the
Document.</para>
</section>

<section id="gfdl-4"><title>MODIFICATIONS</title>

<para>You may copy and distribute a Modified Version of the Document
under the conditions of sections 2 and 3 above, provided that you
release the Modified Version under precisely this License, with the
Modified Version filling the role of the Document, thus licensing
distribution and modification of the Modified Version to whoever
possesses a copy of it.  In addition, you must do these things in the
Modified Version:</para>

<orderedlist id="gfdl-modif-cond" numeration="upperalpha">
<listitem><simpara>Use in the Title Page (and on the covers, if any) a
  title distinct from that of the Document, and from those of previous
  versions (which should, if there were any, be listed in the History
  section of the Document).  You may use the same title as a previous
  version if the original publisher of that version gives permission.
</simpara></listitem>
<listitem><simpara>List on the Title Page, as authors, one or more
  persons or entities responsible for authorship of the modifications in
  the Modified Version, together with at least five of the principal
  authors of the Document (all of its principal authors, if it has fewer
  than five), unless they release you from this requirement.
</simpara></listitem>
<listitem><simpara>State on the Title page the name of the publisher of
  the Modified Version, as the publisher.</simpara></listitem>
<listitem><simpara>Preserve all the copyright notices of the Document.
</simpara></listitem>
<listitem><simpara>Add an appropriate copyright notice for your
  modifications adjacent to the other copyright notices.
</simpara></listitem>

<listitem><simpara>Include, immediately after the copyright notices, a
  license notice giving the public permission to use the Modified
  Version under the terms of this License, in the form shown in the
  <link linkend="gfdl-addendum">Addendum</link> below.
</simpara></listitem>
<listitem><simpara>Preserve in that license notice the full lists of
  Invariant Sections and required Cover Texts given in the Document's
  license notice.</simpara></listitem>
<listitem><simpara>Include an unaltered copy of this License.
</simpara></listitem>
<listitem><simpara>Preserve the section Entitled "History", Preserve its
  Title, and add to it an item stating at least the title, year, new
  authors, and publisher of the Modified Version as given on the Title
  Page.  If there is no section Entitled "History" in the Document,
  create one stating the title, year, authors, and publisher of the
  Document as given on its Title Page, then add an item describing the
  Modified Version as stated in the previous sentence.
</simpara></listitem>
<listitem><simpara>Preserve the network location, if any, given in the
  Document for public access to a Transparent copy of the Document, and
  likewise the network locations given in the Document for previous
  versions it was based on.  These may be placed in the "History"
  section.  You may omit a network location for a work that was
  published at least four years before the Document itself, or if the
  original publisher of the version it refers to gives permission.
</simpara></listitem>
<listitem><simpara>For any section Entitled "Acknowledgements" or
  "Dedications", Preserve the Title of the section, and preserve in the
  section all the substance and tone of each of the contributor
  acknowledgements and/or dedications given therein.
</simpara></listitem>
<listitem><simpara>Preserve all the Invariant Sections of the Document,
  unaltered in their text and in their titles.  Section numbers or the
  equivalent are not considered part of the section titles.
</simpara></listitem>

<listitem><simpara>Delete any section Entitled "Endorsements".
  Such a section may not be included in the Modified Version.
</simpara></listitem>
<listitem><simpara>Do not retitle any existing section to be Entitled
  "Endorsements" or to conflict in title with any Invariant Section.
</simpara></listitem>
<listitem><simpara>Preserve any Warranty Disclaimers.
</simpara></listitem>
</orderedlist>

<para>If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant.  To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.</para>

<para>You may add a section Entitled "Endorsements", provided it
contains nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.</para>

<para>You may add a passage of up to five words as a Front-Cover Text,
and a passage of up to 25 words as a Back-Cover Text, to the end of the
list of Cover Texts in the Modified Version.  Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or through
arrangements made by) any one entity.  If the Document already includes
a cover text for the same cover, previously added by you or by
arrangement made by the same entity you are acting on behalf of, you may
not add another; but you may replace the old one, on explicit permission
from the previous publisher that added the old one.</para>

<para>The author(s) and publisher(s) of the Document do not by this
License give permission to use their names for publicity for or to
assert or imply endorsement of any Modified Version.</para>
</section>

<section id="gfdl-5"><title>COMBINING DOCUMENTS</title>

<para>You may combine the Document with other documents released under
this License, under the terms defined in <link linkend="gfdl-4">section
4</link> above for modified versions, provided that you include in the
combination all of the Invariant Sections of all of the original
documents, unmodified, and list them all as Invariant Sections of your
combined work in its license notice, and that you preserve all their
Warranty Disclaimers.</para>

<para>The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy.  If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by adding
at the end of it, in parentheses, the name of the original author or
publisher of that section if known, or else a unique number.  Make the
same adjustment to the section titles in the list of Invariant Sections
in the license notice of the combined work.</para>

<para>In the combination, you must combine any sections Entitled
"History" in the various original documents, forming one section
Entitled "History"; likewise combine any sections Entitled
"Acknowledgements", and any sections Entitled "Dedications".  You must
delete all sections Entitled "Endorsements".</para>

</section>

<section id="gfdl-6"><title>COLLECTIONS OF DOCUMENTS</title>

<para>You may make a collection consisting of the Document and other
documents released under this License, and replace the individual copies
of this License in the various documents with a single copy that is
included in the collection, provided that you follow the rules of this
License for verbatim copying of each of the documents in all other
respects.</para>

<para>You may extract a single document from such a collection, and
distribute it individually under this License, provided you insert a
copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that
document.</para>
</section>

<section id="gfdl-7"><title>AGGREGATION WITH INDEPENDENT WORKS</title>

<para>A compilation of the Document or its derivatives with other
separate and independent documents or works, in or on a volume of a
storage or distribution medium, is called an "aggregate" if the
copyright resulting from the compilation is not used to limit the legal
rights of the compilation's users beyond what the individual works
permit.  When the Document is included in an aggregate, this License does
not apply to the other works in the aggregate which are not themselves
derivative works of the Document.</para>

<para>If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on covers
that bracket the Document within the aggregate, or the electronic
equivalent of covers if the Document is in electronic form.  Otherwise
they must appear on printed covers that bracket the whole
aggregate.</para>
</section>

<section id="gfdl-8"><title>TRANSLATION</title>

<para>Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections.  You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers.  In case of a disagreement between the
translation and the original version of this License or a notice or
disclaimer, the original version will prevail.</para>

<para>If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve its
Title (section 1) will typically require changing the actual
title.</para>
</section>

<section id="gfdl-9"><title>TERMINATION</title>

<para>You may not copy, modify, sublicense, or distribute the Document
except as expressly provided for under this License.  Any other attempt
to copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License.  However,
parties who have received copies, or rights, from you under this License
will not have their licenses terminated so long as such parties remain
in full compliance.</para>
</section>

<section id="gfdl-10"><title>FUTURE REVISIONS OF THIS LICENSE</title>

<para>The Free Software Foundation may publish new, revised versions of
the GNU Free Documentation License from time to time.  Such new versions
will be similar in spirit to the present version, but may differ in
detail to address new problems or concerns.  See
http://www.gnu.org/copyleft/.</para>

<para>Each version of the License is given a distinguishing version
number.  If the Document specifies that a particular numbered version of
this License "or any later version" applies to it, you have the option
of following the terms and conditions either of that specified version
or of any later version that has been published (not as a draft) by the
Free Software Foundation.  If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.</para>
</section>

<section id="gfdl-addendum"><title>ADDENDUM: How to use this License for
  your documents</title>

<para>To use this License in a document you have written, include a copy
of the License in the document and put the following copyright and
license notices just after the title page:</para>

<blockquote id="copyright-sample"><para>
    Copyright (c)  YEAR  YOUR NAME.
    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 1.2
    or any later version published by the Free Software Foundation;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
    A copy of the license is included in the section entitled "GNU
    Free Documentation License".
</para></blockquote>

<para>If you have Invariant Sections, Front-Cover Texts and Back-Cover
Texts, replace the "with...Texts." line with this:</para>

<blockquote id="inv-cover-sample"><para>
    with the Invariant Sections being LIST THEIR TITLES, with the
    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
</para></blockquote>

<para>If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.</para>

<para>If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of free
software license, such as the GNU General Public License, to permit
their use in free software.</para>
</section>
</appendix>

</book>
