Getting the DVB dongle to work

I have a Hauppauge WinTV NOVA-T USB DVB dongle. This does DVB-T but not DVB-T2, so it cannot receive HD channels (which use DVB-T2 and MPEG-4). Currently there are few/no DVB-T2 USB devices that work with Linux; I will probably wait until they are more widely available and supported, and until I have a new TV, then upgrade.

The kernel configuration has an explicit option for this device. A firmware file is needed; get it from http://www.linuxtv.org/downloads/firmware/ and put it in /lib/firmware. Attach the device and it will appear in /dev/dvb/.

The next challenge is scanning for channels. Apparently the "scan" program does part of this, but bizarrely it doesn't actually scan; you need an initial list of frequencies. These turn out to be in /usr/share/dvb, but as frequencies have changed a couple of times here during the analogue switch-off you might need to look elsewhere if this doesn't work first time:

# scan /usr/share/dvb/dvb-t/uk-SandyHeath > /etc/channels.conf
<snip>
0x104d 0x104d: pmt_pid 0x0064 BBC -- BBC ONE (running)
0x104d 0x10bf: pmt_pid 0x00c8 BBC -- BBC TWO (running)
0x104d 0x10c0: pmt_pid 0x012c BBC -- BBC THREE (running)
0x104d 0x11c0: pmt_pid 0x0190 BBC -- BBC FOUR (running)
<snip>

Now to tune to a channel and capture some video:

# tzap -o /tmp/vid.mp2 -c /tmp/channels.conf "BBC ONE"

Copy that file to another system and view it with mplayer, and it works! (For some reason it doesn't seem to work saving to NFS, though.)

In the case of channels that don't broadcast continuously, e.g. BBC Three & Four, it seems to find them but saves pid values of 0 in the conf file. I think it's necessary to run it again later and manually merge the results.

This config file can be parsed using a library called libdvbcfg, which returns tuning information in the right format to use with libdvbapi.