Archived:How to install DVB device drivers: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
(→‎The LinuxTV drivers: reworked distro examples)
(→‎The LinuxTV drivers: Added note on disabling in-built kernel v4l support prior to installing from mercurial)
Line 65: Line 65:
The next step is to install the driver by executing:
The next step is to install the driver by executing:
$ sudo make install
$ sudo make install

{{Note|If your kernel has built-in support for v4l (2.6) but you wish to install the latest v4l-dvb sources from mercurial, then ensure that the kernel's support for v4l is disabled prior to installing the mercurial v4l-dvb modules. Failure to do so will result on conflicts and various error/warning messages in 'dmesg' output.
Disable the following options within the kernel menuconfig:
Linux Kernel Configuration: 2.6 kernel
Device Drivers --->
Multimedia Devices --->
< > Video For Linux
Digital Video Broadcasting Devices --->
[ ] DVB For Linux
< > DABUSB Driver
}}



'''5. Remove any old modules from memory '''<BR>
'''5. Remove any old modules from memory '''<BR>

Revision as of 21:51, 31 December 2007

This page contains information to help an "end user" install DVB device drivers in a GNU/Linux system.

Note: This article assumes you have already physically installed or connected the hardware device into your system. (Refer to the manufacturer's instructions for details).

Solution for new kernels (2.6)

If you have a new Linux kernel and it's compiled with many modules installed (as normal Linux distros ship it), then chances are good that a driver for your device has been included. In that case, upon boot-up of Linux, your device should be detected and the driver modules loaded. Use

 lsmod

to see if the required modules are installed with your kernel. Which are the required ones? That depends on the chipsets used by your device (See TwinhanDTV Digital Terrestrial TV Card Ter as an example).

If the drivers were loaded automagically, you should now have a non-empty directory

 ls -l /dev/dvb/adapter*

If you don't see such a directory, then something has failed. (Note: this directory is created automatically by udev, so you do not need to create it yourself).

If a module was not loaded but you know you have it configured on your system, you can load it with the appropriate

 modprobe

If you have all the modules active (listed in lsmod) but no /dev/dvb/ directories to be found, check dmesg for any errors, ie:

dmesg | grep dvb  

The problem may be as simple as the firmware for the device not being loaded. For example, for many TechnoTrend & Hauppauge (and other similar "premium" cards), if the dvb-ttpci firmware is not available you will observe an error such as:

dvb-ttpci: could not load firmware, file not found: dvb-ttpci-01.fw
dvb-ttpci: usually this should be in /usr/lib/hotplug/firmware or /lib/firmware
dvb-ttpci: and can be downloaded from http://www.linuxtv.org/download/dvb/firmware/

Resolving that missing firmware issue should then result in proper detection and configuration of your device.

Solution for old kernels (2.4.x)

The linux DVB drivers work on only reasonably new kernels (>= 2.6.12) and so you should upgrade your kernel to a 2.6 kernel before attempting to use DVB. You should also investigate installing the "udev" package (for kernels >= 2.6.15) which automatically populates the /dev directory when devices are found.

The LinuxTV drivers

The LinuxTV project hosts the latest set of drivers for v4l-dvb devices.

See http://linuxtv.org/repo

1. Acquire the necessary software
Before you can start you need the following:

  • mercurial: needed to download the latest source
  • kernel-headers, make, gcc: needed to compile the the driver

The following provides examples of how to install the Mercurial software package for some distributions (Note that [sudo] means that you only have to specify "sudo" if you aren't root, otherwise omit it.):

  • On Debian-based distributions you can use the following command to install all required software:
$ [sudo] apt-get install mercurial linux-headers-$(uname -r) build-essential
  • On Gentoo-based distributions you can use the following command to install mercurial. Other dependancies are installed in main system tree.
$ [sudo] emerge mercurial
  • On Fedora is just as easy:
$ [sudo] yum install mercurial
$ [sudo] urpmi mercurial

2. Obtain latest v4l-dvb source code from LinuxTV
After we have installed all required software you should be able to download the latest source code with the following command:

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

This should create a directory called v4l-dvb in the current working directory.

3. Compile the v4l-dvb source code
Let's go inside the directory that contains the previously downloaded source:

 $ cd v4l-dvb

Then compile the source:

 $ make

If you run into any problems here, you should contact the developers via irc.freenode.net on #linuxtv or on #dvb.

4. Install the drivers
The next step is to install the driver by executing:

 $ sudo make install
Note: If your kernel has built-in support for v4l (2.6) but you wish to install the latest v4l-dvb sources from mercurial, then ensure that the kernel's support for v4l is disabled prior to installing the mercurial v4l-dvb modules. Failure to do so will result on conflicts and various error/warning messages in 'dmesg' output.

Disable the following options within the kernel menuconfig:

Linux Kernel Configuration: 2.6 kernel
Device Drivers --->
     Multimedia Devices --->
          < > Video For Linux
              Digital Video Broadcasting Devices --->
                  [ ] DVB For Linux
          < > DABUSB Driver


5. Remove any old modules from memory
Perhaps the most straight forward thing to do at this point for the newbie would be just to restart your system.

More experienced users might appreciate using "sudo make unload" (which essentially will remove all modules (rmmod) for the device that might be currently loaded in memory from the running kernel) and then "modprobe" the appropriate driver modules for your device.

Either way, the end result should be the same.

6. A note on firmware
Some devices also require a firmware (which is uploaded from the host PC to the card) in order operate.

In some cases, when the device is correctly recognized, the associated drivers will provide information as to which firmware file is required -- have a look in your system log or use the command dmesg | grep dvb (see an example of this in the Solution for new kernels (2.6) section above).

In other cases, obtaining the correct firmware is not so straight forward of a task. The very first thing you will need to know is what device you're using. Normally the device name and model are written somewhere on either the device itself, its box/packaging or, at the very least, listed in its manual. That may seem obvious enough, but a surprising number of devices are available with no or next to little in the way of model identification. In those latter cases, the output of the following tools may be able to aide you in making a determination. For PCI or PCIe devices, use

 $ lspci -v

For USB devices, use

 $ lsusb -v

Once you have sorted out the device's identity, you can then move on to obtaining the correct firmware.

Most firmware can be found at:

In addition, information in wiki articles (eg. such as DVB-T USB Devices) will cite the appropriate firmware required. If your still at a lost, its likely a Google search will shed light on what file you need. Note, however, that not all supported devices have a firmware that is easily available (eg. Hauppauge HVR 1100 & 1300). Firmware for such cards could be loaded via temporary installation in an MS Windows System with the Manufacturer supplied drivers.

In any regard, once you find and obtain the necessary firmware for your device, copy it into the appropriate hotplug directory. The location of this directory depends on your distribution, but normally it's one of these:

  • /lib/firmware
  • /usr/lib/hotplug/firmware

Further documentation