Greg
Setting up tv_grab_au_reg on FreeBSD
Greg's home page
Greg's diary
Greg's photos
Greg's links
Google
Status: Mainly complete. I think that the information in this page is correct, but I will review it again later. If you have any comments, please contact me

This is part of a series of documents about how to set up TV reception on FreeBSD. In most countries, you can get programme guide data with xmltv, available in FreeBSD as /usr/ports/textproc/p5-xmltv, but that doesn't support Australian TV guide data. For that you need the port /usr/ports/multimedia/tv_grab_au. This page is a version of the instructions by William Uther, adapted to FreeBSD.

Use with MythTV

  1. Choose your programme guide supplier (tvguide.org.au or IceTV.com.au) and register with them.
  2. Install the multimedia/mythtv and multimedia/tv_grab_au ports.
  3. Run mythtv-setup and configure an input source to use tv_grab_au.
  4. When you save the input source setting, mythtv-setup runs
            tv_grab_au --configure --config-file ~mythtv/.mythtv/<InputSourceName>.xmltv
    
    and creates a default config file for you. <InputSourceName> is the name you selected in the previous step. In the following examples I use the name that I have chosen in my setup, Antenna.
  5. Set the TimeOffset option in mythtv-setup to Auto. The programme guide data has times in UTC, so None will offset your times by the distance between your time zone and UTC.
  6. Finish mythtv-setup and exit.
  7. Edit ~/.mythtv/Antenna.xmltv, which consists mainly of comments. The first two lines contain dummy addresses for the two potential sources of guide data. You must at least change them to specify your registered user name and password. If you're only using one of them, delete the other entry. The following example is in unified context diff format. If you're not familiar with it, just remove the lines which start with a single - and insert the lines which start with a single + and are in bold type:
    --- .mythtv/Antenna.xmltv~   Sat Mar  3 10:54:25 2007
    +++ .mythtv/Antenna.xmltv   Sat Mar  3 11:02:52 2007
    @@ -11,8 +11,7 @@
            information for those data services with which you have registered.
     -->
    
    -<login provider="icetv" user="MyIceTVUserName" password="myIcePassword" filter="false"/>
    -<login provider="tvguide" user="MyCamelCaseName" password="myTvguidePassword" filter="false"/>
    +<login provider="tvguide" user="UpandDown" password="GoodOne" filter="false"/>
    
     <!--
            There are two ways that the script can now be used.  If the attribute 'filter'
    @@ -92,6 +91,13 @@
            attribute works very much like an offset in that case.
    
     -->
    +       <channel display="31-Adl" tvguide="31-Adl"/>
    +       <channel display="ABC-SA" tvguide="ABC-SA"/>
    +       <channel display="ABC2" tvguide="ABC2"/>
    +       <channel display="Nine-SA" tvguide="Nine-SA"/>
    +       <channel display="SBS-SA" tvguide="SBS-SA"/>
    +       <channel display="Seven-SA" tvguide="Seven-SA"/>
    +       <channel display="Ten-SA" tvguide="Ten-SA"/>
    
    The names of the channels are what chose from your guide data provider. These ones are correct for South Australian listings from tvguide.org.au. The comments tell you that the list of channels at the end is optional, but it isn't for MythTV. If you don't enter this list, MythTV won't understand any of the data.

  8. Make a backup copy of your configuration file. mythtv-setup will happily overwrite it without warning under some circumstances
  9. Start mythbackend.
  10. Run mythfilldatabase, which takes some time and produces a lot of output, some of which might be difficult-to-recognize error messages. Here are some typical error messages highlighted in red. They don't stop mythfilldatabase from continuing:
    2007-03-03 11:09:19.595 New DB connection, total: 3
    2007-03-03 11:09:19.597 Connected to database 'mythconverg' at host: localhost
    Aborting: Config file does not exist:  /home/grog/.mythtv/Antenna.xmltv
    Do you need to run with --config-file or --configure?
    2007-03-03 11:09:19.970 ------------------ End of XMLTV output ------------------
    Error in 1:1: unexpected end of file
    2007-03-03 11:09:19.976 Updating icons for sourceid: 1
    2007-03-03 11:09:19.979 New DB connection, total: 4
    2007-03-03 11:09:19.982 Connected to database 'mythconverg' at host: localhost
    Updated programs: 0  Unchanged programs: 0
    2007-03-03 11:09:20.111 New DB connection, total: 5
    2007-03-03 11:09:20.113 Connected to database 'mythconverg' at host: localhost
    2007-03-03 11:09:20.119 Failed to fetch some program info
    ...
    ===============================================================
    | Attempting to contact the master backend for rescheduling.  |
    | If the master is not running, rescheduling will happen when |
    | the master backend is restarted.                            |
    ===============================================================
    2007-03-03 11:09:24.793 Connecting to backend server: 192.109.197.177:6543 (try 1 of 5)
    2007-03-03 11:09:24.799 Using protocol version 30
    2007-03-03 11:09:24.855 mythfilldatabase run complete.
    

    In other words, don't assume by the messages at the end that the run has been successful. In this case, the run was a complete failure, caused by not setting up the configuration file (only the default file, ~/.xmltv/tv_grab_au_reg, was present).

  11. Follow the MythTV instructions to ensure that mythfilldatabase is run at regular intervals, typically about once a day.

