Freevo

- User Documentation

# Nxtvepg

Update as of March 6, 2005 (okay_awright)

## Overview

If you reside in France, Germany, Belgim, Switzerland or Turkey and if you use an analogic TV card receiver, you may use the EPG airwave transmissions (a protocol similar to Teletext) via nxtvepg instead of the Xmltv internet "grabbers" to retrieve your TV guide. The main advantages of using nxtvepg are speed and convenience. Xmltv grabbers are rather slow and rely on Internet websites to provide the channels listing, some of these websites change their contents quickly and you usually have to wait for an Xmltv program update to be able to get your TV guide back. Nxtvepg does not have such limitations and can produce an XML formatted TV guide fully compatible with Xmltv and Freevo. Finally, no internet connection is required for nxtvepg to work. On the other hand, its obvious disadvantages are limited area coverage and restricted usability to airwave broadcasts.

Once you have successfully configured nxtvepg you are close to a working TV setup for Freevo. Please refer to the configuration section for TV_Channels to complete your setup.

## Installation

### From source

TODO

### From packages

Mandrake: `urpmi nxtvepg`

Gentoo: `emerge nxtvepg`

TODO

## Configuration

NB: You must have X to be able to configure nxtvepg the first time, once properly configured nxtvepg can be used with a pure Freevo framebuffer setup (sadly it still needs to be compiled against X11 libraries and headers: a small design flaw IMveryHO). One solution if you don't want to install a full working X server is to generate a configuration file on another PC and then tweak this one on purpose, by hand. Nxtvepg is both a daemon able to run without a X server backend and a Tcl/Tk GUI that has no use in our situation, apart from the preliminary setup.

Please note that your TV card must properly work before proceeding any further. If you can not correctly receive your regular airwave broadcasts you have to first fix this.

Launch your X server and then nxtvepg (without any switch). In the main menu, select "Configure" and then "Provider scan...". Then choose what suits you best under the "Channel table:" frame, please note that nxtvepg is able to read a working Xawtv channel listing if you already have a customized channels list (tick radio box "Load from TV app."). Press "Start Scan" and wait for nxtvepg to detect which channels do advertize EPG info (your airwave antenna must be correctly plugged in of course). Once done, press "Dismiss" and click on "Select Provider..." sub-menu item to check that the channels previously detected have been taken in consideration. Then head to the sub-menu "Merge Providers..."; here you will be able to choose which database providers you want to use at the same time (FYI, in France, Canal+ stores a full 7 days long TV guide instead of M6 which only stores 3 days). Under the "Acquisition mode..." sub-menu, press the "Help" button and select which mode you prefer accordingly; "Cyclic: Now->Near->All" seems to be a good compromise in most cases. You can now quit the application (and perhaps even terminate your X server). If everything's fine, a working nxtvepg configuration file should have been created.

Nxtvepg has to run in background to retrieve your TV guide. Create a service/initscript that launches nxtvepg daemon at each boot (one example is provided below). Beware that your TV card driver module is loaded before this script. Once nxtvepg daemon is running you can get your channels listing anytime. A first approach is to create a shell script that will create a XML file easily readable under Freevo (don't forget to do a `chmod a+rx` on it):

`vi /usr/local/sbin/nxtvepg2xmltv`

    #!/bin/sh
    /usr/bin/nxtvepg -rcfile /usr/local/share/nxtvepgrc -dump xml -provider merged > /tmp/TV.xml 2 > /dev/null

"-rcfile" is used when you want to enforce the use of special configuration file: more about that below, if you remove this switch nxtvepg will load ~/.nxtvepgrc, "-dump xml" will tell nxtvepg to save a Xmltv compliant TV guide, add "-provider merged" when you've selected more than one EPG provider channel within the GUI. Nxtvepg documentation is your best friend here.

Now you can add a cron job to automatically retrieve your TV guide listing at regular intervals (e.g. every three days from boot):

`su root -c "crontab -e"`

    * * * * */3 /usr/local/sbin/nxtvepg2xmltv

One nice touch is to fill your TV guide as soon as nxtvepg is launched, to do so you have to duplicate your nxtvepg configuration file (during boot, no user is already logged and by default the daemon tries to read the file .nxtvepgrc under the home directory of the user who started the application). For instance, copy the .nxtvepgrc file located under the home directory of the user you used to configure the application to /usr/local/share/nxtvepgrc. Then add a reference to the above script in your initialization script, just after nxtvepg is called.

Here is an example of such initialization script for Gentoo:

`vi /etc/init.d/nxtvepg`

    #!/sbin/runscript

    depend() {
            # il faut être sûr que le module saa7134 est chargé
            need modules
    }

    start() {
            # display to the user what you're doing
            ebegin "Starting nxTVview EPG daemon"
            # Start the process as a daemon
            /usr/bin/nxtvepg -rcfile /usr/local/share/nxtvepgrc -daemon
            THRICE=2
            while test $THRICE -gt 0
            do
                    /usr/local/sbin/nxtvepg2xmltv
                    HEADER=`head -n 1 /tmp/TV.xml | grep "<?xml"`
                    if [ -n "$HEADER" ]; then
                            break
                    fi
                    THRICE=`expr $THRICE - 1`
                    sleep 1
            done
            # output success or failure
            eend $?
    }

    stop() {
            # display a message to the user
            ebegin "Stopping nxTVview EPG daemon"
            # stop the daemon
            #killall nxtvepg
            /usr/bin/nxtvepg -rcfile /usr/local/share/nxtvepgrc -daemonstop
            # output success or failure
            eend $?
    }

`rc-update add nxtvepg default`

Nxtvepg configuration is over.

## Usage

Now synchronize your TV_CHANNELS variable with your freshly produced Xmltv file content, you may follow the XMLTVUsefreevo section if your in need for help on this specific subject.

If you want to get channel logos inside Freevo you can have a look at XMLTVlogos.

last edited 2005-03-19 03:17:31 by okay awright
current version: http://freevo.sourceforge.net/cgi-bin/doc/Nxtvepg