Thursday, 10 May 2012

How-to: Freecom DVB-T Resurrected Again Pt1

You may recall the on-off relationship with this handy piece of kit, something I hadn't used for a while; but I recently gave up on my cheapo DVB receiver in the study and pulled the Freecom DVB-T USB receiver out of a box to try to set it up on Ubuntu 12.04.

Things got a lot easier since Ubuntu 11.10 included firmware for a wider range of devices. Now it comes up under Additional Drivers when the device it plugged in. No more messing with firmware!


This is a huge relief since the firmware used to require several PhD's  to install the right version.


Now it comes up in the list right away with the command:

lsusb

robin@Evo-N610c:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 14aa:0221 WideView Technology Inc. WT-220U DVB-T dongle
Bus 002 Device 002: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse

The Ubuntu Software Center includes versions of the essential utilities: dvbsnoop and dvbapps.

Once you install the the dvb-apps package, you are stil left with command-line tools to test and configure the DVB-T receiver, but there are instructions on-line to make this easier.

First off, scan for the channels you can receive. Refer to the (dvb)scan article for the full details of how to perform this step.

Start by creating a hidden folder below your Home where the configurations files will live. Mine is a conventional DVB-T stick, so the folder names will be tzap for convenience.


robin@Evo-N610c:~$ mkdir ~/.tzap

Then scan for channels. You may have both a program scan and dvbscan installed on your system, and only one of them will work.

robin@Evo-N610c:~$ scan /path_to_the_initial_scan_file > ~/.tzap/channels.conf

The scan software comes with a list of satellites (for dvb-s) and terrestrial transmitters (for dvb-t).

robin@Evo-N610c:~$ scan /usr/share/dvb/dvb-t/uk- [pressing ''Tab'', reveals the list]
uk-Aberdare              uk-Chatton               uk-HemelHempstead        uk-CaradonHill           uk-Hastings              uk-Nottingham           
...
uk-SandyHeath           
uk-Carmel                uk-Heathfield            uk-OliversMount          uk-Selkirk        

You need to specify a transmitter name in order to scan for the channels you wish to tune into. Mine is Rowridge, so:
robin@Evo-N610c:~$ scan /usr/share/dvb/dvb-t/uk-Rowridge

By running the scan command, you create a .conf file in that tzap folder. It is essentially a text file, that contains all the channels you can successfully receive. It will take a couple of minutes to run and will produce something like the output below - except much longer!

robin@Evo-N610c:~$ scan /home/robin/Templates/uk-Rowridge > ~/.tzap/channels.conf
scanning /home/robin/Templates/uk-Rowridge
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
initial transponder 489833000 0 3 9 1 0 0 0
initial transponder 530000000 0 2 9 3 0 0 0
initial transponder 545833000 0 2 9 3 0 0 0
initial transponder 562167000 0 3 9 1 0 0 0
initial transponder 513833000 0 3 9 1 0 0 0
initial transponder 570167000 0 3 9 1 0 0 0
>>> tune to: 489833000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_16:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
WARNING: >>> tuning failed!!!
>>> tune to: 489833000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_16:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE (tuning failed)
WARNING: >>> tuning failed!!!
>>> tune to: 530000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
0x0000 0x6440: pmt_pid 0x0000 (null) -- 4Music (running)
0x0000 0x6480: pmt_pid 0x0000 (null) -- VIVA (running)
0x0000 0x64c0: pmt_pid 0x0000 (null) -- Yesterday (running)
0x0000 0x6540: pmt_pid 0x0000 (null) -- Ideal World (running)
...
Network Name 'South'
>>> tune to: 545833000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
WARNING: >>> tuning failed!!!
>>> tune to: 545833000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE (tuning failed)
>>> tune to: 498000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
0x1043 0x1043: pmt_pid 0x0000 (null) -- BBC ONE (running)
0x1043 0x10bf: pmt_pid 0x0000 (null) -- BBC TWO (running)
0x1043 0x10c0: pmt_pid 0x0000 (null) -- BBC THREE (running)
0x1043 0x11c0: pmt_pid 0x0000 (null) -- BBC FOUR (running)
0x1043 0x1200: pmt_pid 0x0000 (null) -- CBBC Channel (running)
0x1043 0x1240: pmt_pid 0x0000 (null) -- CBeebies (running)
0x1043 0x1100: pmt_pid 0x0000 (null) -- BBC NEWS (running)
0x1043 0x1280: pmt_pid 0x0000 (null) -- BBC Parliament (running)
0x1043 0x1140: pmt_pid 0x0000 (null) -- BBC Red Button (running)
0x1043 0x1c00: pmt_pid 0x0000 (null) -- 301 (running)
0x1043 0x1a40: pmt_pid 0x0000 (null) -- BBC Radio 1 (running)
0x1043 0x1700: pmt_pid 0x0000 (null) -- BBC R1X (running)
0x1043 0x1a80: pmt_pid 0x0000 (null) -- BBC Radio 2 (running)
0x1043 0x1ac0: pmt_pid 0x0000 (null) -- BBC Radio 3 (running)
0x1043 0x1b00: pmt_pid 0x0000 (null) -- BBC Radio 4 (running)
0x1043 0x1600: pmt_pid 0x0000 (null) -- BBC R5L (running)
0x1043 0x1640: pmt_pid 0x0000 (null) -- BBC R5SX (running)
0x1043 0x1680: pmt_pid 0x0000 (null) -- BBC 6 Music (running)
0x1043 0x16c0: pmt_pid 0x0000 (null) -- BBC Radio 4 Ex (running)
0x1043 0x1740: pmt_pid 0x0000 (null) -- BBC Asian Net. (running)
0x1043 0x1780: pmt_pid 0x0000 (null) -- BBC World Sv. (running)
0x1043 0x1c40: pmt_pid 0x0000 (null) -- 302 (running)
...
Network Name 'South'
dumping lists (116 services)
Done.


It will most likely throw a bunch of errors depending on the state of your hardware, aerial and reception quality.

Having got a list of available channels, you'll want to tune a frequency and program. There's a zap article for details of how to perform this step, but in short, the command-line pattern follows:

robin@Evo-N610c:~$ /usr/bin/tzap  -r -c ~/.tzap/channels.conf "channel name"

where I'm using tzap for terrestrial transmissions.

The  -r option is for setting up the /dev/dvb/adapterX/dvr0 interface to be able to record TV shows from the device. So, for example, I try:

robin@Evo-N610c:~$ /usr/bin/tzap  -r -c ~/.tzap/channels.conf "ITV1"
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
reading channels from file '/home/robin/.tzap/channels.conf'
tuning to 522000000 Hz
video pid 0x0208, audio pid 0x0209
status 1f | signal 4040 | snr ebeb | ber 00000000 | unc 00000000 | FE_HAS_LOCK

Has lock tells me I'm getting that channel data. What I need now is a media player to put it on-screen. Cue Part Two... RC