Showing posts with label rtl2832u. Show all posts
Showing posts with label rtl2832u. Show all posts

Nov 6, 2012

Realtek RTL2832U DVB-T on Ubuntu 12.10 (Quantal)

Some of you might notice the kernel 3.5.x in Ubuntu 12.10 breaks the driver codes of RTL2832U that works on Ubuntu 12.04.  Tried several alternatives found on the net but all came back in no avail.  Luckily I found the driver for USB ID 1d19:1101 was in kernel 3.7-rc4. With minor code modification, my DVB-T dongle works again!

$ lsusb -v | grep "ID.*DVB"

Bus 002 Device 004: ID 1d19:1102 Dexatek Technology Ltd. DK mini DVB-T Dongle

Where 0x1d19 is the vendor ID, and 0x1102 is the product ID.


 Download and extract the kernel source:

$ wget http://www.kernel.org/pub/linux/kernel/v3.0/testing/linux-3.7-rc4.tar.bz2
$ tar xfj linux-3.7-rc4.tar.bz2

Replace the URL and the filename above if newer version is available by visiting kernel.org.

Change the source code at drivers/media/usb/dvb-usb-v2/rtl28xxu.c with our product ID (0x1102 in this case).

from
{ DVB_USB_DEVICE(USB_VID_DEXATEK, 0x1101,

to
{ DVB_USB_DEVICE(USB_VID_DEXATEK, 0x1102,


To compile the kernel, a kernel configuration file is needed.  Download mine at http://dl.dropbox.com/u/76023930/kernel-3.7.0-rc4.config and save as .config in the top-level folder of the kernel source.

Recompile and install the kernel, then reboot the machine. (The kernel compilation takes like 80 minutes on my i5 2.3GHz CPU.)

$ make
$ sudo make modules_install
$ sudo make install
$ sudo reboot


dmesg output:

$ dmesg|grep DVB
[    6.310132] usb 2-1.1: Product: Rtl2832UDVB
[   31.747812] usb 2-1.1: dvb_usb_v2: found a 'Dexatek DK DVB-T Dongle' in warm state
[   31.795283] DVB: registering new adapter (Dexatek DK DVB-T Dongle)
[   32.321089] usb 2-1.1: DVB: registering adapter 0 frontend 0 (Realtek RTL2832 (DVB-T))...
[   32.630126] input: Dexatek DK DVB-T Dongle as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/rc/rc0/input7
[   32.630182] rc0: Dexatek DK DVB-T Dongle as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/rc/rc0
[   32.641710] usb 2-1.1: dvb_usb_v2: 'Dexatek DK DVB-T Dongle' successfully initialized and connected



$ uname -a
Linux buffalo 3.7.0-rc4 #2 SMP Mon Nov 5 23:03:56 CST 2012 i686 i686 i686 GNU/Linux



Watching HDTV on Ubuntu 12.10

May 20, 2012

Realtek RTL2832U DVB-T on Ubuntu 12.04 (Precise) and Linux Mint 13 (Maya)

Ubuntu (Desktop) 12.04 (codenamed Precise Pangolin) was released earlier this May, which has 5-years Long Term Support (LTS) from Canonical.  Let's check it out how my DVB-T USB stick works on Linux kernel 3.2.  Unfortunately, Realtek RTL2832U driver did not make it in the kernel main stream, and the instructions mentioned in the post "HD DVB on Ubuntu 10.04 (Lucid)" posted a year ago did not work for me either.  Luckily, I followed the instructions at https://github.com/ambrosa/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0 ,and everything goes well.  Here's the recap:

Install required packages:

$ sudo apt-get install build-essential git

Check out a copy of the driver source code patched by ambrosa:

$ git clone https://github.com/ambrosa/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0

Makefile configuration and driver compilation/installation:

$ cd DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/
$ vi Makefile (to make sure variable INCLUDE_EXTRA_DVB matches your kernel version)
$ make clean
$ make
$ sudo make install
$ sudo modprobe dvb_usb_rtl2832u

dmesg shown after module insertion:

[  927.960738] IR NEC protocol handler initialized
[  927.963676] dvb-usb: found a 'DK DONGLE' in warm state.
[  927.963680] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[  927.965156] IR RC5(x) protocol handler initialized
[  927.965302] DVB: registering new adapter (DK DONGLE)
[  927.966515] IR RC6 protocol handler initialized
[  927.968948] IR JVC protocol handler initialized
[  927.971631] IR Sony protocol handler initialized
[  927.972945] IR MCE Keyboard/mouse protocol handler initialized
[  927.974271] lirc_dev: IR Remote Control driver registered, major 250
[  927.974493] IR LIRC bridge handler initialized
[  927.980540] RTL2832U usb_init_bulk_setting : USB2.0 HIGH SPEED (480Mb/s)
[  928.116808] RTL2832U check_tuner_type : FC2580 tuner on board...
[  928.709405] DVB: registering adapter 0 frontend 0 (Realtek DVB-T RTL2832)...
[  928.709781] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/input/input12
[  928.709916] dvb-usb: schedule remote query interval to 287 msecs.
[  928.709924] dvb-usb: DK DONGLE successfully initialized and connected.
[  928.709997] usbcore: registered new interface driver dvb_usb_rtl2832u


Double confirm with lsmod listing:

$ lsmod | grep rtl28
dvb_usb_rtl2832u      345365  0
dvb_usb                23826  1 dvb_usb_rtl2832u

The VLC player and the ALSA sound driver were in good shape, thus no extra update was required.

HDTV playback

Additional information:

$ lsusb | grep DVB
Bus 002 Device 003: ID 1d19:1102 Dexatek Technology Ltd. DK mini DVB-T Dongle

$ uname -a
Linux cheetah 3.2.0-24-generic-pae #37-Ubuntu SMP Wed Apr 25 10:47:59 UTC 2012 i686 i686 i386 GNU/Linux

$ vlc --version
VLC media player 2.0.1 Twoflower (revision 2.0.1-0-gf432547)
VLC version 2.0.1 Twoflower (2.0.1-0-gf432547)

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


[Updated May 26, 2012]

Linux Mint 13 (Maya), which was based on Ubuntu 12.04, was released few days ago.  The steps mentioned above work as well on Mint.  Have fun!

HDTV playback on Linux Mint 13

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)