Jun 26, 2011

HD DVB on Ubuntu 10.04 (Lucid)

After three years of HD DVB pre-casting, PTS (公視)finally announced the broadcast of Hi Definition DVB channel - HiHD to the center of Taiwan in June 2011 (we still got pre-casting in northern Taiwan tho).  Since HD video is encoded in H.264 and as expected the set-up boxes I'm using do not support this codec.  Buying a new STB with HD capability seems not practical for the time being as HD channels are too few and I've had two STB's already.  Last weekend, bought a NT-500-bucks USB DVB-T tuner from the 3C store nearby, which is an UPMOST DVB190 with a small, cute antenna. The antenna is not required in this case as  I'll use the one from current STB, which has much better reception.  The Ubuntu version used is 10.04 (Lucid), not only it's a long-term-support (LTS) version, but also the rtl2832u driver support and stability of resolution switch between the laptop and TV set is much better than the buggy 11.04 (Natty). A few to-do list items follow:

Driver for UPMOST DVB190

It uses a Realtek rtl2832u chip and the driver found on the net is really picky to kernel version. Compiling it on kernel 2.6.32-32 on Lucid 10.04 is pretty straightforward (see instructions here), on the contrary it's a pain on kernel 2.6.38 on Natty (11.04). I think the rtl2832u driver will be included in the newer kernel in future Ubuntu releases. Compiling the driver is really a crazy thing for end-users.

% dmesg | grep DVB
[ 9.888197] dvb-usb: found a 'DK mini DVBT DONGLE' in warm state.
[ 9.889937] DVB: registering new adapter (DK mini DVBT DONGLE)
[ 9.890441] DVB: registering adapter 0 frontend 0 (Realtek RTL2832 DVB-T)...
[ 9.890508] dvb-usb: DK mini DVBT DONGLE successfully initialized and connected.
[ 9.890530] dvb-usb: found a 'DK mini DVBT DONGLE' in warm state.
[ 9.892786] DVB: registering new adapter (DK mini DVBT DONGLE)
[ 9.893250] DVB: registering adapter 1 frontend 0 (Realtek RTL2832 DVB-T)...
[ 9.893316] dvb-usb: DK mini DVBT DONGLE successfully initialized and connected.


ALSA driver update

Unfortunately HDMI audio output is broken in Ubuntu 10.04 (but it works on 11.04). The workaround loading ALSA module manually in /etc/pulse/default.pa does NOT work for me. The quickest way to fix this is updating the ALSA driver from dev repos, which will update ALSA from version 1.0.21 to 1.0.24.

sudo add-apt-repository ppa:ubuntu-audio-dev/ppa
sudo apt-get update
sudo apt-get install linux-alsa-driver-modules-`uname -r`

Reboot to confirm the ALSA update works:

$ grep Version /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.24.


VLC update

I used to run MPlayer for video playback but it's clumsy playing the DVB HD stream with MPlayer. Also tried me-tv, which can do video recording and EPG stuff, pretty cool. But I got the error *Failed to lock to channel* from time to time and it drives me crazy. VLC is our best alternative for now, but it's kinda outdated in Ubuntu 10.04. Need to update it manually:

sudo add-apt-repository ppa:lucid-bleed/ppa
sudo apt-get update
sudo apt-get install vlc vlc-plugin-pulse mozilla-plugin-vlc


DVB channels list

The DVB channels list is consolidated from the web and I renamed the channel names in the first column from Chinese to English. Save the list to channels.conf as follows:

PTSHD:569000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2001:2002:200
FTVHD:557000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:3041:0:304
CTV:533000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_1_2:FEC_AUTO:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:1001:1002:100
CTVN:533000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_1_2:FEC_AUTO:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:1011:1012:101
CTVE:533000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_1_2:FEC_AUTO:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:1021:1022:102
PTS:545000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2011:2012:201
DIMO:545000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2021:2022:202
HAKKA:545000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2031:2032:203
FTV:557000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:3001:3002:300
FTVT:557000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:3011:3012:301
FTVN:557000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:3021:3022:302
TTV:581000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:4001:4002:400
TTVN:581000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:4011:4012:401
TTVE:581000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:4021:4022:402
CTS:593000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:5011:5012:501
CTS2:593000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:5021:5022:502
CTS3:593000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:5031:5032:503


Finally, run VLC from the command line to watch the DVB programs:

$ vlc channels.conf


Here's a list of key hardware and software used in this case:
  • HDTV - which can do HD 1080p
  • Laptop - ASUS U35J
  • USB DVB-T tuner - UPMOST DVB190 (w/ Realtek rtl2832u chip)
  • Ubuntu 10.04 (Lucid) and 11.04 (Natty) - with latest patch level
  • VLC 1.1.10
  • MPlayer 1.0rc4-4.4.3
Have fun!

Image 1. UPMOST DVB tuner (left) and the HDMI output (right)

 Image 2. FTV HD channel screenshot (1920x1080)

1 comment:

  1. Your grasp of this topic is amazing. It really touched base to me and I am glad I found this material. Thank you very much.
    dvbupload

    ReplyDelete