# Freevo Installation HOWTO

Build your own media box with Freevo and Linux
2003
Joseph C. Stump

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.

Joseph
Stump

freevo at joestump dot net

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!

## Introduction

### Introduction

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.

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.

### Credits

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.

### Disclaimer

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.

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.

### Contact / Feedback

If you have found this HOWTO to be helpful or you have found errors in this HOWTO please feel free to contact me at freevo at joestump dot net. Do NOT contact me with specific questions regarding your Freevo installation.

If you are having problems installing Freevo or configuring your hardware you should subscribe to Freevo's mailing lists and ask your questions there.

### Revision History

v0.25.0 2003-05-21 JCS Initial Release v0.50.0 2003-08-18 JCS Added tvtime section and updated FAQ v0.50.1 2003-08-18 JCS Update TV Guide Time Format section and moved to a three point version number

### Obtaining This Document

You can obtain the latest release of this document in SGML, PDF, HTML, and as a TAR archive from http://zebulon.miester.org/~jstump/doc/freevo.

## Prerequisites

### General

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.

If you are new to Linux or you have never recompiled your kernel you might want to check out The Linux Kernel HOWTO and the linux.org documentation section.

### Hardware

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.

#### CPU / Motherboard

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.

#### Video Card

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.

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.

#### TV Tuner Card

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.

#### Motherboard

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.

#### CD/DVD/CDRW Drives

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.

### Software

#### 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.

##### 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.

##### 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

##### 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.

#### 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

#### 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.

##### 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.

##### 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.

#### 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.

## Installing / Configuring Freevo

### Installing Freevo

It wouldn't be a PVR / Media box without Freevo! I downloaded the binary distribution from the official Freevo website, which should include everything you need to start up Freevo. Once you have untar'd Freevo do the following:

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

That's pretty much it. After you have done the above you will need to start configuring Freevo's config files.

### Configuring Freevo

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.

#### freevo.conf

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.

    chanlist = us-cable
    display = mga
    geometry = 768x576
    jpegtran = ./runtime/apps/jpegtran
    mplayer = /usr/local/bin/mplayer
    tv = ntsc
    version = 1.0

#### freevo_config.py

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.

##### Channel List

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:

    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'),
                   ...

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.

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.

#### local_config.py

See freevo_config.py for more information.

## DVD Playback

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.

### Enabling DMA for DVD Playback

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.

          [user@host]$ hdparm -d 1 /dev/hdX

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.

### Increasing MPlayer Cache

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:

    MPLAYER_ARGS_DVD     = '-cache 8192 -dvd %s'

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.

## Skin Files

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.

### Introduction

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.

### Changing the Default Skin

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'.

            # Change the default skin to Grey (skins/xml/type1/grey1.fxd)
            SKIN_XML_FILE = 'grey1'

### Modifying Screen Layout

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).

          [user@host]$ cd ./skins/xml/type1
          [user@host]$ cp blue_round1.fxd myskin.fxd

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.

### Changing Icons

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 http://halfempty.com/bright/pics/freevo, which look great.

## Misc.

### Changing TV Guide Time Format

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'.

You will want to check out Python's strftime documentation to format it exactly how you want it.

### Downloading TV Logos

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.

          [user@host]$ ./freevo execute helpers/makelogos.py

### Booting into Freevo

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.

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:

          [user@host]$ cd /etc/rc2.d
          [user@host]$ ln ../init.d/freevo S98freevo

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.

### Automating Freevo with Cron

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.

#### XMLTV

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:

    0 0 * * * /path/to/xmltv_script.sh

Make sure to change the path above to the correct path to your XMLTV script. See the XMLTV section for more information.

#### Freevo Recording Daemon

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:

    * * * * * /usr/local/freevo/freevo execute src/tv/record_daemon.py

### Related Documents / Websites

There are a number of websites and documents that are directly related to this one and may be of some use.

- The Freevo Homepage

- The BTTV Mini-HOWTO

- The Matrox Millenium G400 TV/OUT Mini-HOWTO

## Frequently Asked Questions

Does Freevo support DVD menus?

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.

Does Freevo rip/encode CD's?

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.

Why are the audio and video out of sync while watching live TV?

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.

The solution that works for me is outlined in the tvtime section. The tvtime plugin works perfectly for me. It also offers VBI support and other onscreen display goodies.

## Freevo User Manual

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.

### General

#### Navigation

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.

#### Help

To view the on screen help menu hit the "h" key.

### TV Guide

#### Changing Stations

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.

#### Recording Shows

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.

Please note that shows may not be recorded properly unless you have set Freevo up to check for recordings via Cron. See Freevo Recording Daemon for more information.

### DVD Player

#### Fastforward / Rewind

Simple use the right and left arrow keys to fastforward or rewind your DVD.

### Music Player

#### Selecting a Track

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.

## GNU Free Documentation License

Version 1.2, November 2002

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

### PREAMBLE

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.

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.

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.

### APPLICABILITY AND DEFINITIONS

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.

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.

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.

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.

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.

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".

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.

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.

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.

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.

### VERBATIM COPYING

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.

You may also lend copies, under the same conditions stated above, and you may publicly display copies.

### COPYING IN QUANTITY

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.

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.

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.

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.

### MODIFICATIONS

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:

1. 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.

2. 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.

3. State on the Title page the name of the publisher of the Modified Version, as the publisher.

4. Preserve all the copyright notices of the Document.

5. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.

6. 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 Addendum below.

7. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.

8. Include an unaltered copy of this License.

9. 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.

10. 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.

11. 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.

12. 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.

13. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version.

14. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section.

15. Preserve any Warranty Disclaimers.

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.

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.

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.

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.

### COMBINING DOCUMENTS

You may combine the Document with other documents released under this License, under the terms defined in section 4 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.

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.

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".

### COLLECTIONS OF DOCUMENTS

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.

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.

### AGGREGATION WITH INDEPENDENT WORKS

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.

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.

### TRANSLATION

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.

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.

### TERMINATION

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.

### FUTURE REVISIONS OF THIS LICENSE

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

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.

### ADDENDUM: How to use this License for your documents

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:

> 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".

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

> with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.

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

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.