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

32 comments:

  1. Thank you very much, I've found your article via a search and managed to install the driver under Mint 13. I also get the dmesg and lsmod feedback you did.

    However, I can't get VLC to run with it. I've read something about a channels.conf which I got for my region and opened in VLC, but nothing happens. Clicking on Media->Open Capture Device I can select "TV (Digital)" which comes by default with "/dev/dvb/adapter0" selected. It doesn't work. Could you please explain more how to get the device running?
    Thank you!
    Best,
    Lars

    ReplyDelete
    Replies
    1. i'm not sure if there's something wrong with your channel.conf. VLC uses the channel in the 1st line of channel.conf by default, and press "N" or "P" to switch the channel to next or previous one, but sometimes it does not work for me. Maybe you could try different channel in your 1st line of channel.conf. BTW, what's the output of running "vlc channel.conf" ?

      Delete
  2. sweet worked first time

    pablo

    ReplyDelete
  3. You saved many people a lot of time, thank you!

    ReplyDelete
  4. It works also on Sabayon Linux 9 (Gentoo based) with 3.3 kernel. The source for the kernel module taken from
    https://github.com/valtri/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0.git

    Thanks.

    ReplyDelete
  5. Thanks for your summary. Made installing the driver a breeze :-)

    However, I have significant problems getting any any real video content off the USB stick.

    I have what looks like a similar device to yours. I can build the driver and install it no problem, and I can even scan channels with it, finding the expected ones (I'm in Denmark, so MUX1 and MUX2 have several FTA channels).

    However, when I use VLC to tune into one of the channels in an attempt to see the content, it seemingly acquires a lock on the channel and I can see that it finds the different streams in the MUX -- but there is no visible content. I can see that is has found the programs in the stream and I can select another program in the VLC menu, but I never get to see any video.

    When using e.g. tzap to display the signal quality, it looks as if there are many uncorrectable errors (unc).

    This has been tested on two different Linux machines with the same results.

    But the same device and antenna works very well with VLC in Windows on a 3rd machine.

    So I'm wondering if a) there could be problems with the AGC control for the LNA and/or b) if there is a but somehow in the current driver that causes it to NOT send a proper video stream.

    Any ideas or ways of getting more debug info?


    -- Per.

    ReplyDelete
  6. Great advice!

    Please also tell, that you have to have kernel headers.

    ReplyDelete
  7. I use that driver in my Mint 13, it works fine. I use Kaffeine with the DCB card to store the video, and later VLC to watch them. Perfect.

    Hopefully the driver gets ported to kernel 3.5 soon, as that will be the 12.10 Ubuntu. I already managed to get that kernel from some PPA I had configure, but had to withdraw from it, as the DVB does not have support yet.

    ReplyDelete
  8. This comment has been removed by a blog administrator.

    ReplyDelete
  9. Please, could you give some help to a newbee
    At this step
    $ vi Makefile (to make sure variable INCLUDE_EXTRA_DVB matches your kernel version)
    What do I have to do
    I'm on Xubuntu 12.04, I gess I've to choose
    # kernel 3.2.0
    INCLUDE_EXTRA_DVB := include-320
    But is it a file to edit & save
    If yes, how ?

    ReplyDelete
    Replies
    1. Same problem, any solutions?

      Delete
    2. same.. that instruction is very vague.. INCLUDE_EXTRA_DVB := include-320 what do you do? remove the # or copy line and past somewhere?

      Delete
  10. Just so you know, if you're using Ubuntu 12.04 LTS or above, you can now install this kernel module via my PPA at the following address:

    https://launchpad.net/~chrisfu/+archive/rt2832u-dkms

    This is a DKMS kernel module, which means it's recompiled automatically every time you install a new kernel. Yep, I typo'd the PPA name and didn't notice until after I'd published my package. At some point I'll migrate the PPA to a correctly named repo... maybe.

    $ sudo apt-add-repository ppa:chrisfu/rt2832u-dkms
    $ sudo apt-get update
    $ sudo apt-get install rtl2832u-dkms

    The result will be a kernel module that endures all kernel updates.

    Hope some of you find this of use.

    ReplyDelete
    Replies
    1. Thanks for sharing, gotta try it out some time.

      Delete
    2. Doesn't work for me; in first place, a 404 error at updating sources time; if I download manually the .deb, driver doesn't work at all. Ubuntu 12.10. Tell me if I can help.

      Delete
    3. Got same 404 not-found errors as Eddy's on Ubuntu 12.10. :(

      Delete
    4. Hopefully, a solution (I'm compiling just now, but seems to work):
      http://ubuntuforums.org/showthread.php?t=2078342

      Delete
    5. Please see my lastest post at http://linbay.blogspot.com/2012/11/realtek-rtl2832u-dvb-t-on-ubuntu-1210.html for details.

      Delete
  11. Thank you for your help :o)
    I use kaffeine it works great.
    I have ubuntu 12.04 / kernel 3.2.0.31

    ReplyDelete
  12. This instruction not working in ubuntu 12.10 64bit. Any idea? Thank you.

    ReplyDelete
  13. Same problem on 12.10 AMD64. Help would be appreciated!

    ReplyDelete
  14. Hi all,
    I upgrade kernel 3.2.0.31 to new version 3.2.0-32-generic-pae
    and not working but. When I use lsusb system seeing him there USB DVB-T.
    please help

    ReplyDelete
    Replies
    1. Have you recompiled the driver?

      It is working for me with 3.2.0-33-generic, also with r820t tuner with some modifications

      Delete
    2. @8:52 PM, November 01, 2012: could you please be more specific about r820t?
      I have a rtl2832u + r820t usb dongle, and I'm having a very bad time trying to use it as a dvb-t receiver (it works as sdr). Any hint?

      Delete
    3. Use this patched driver(from later official realtek driver) for r820t support

      http://hidemyass.com/files/L7xsZ/

      Delete
  15. This saved my day, thank you!

    ReplyDelete
  16. NO OK in x64...
    Please, help!!!

    ReplyDelete
  17. Hi Hubert, I did exactly as you described for my Terratec Cinergy TStick RC MkII Rev3, did not get any compilation or make error whatsoever. When I modprobe the module, this is what I get in my kernel logging:

    Jan 10 13:22:42 koen-Latitude-D410 kernel: [ 644.705078] IR NEC protocol handler initialized
    Jan 10 13:22:42 koen-Latitude-D410 kernel: [ 644.728749] IR RC5(x) protocol handler initialized
    Jan 10 13:22:42 koen-Latitude-D410 kernel: [ 644.750971] IR RC6 protocol handler initialized
    Jan 10 13:22:42 koen-Latitude-D410 kernel: [ 644.798378] usbcore: registered new interface driver dvb_usb_rtl2832u
    Jan 10 13:22:42 koen-Latitude-D410 kernel: [ 644.799354] IR JVC protocol handler initialized
    Jan 10 13:22:42 koen-Latitude-D410 kernel: [ 644.811127] IR Sony protocol handler initialized
    Jan 10 13:22:42 koen-Latitude-D410 kernel: [ 644.814164] IR MCE Keyboard/mouse protocol handler initialized
    Jan 10 13:22:42 koen-Latitude-D410 kernel: [ 644.817793] lirc_dev: IR Remote Control driver registered, major 251
    Jan 10 13:22:42 koen-Latitude-D410 kernel: [ 644.818941] IR LIRC bridge handler initialized

    I can lsmod and grep for RTL28:
    dvb_usb_rtl2832u 345394 0
    dvb_usb 23856 1 dvb_usb_rtl2832u

    But when I insert the USD-stick into my USB-slot, I only see this in my kernel logging:
    Jan 10 13:23:05 koen-Latitude-D410 kernel: [ 667.804220] usb 1-1: new high-speed USB device number 3 using ehci_hcd

    lsusb gives me this:
    Bus 001 Device 003: ID 0ccd:00d3 TerraTec Electronic GmbH

    Any clue on what's wrong here?

    Running Ubuntu 12.04 LTS. uname -a :
    Linux koen-Latitude-D410 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:45:18 UTC 2012 i686 i686 i386 GNU/Linux

    ReplyDelete
  18. Extra info
    output of dmesg:
    [ 92.089447] IR NEC protocol handler initialized
    [ 92.106866] IR RC5(x) protocol handler initialized
    [ 92.154262] IR RC6 protocol handler initialized
    [ 92.161088] usbcore: registered new interface driver dvb_usb_rtl2832u
    [ 92.173267] IR JVC protocol handler initialized
    [ 92.182001] IR Sony protocol handler initialized
    [ 92.195115] IR MCE Keyboard/mouse protocol handler initialized
    [ 92.205690] lirc_dev: IR Remote Control driver registered, major 251
    [ 92.219282] IR LIRC bridge handler initialized
    [ 106.368190] usb 1-1: new high-speed USB device number 3 using ehci_hcd

    But when I try dvbscan, I get the following error:
    Failed to open frontend

    ReplyDelete
  19. I think I found the problem. Man... this code looks really crappy. Imagine this: a header dvb-usb-ids.h contains the #defines of all VID's (tuner brands) and PID's (tuner types).
    On the other hand there is rtl2832u.h which again contains a similar set of defines (and which also includes this dvb-usb-ids.h file), but with an entirely different naming convention:
    - dvb-usb-ids.h uses the name of the usb-stick in the define name
    (e.g. #define USB_PID_TERRATEC_CINERGY_T_STICK_RC 0x0097)
    - rtl2832u.h uses the PID in the define name
    (e.g. #define USB_PID_TERRATEC_00A9 0x00A9)
    This last file contains a definition of 0x00B3, not of 0x00D3. But the combination 0CCD:00B3 is not a DVB-T tuner but a NOXON DAB tuner.

    The source file defines an array called rtl2832_usb_table, which contains the following USB_DEVICE:
    USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_00B3)}, // 30

    Further in the code this line in the array is used for determining the "name" of the USB-device.
    I changed everything from 00B3 to 00D3. I'm going to compile this and see if it works...

    ReplyDelete
  20. Someone managed to get the IR working? Iam on gentoo.
    lsusb:
    Bus 002 Device 005: ID 1d19:1101 Dexatek Technology Ltd. DK DVB-T Dongle
    dmesg:
    Registered IR keymap rc-empty
    [ 4.566939] input: Dexatek DK DVB-T Dongle as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.2/rc/rc0/input10
    [ 4.567045] rc0: Dexatek DK DVB-T Dongle as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.2/rc/rc0
    [ 4.567052] usb 2-1.2.2: dvb_usb_v2: schedule remote query interval to 400 msecs
    [ 4.578840] usb 2-1.2.2: dvb_usb_v2: 'Dexatek DK DVB-T Dongle' successfully initialized and connected


    ReplyDelete
  21. Great and that i have a swell provide: How Much Is House Renovation Loan In Pag Ibig modern home renovation

    ReplyDelete