Channel information

One of the items of information in the TV guide is the list of channels and their numbers and frequencies. At least in Adelaide, this doesn't appear to work correctly. Check the database after first setup:
$ mysql mythconverg
Welcome to the MySQL monitor.  Commands end with ; or \g.
...
mysql> SELECT chanid, channum, freqid, callsign, name FROM channel;

+--------+---------+--------+----------+----------+
| chanid | channum | freqid | callsign | name     |
+--------+---------+--------+----------+----------+
|   1006 | 31      | 548250 | 31-AD    | 31-Adl   |
|   1001 | 2       | 64250  | ABC-S    | ABC-SA   |
|   1007 |         | NULL   | ABC2     | ABC2     |
|   1003 | 9       | 196250 | NINE-    | Nine-SA  |
|   1005 | 28      | 527250 | SBS-S    | SBS-SA   |
|   1002 | 7       | 182250 | SEVEN    | Seven-SA |
|   1004 | 10      | 209250 | TEN-S    | Ten-SA   |
+--------+---------+--------+----------+----------+
7 rows in set (0.26 sec)
This is the information you want to see, and if you have it, you're done. Note that the guide data includes ABC2, which is a digital-only channel, so it doesn't have a channel number here.

You might, however, see something like this (this example is after running a different version of tv_grab_au):

+--------+---------+--------+-------------------+-------------------+
| chanid | channum | freqid |      callsign     |       name        |
+--------+---------+--------+-------------------+-------------------+
|   1001 |         | NULL   | ABCSA             | ABC SA            |
|   1003 |         | NULL   | CHASE             | Channel Seven     |

In this case, you need to update the table. You can do this in one of two ways:

  1. If you're in the Adelaide area, load this channel information:
    $ mysql mythconverg
    mysql> drop table channel;
    mysql> source adelaide-channel.sql
    
  2. If you're not in Adelaide, or you don't want to use this data, run mythtv-setup and do a complete “scan” of the channels. This will add about another 70 channels, and mysql will show data like:
    +--------+---------+--------+-------------------+-------------------+
    | chanid | channum | freqid |      callsign     |       name        |
    +--------+---------+--------+-------------------+-------------------+
    |   1001 |         | NULL   | ABCSA             | ABC SA            |
    |   1003 |         | NULL   | CHASE             | Channel Seven     |
    |   1007 | 2       | 64250  | Adding Channel 2  | Adding Channel 2  |
    |   1013 | 7       | 182250 | Adding Channel 7  | Adding Channel 7  |
    

    Use this data to update the tables. Here we update the data for ABC SA, channel 2:

    mysql> UPDATE channel SET channum = 2, freqid = 64250 WHERE chanid = 1001;
    mysql> SELECT chanid, channum, freqid, callsign, name FROM channel;
    +--------+---------+--------+----------+--------+
    | chanid | channum | freqid | callsign | name   |
    +--------+---------+--------+----------+--------+
    |   1001 | 2       | 64250  | ABC-S    | ABC-SA |
    +--------+---------+--------+----------+--------+
    

    When you've done with them, you can delete the scanned channels:

    mysql> DELETE FROM channel WHERE name LIKE "Adding %";
    

If you run into this problem and find this information useful, please contact me and let me know the details and how you solved the problem.

Standalone use


Greg's home page Greg's diary Greg's photos
Valid XHTML 1.0! $Id: tv_grab_au_reg.html,v 1.2 2007/03/04 14:31:52 root Exp $