Day: September 18, 2009

Watching digital TV (SBTVD) in the Linux

Today I got Digital TV working on Linux, thanks to Mauro Chehab.

I used a PixelView PlayTV USB SBTVD (ISDB-T Full Seg):
http://www.pixelview.com.br/play_tv_usb_sbtvd_fullseg.asp

The PixelView uses a DiBcom 8000 chipset. Then the first thing to do is downloading new v4l tree which has support to this chip:

$ hg clone http://linuxtv.org/hg/v4l-dvb
$ cd v4l-dvb
$ make
$ make install

Plug the PixelView PlayTV in the USB, then you should see it:

[100113.248017] usb 1-6: new high speed USB device using ehci_hcd and address 6
[100113.381226] usb 1-6: configuration #1 chosen from 1 choice
[100113.400725] dib0700: loaded with support for 13 different device-types
[100113.400898] dvb-usb: found a ‘Prolink Pixelview SBTVD’ in cold state, will try to load a firmware
[100113.400901] usb 1-6: firmware: requesting dvb-usb-dib0700-1.20.fw
[100113.453468] dvb-usb: downloading firmware from file ‘dvb-usb-dib0700-1.20.fw’
[100113.654896] dib0700: firmware started successfully.
[100114.156511] dvb-usb: found a ‘Prolink Pixelview SBTVD’ in warm state.
[100114.156545] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[100114.156718] DVB: registering new adapter (Prolink Pixelview SBTVD)
[100114.387904] DVB: registering adapter 0 frontend 0 (DiBcom 8000 ISDB-T)…
[100114.602780] DiB0070: successfully identified
[100114.602853] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1a.7/usb1/1-6/input/input6
[100114.608551] dvb-usb: schedule remote query interval to 50 msecs.
[100114.608555] dvb-usb: Prolink Pixelview SBTVD successfully initialized and connected.
[100114.608674] usbcore: registered new interface driver dvb_usb_dib0700

Now we need the “scan” and “gnutv” software to see the channels, they are in dvd-apps branch:

$ hg clone http://linuxtv.org/hg/dvb-apps
$ cd dvb-apps
$ make
$ sudo make install

To scan channels we need to have a frequency file, this is the content of my ch_freq.conf:
# UHF channels 14 to 69
T 473142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 14
T 479142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 15
T 485142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 16
T 491142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 17
T 497142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 18
T 503142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 19
T 509142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 20
T 515142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 21
T 521142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 22
T 527142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 23
T 533142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 24
T 539142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 25
T 545142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 26
T 551142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 27
T 557142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 28
T 563142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 29
T 569142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 30
T 575142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 31
T 581142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 32
T 587142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 33
T 593142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 34
T 599142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 35
T 605142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 36
# channel 37 not used
T 617142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 38
T 623142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 39
T 629142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 40
T 635142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 41
T 641142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 42
T 647142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 43
T 653142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 44
T 659142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 45
T 665142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 46
T 671142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 47
T 677142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 48
T 683142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 49
T 689142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 50
T 695142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 51
T 701142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 52
T 707142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 53
T 713142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 54
T 719142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 55
T 725142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 56
T 731142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 57
T 737142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 58
T 743142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 59
T 749142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 60
T 755142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 61
T 761142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 62
T 767142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 63
T 773142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 64
T 779142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 65
T 785142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 66
T 791142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 67
T 797142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 68
T 803142857 6MHz 3/4 AUTO AUTO AUTO AUTO NONE # channel 69

Note: This is the generic frequency table for Brazil, based on ABNT standard.

Execute scan to detect channels:
$ scan ch_freq.conf > channels.conf

Then the “scan” should create the channels.conf with content like this (for Belo Horizonte/MG):
BAND:509142857:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_3_4:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE:250:255:23040
BAND:509142857:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_3_4:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE:275:280:23064
RedeTV – 1SEG:539142857:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_3_4:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE:768:512:59640
RedeTV – HD:539142857:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_3_4:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE:769:513:59616
Record HD:557142857:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_3_4:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE:273:274:23552
Record 1seg:557142857:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_3_4:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE:641:643:23576
Globo HD:587142857:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_3_4:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE:273:274:23104
Globo 1SEG:587142857:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_3_4:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE:529:530:23129
TV ALTEROSA HD:605142857:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_3_4:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE:513:514:23136
TV ALTEROSA 1SEG:605142857:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_3_4:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE:257:258:23160

Now it time to watch TV, but unhappily the codec used (H.264) to SBTVD is not supported by gnutv until now, then we will save it to file and use VLC player to watch:

$ gnutv -out file band.mpg -channels channels.conf BAND
Using frontend “DiBcom 8000 ISDB-T”, type DVB-T
status SCVYL | signal aff2 | snr 0015 | ber 00000380 | unc 00000015 | FE_HAS_LOCK

Open a new terminal and execute:
$ vlc band.mpg

This is a snapshot:

Other option is using VLC directly to watch TV, just execute:
$ vlc channels.conf

To see all channels go to Playlist -> Show Playlist and double click the channel you want to watch.