Archived:How to install DVB device drivers: Difference between revisions
(→FAQ) |
m (fix links, minor edits) |
||
(46 intermediate revisions by 18 users not shown) | |||
Line 1: | Line 1: | ||
{{Note|This article unceremoniously replaced the original [[Archived:HOW TO Installing DVB|HOW TO Installing DVB]]. In turn, this article has been superseded by the [[How to Obtain, Build and Install V4L-DVB Device Drivers]] article.}} |
|||
This page contains information to help an "end user" to install a DVB device on his or her GNU/Linux system.<br> |
|||
'''NOTE:''' Some of the following steps are specific to Debian-based distributions, but these instructions should also be helpful to users of other distributions. Please have also a look at http://linuxtv.org/repo. |
|||
== Get required software == |
|||
------- |
|||
Before you can start you need the following software: |
|||
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 the hardware device into, or connected it to, your system. (Refer to the manufacturer's instructions for such details)}}. |
|||
==Case 1: Out of the Box Support== |
|||
If your Linux installation is using a recent 2.6 kernel which has been compiled with many driver [[Wikipedia:Loadable_kernel_module|modules]] (as is typical with most [[Wikipedia:Linux_distribution|Linux "distros"]]), then there is a chance that drivers for your device are already included. If that is indeed the case, then upon boot-up, your device should be "automagically" detected and will have the appropriate driver modules loaded into memory. Which modules are required? Well, the answer to that question depends entirely upon the chipsets used by your device -- see the relevant wiki article for your device for a listing of such components and required drivers. If you are aware of which driver modules are required for your device, you can see if they were loaded by running the following command in a terminal: |
|||
: <code>lsmod</code> |
|||
Provided that the drivers were loaded, you should now have a non-empty ''/dev/dvb'' directory. (Note: this directory is created automatically by [[Wikipedia:udev|udev]], so you do not need to create it yourself). You can check on whether this is true for you with the following command: |
|||
: <code>ls -l /dev/dvb/</code> |
|||
(alternatively, you can browse your directory structure with the graphical file manager of your choice). If you have a single DVB device installed in your system, then the output of the above command should reveal that /dev/dvb/ is populated by adapter0. Digging further, |
|||
: <code>ls -l /dev/dvb/adapter0 </code> |
|||
reveals the devices associated with adapter0 for which the drivers have control. If you have more then one DVB device, you can see the same for all with |
|||
: <code>ls -l /dev/dvb/adapter* </code> |
|||
Now, if you don't have a populated /dev/dvb/ directory, then something has failed. There could be several reasons for such. In any regard, consider that: |
|||
* If a module was not loaded but you know you have it configured on your system, you can try manually loading it with the appropriate ''modprobe'' command. |
|||
* If, on the other hand, you have all the modules active (listed in lsmod) but no /dev/dvb/ directories to be found, check dmesg for any errors, ie:<br> |
|||
:: <code>dmesg | grep dvb</code> |
|||
: The problem may be as simple as the [[Firmware|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: |
|||
<pre> 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/</pre> |
|||
: Resolving that missing firmware issue should then result in proper detection and configuration of your device. |
|||
* The kernel used by your distro does not have recent enough drivers to support your device (in which case, see "Case 2" below) |
|||
===Debian Etch=== |
|||
In case you have Debian Etch, you will neither have out-of-the-box support in the kernel, nor will you be able to compile the drivers yourself (The compiling fails with an error like ''/usr/src/v4l-dvb/v4l/videodev.c:499: error: unknown field 'dev_attrs' specified in initializer''). |
|||
The best bet for Debian Etch users is to install a new kernel from [http://www.backports.org backports.org] (Current version 2.6.24). This is most likely to provide with all necessary drivers. To install the backports kernel, you must [http://backports.org/dokuwiki/doku.php?id=instructions use the backports.org repository]. The following code should do, but please be sure to read the instructions anyway: |
|||
<pre>echo "deb http://www.backports.org/debian etch-backports main contrib non-free" >> /etc/apt/sources.list |
|||
apt-get update |
|||
apt-get install debian-backports-keyring |
|||
# the following step makes sure that backports packages get their updates |
|||
echo -e "Package: *\nPin: release a=etch-backports\nPin-Priority: 200" >> /etc/apt/preferences |
|||
</pre> |
|||
Now, to install the kernel, run (just an example, depending on the current kernel in backports, and the appropriate kernel for your machine/setup): |
|||
<pre>apt-get update |
|||
apt-get install linux-headers-2.6.24-1-686 linux-image-2.6.24-1-686</pre> |
|||
Debian should automatically install the initrd in ''/boot'' as well as update ''/boot/grub/menu.lst''; elsewise you must do this yourself. When done, you can reboot. After reboot, you should have all necessary modules at your service. (Don't forget to have copied the firmware to ''/lib/firmware'', if necessary.) |
|||
Successfully tested with a [[TerraTec Cinergy DT USB XS Diversity]]. |
|||
==Case 2: Installation of LinuxTV Drivers Required== |
|||
The LinuxTV project hosts the latest set of drivers for v4l-dvb devices; see http://linuxtv.org/repo |
|||
'''1. Acquire the necessary software'''<BR> |
|||
Before you can start you need the following: |
|||
* mercurial: needed to download the latest source |
* mercurial: needed to download the latest source |
||
* kernel-headers, make, gcc: needed to compile the the driver |
* 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 use the following command to install all required software: |
|||
::: <code>$ [sudo] apt-get install mercurial linux-headers-$(uname -r) build-essential</code> |
|||
:* On Gentoo-based distributions use the following command to install mercurial. Other dependencies are installed in main system tree. |
|||
::: <code>$ [sudo] emerge mercurial</code> |
|||
:* On Fedora it's just as easy: |
|||
::: <code>$ [sudo] yum install mercurial</code> |
|||
:* On Mandriva, provided you setup a [http://easyurpmi.zarb.org/ contrib source], you can use: |
|||
::: <code>$ [sudo] urpmi mercurial</code> |
|||
'''2. Obtain latest v4l-dvb source code from LinuxTV'''<BR> |
|||
On Debian-based distributions you can use the following command to install all required software: |
|||
After installing all required software, download the latest source code with the following command: |
|||
$ [sudo] apt-get install mercurial linux-headers-$(uname -r) build-essential |
|||
Note: [sudo] means that you only have to specify "sudo" if you aren't root, otherwise omit it. |
|||
== Obtain latest source code == |
|||
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 |
$ hg clone http://linuxtv.org/hg/v4l-dvb |
||
This |
This creates a directory called ''v4l-dvb'' in the current working directory. |
||
'''2.1 Upgrading an older installation'''<BR> |
|||
== Compile the source code == |
|||
Update your local copy of the source code with the following command (entered from the previously created ''v4l-dvb'' directory): |
|||
Let's go inside the directory that contains the previously downloaded source: |
|||
$ hg pull |
|||
When job completes, enter the following command: |
|||
$ hg update |
|||
to get a working local copy, ready to compile. |
|||
'''3. Compile the v4l-dvb source code'''<BR> |
|||
Change to the directory that contains the previously downloaded source: |
|||
$ cd v4l-dvb |
$ cd v4l-dvb |
||
Then |
Then compile the source: |
||
$ make |
$ make |
||
If you run into any problems here, |
If you run into any problems here, contact the developers via irc.freenode.net on #linuxtv or on #dvb. |
||
{{Note|The LinuxTV v4l-dvb drivers only work in conjunction with reasonably new kernels. In the past that meant 2.6.12 and greater, but more recently a number of changes have made it extremely difficult, if not impossible, to provide as thorough backwards compatibility. Hence, regrettably, it is currently advised that your system should have at least a 2.6.19 kernel (and preferably more recent) running in order for the v4l-dvb drivers to build correctly without error.}} |
|||
'''4. Install the drivers'''<BR> |
|||
The next step is to install the driver |
The next step is to install the driver by executing: |
||
$ |
$ sudo make install |
||
Then connect the device (if external) and reboot. |
|||
$ [sudo] reboot |
|||
After that start your preferred program for watching DVB (e.g. [[Kaffeine]]). |
|||
'''5. Remove any old modules from memory '''<BR> |
|||
== Obtain the firmware == |
|||
Perhaps the most straightforward thing to do at this point for the newbie is to restart your system. |
|||
Some devices need firmware. To obtain the correct firmware you need to know what card you're using. |
|||
Normally the device name and model are written on the device, on the box or in the manual. |
|||
Look at [[DVB-S_cards|DVB-S devices]] / [[DVB-C_cards|DVB-C devices]] / [[DVB-T_cards|DVB-T devices]] / [[ATSC_cards|ATSC devices]].<br> |
|||
The output of the following tools may be helpful, too. For PCI devices use |
|||
$ lspci -v |
|||
For USB devices use |
|||
$ lsusb -v |
|||
More experienced users might prefer to use "sudo make unload" (which essentially removes 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 the device. |
|||
The firmware (if needed) can be found on one of those links: |
|||
* http://linuxtv.org/downloads/firmware |
|||
* http://thadathil.net:8000/dvb/fw |
|||
* http://thadathil.net:8000/dvb/fw/dvb-usb |
|||
Either way, the end result should be the same. |
|||
You have to download it and copy it into the right directory (used by hotplug). The location of this directory depends on your distribution, but normally it's one of those: |
|||
/lib/firmware |
|||
/usr/lib/hotplug/firmware |
|||
'''6. A note on firmware''' <BR> |
|||
== Further documentation == |
|||
Some devices also require [[Firmware|firmware]] which is uploaded from the host PC to the card in order to operate. |
|||
Further steps can be found here: |
|||
* [[First_steps_with_a_budget_DVB_card|First steps with a budget DVB card]] |
|||
In some cases, when the device is correctly recognized, the associated drivers provide information as to which firmware file is required -- look in the system log or use the command ''dmesg | grep dvb'' (see an example of this in the "[[How to install DVB device drivers#Case_1:_Out_of_the_Box_Support|Out of the Box Support]]" section above). |
|||
== FAQ == |
|||
'''Q: My device was working perfectly, but now it is not recognized anymore. What is the problem?''' |
|||
In other cases, obtaining the correct firmware is not so straightforward a task. The very first thing you need to know is what device you're using; see [[Supported Hardware#Gathering Information About Your Unidentified/Unsupported Device|Gathering Information About Your Unidentified/Unsupported Device]]. Once you have established the device's identity, you can then move on to [[Firmware#Acquiring the Firmware|obtaining the correct firmware]]. In addition, information in wiki articles (eg. such as [[DVB-T USB Devices]]) will cite the appropriate firmware required. If you're still at a loss, a Google search may shed light on what file you need. Note, however, that not all supported devices have easily available firmware (eg. Hauppauge HVR 1100 & 1300). Firmware for such cards could be loaded via temporary installation in a Mirosoft Windows System with the manufacturer-supplied drivers. |
|||
A: It's possible that you're using a different kernel now, so you have to install the driver again and ensure that the firmware is reached by the hotplug system. |
|||
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: |
|||
'''Q: My DVB device is recognized but I'm not able to use it. What can I do?''' |
|||
*/lib/firmware |
|||
*/usr/lib/hotplug/firmware |
|||
== Solution for 2.4.x kernels == |
|||
A: You should check that the /dev/dvb exists and that you have the correct permissions to read and write that directory. |
|||
The Linux DVB drivers will only work with reasonably new 2.6 kernels. Consequently, you should upgrade your system to one which runs a 2.6 kernel |
|||
before attempting to use DVB. You should also investigate installing the "[[Wikipedia:udev|udev]]" package (for kernels >= 2.6.15) which automatically populates the /dev directory when devices are found. |
|||
You might also try some of the [[First steps with a budget DVB card]] to see if other software can cope with it. |
|||
==Further documentation== |
|||
For further please contact developers via irc.freenode.net on #linuxtv (or #dvb) or via mailing list. |
|||
* See [[Testing your DVB device]] for instructions on testing your newly installed device |
Latest revision as of 21:07, 31 May 2009
This page contains information to help an "end user" install DVB device drivers in a GNU/Linux system.
.
Case 1: Out of the Box Support
If your Linux installation is using a recent 2.6 kernel which has been compiled with many driver modules (as is typical with most Linux "distros"), then there is a chance that drivers for your device are already included. If that is indeed the case, then upon boot-up, your device should be "automagically" detected and will have the appropriate driver modules loaded into memory. Which modules are required? Well, the answer to that question depends entirely upon the chipsets used by your device -- see the relevant wiki article for your device for a listing of such components and required drivers. If you are aware of which driver modules are required for your device, you can see if they were loaded by running the following command in a terminal:
lsmod
Provided that the drivers were loaded, you should now have a non-empty /dev/dvb directory. (Note: this directory is created automatically by udev, so you do not need to create it yourself). You can check on whether this is true for you with the following command:
ls -l /dev/dvb/
(alternatively, you can browse your directory structure with the graphical file manager of your choice). If you have a single DVB device installed in your system, then the output of the above command should reveal that /dev/dvb/ is populated by adapter0. Digging further,
ls -l /dev/dvb/adapter0
reveals the devices associated with adapter0 for which the drivers have control. If you have more then one DVB device, you can see the same for all with
ls -l /dev/dvb/adapter*
Now, if you don't have a populated /dev/dvb/ directory, then something has failed. There could be several reasons for such. In any regard, consider that:
- If a module was not loaded but you know you have it configured on your system, you can try manually loading it with the appropriate modprobe command.
- If, on the other hand, 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.
- The kernel used by your distro does not have recent enough drivers to support your device (in which case, see "Case 2" below)
Debian Etch
In case you have Debian Etch, you will neither have out-of-the-box support in the kernel, nor will you be able to compile the drivers yourself (The compiling fails with an error like /usr/src/v4l-dvb/v4l/videodev.c:499: error: unknown field 'dev_attrs' specified in initializer).
The best bet for Debian Etch users is to install a new kernel from backports.org (Current version 2.6.24). This is most likely to provide with all necessary drivers. To install the backports kernel, you must use the backports.org repository. The following code should do, but please be sure to read the instructions anyway:
echo "deb http://www.backports.org/debian etch-backports main contrib non-free" >> /etc/apt/sources.list apt-get update apt-get install debian-backports-keyring # the following step makes sure that backports packages get their updates echo -e "Package: *\nPin: release a=etch-backports\nPin-Priority: 200" >> /etc/apt/preferences
Now, to install the kernel, run (just an example, depending on the current kernel in backports, and the appropriate kernel for your machine/setup):
apt-get update apt-get install linux-headers-2.6.24-1-686 linux-image-2.6.24-1-686
Debian should automatically install the initrd in /boot as well as update /boot/grub/menu.lst; elsewise you must do this yourself. When done, you can reboot. After reboot, you should have all necessary modules at your service. (Don't forget to have copied the firmware to /lib/firmware, if necessary.)
Successfully tested with a TerraTec Cinergy DT USB XS Diversity.
Case 2: Installation of LinuxTV Drivers Required
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 use the following command to install all required software:
$ [sudo] apt-get install mercurial linux-headers-$(uname -r) build-essential
- On Gentoo-based distributions use the following command to install mercurial. Other dependencies are installed in main system tree.
$ [sudo] emerge mercurial
- On Fedora it's just as easy:
$ [sudo] yum install mercurial
- On Mandriva, provided you setup a contrib source, you can use:
$ [sudo] urpmi mercurial
2. Obtain latest v4l-dvb source code from LinuxTV
After installing all required software, download the latest source code with the following command:
$ hg clone http://linuxtv.org/hg/v4l-dvb
This creates a directory called v4l-dvb in the current working directory.
2.1 Upgrading an older installation
Update your local copy of the source code with the following command (entered from the previously created v4l-dvb directory):
$ hg pull
When job completes, enter the following command:
$ hg update
to get a working local copy, ready to compile.
3. Compile the v4l-dvb source code
Change to the directory that contains the previously downloaded source:
$ cd v4l-dvb
Then compile the source:
$ make
If you run into any problems here, 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
5. Remove any old modules from memory
Perhaps the most straightforward thing to do at this point for the newbie is to restart your system.
More experienced users might prefer to use "sudo make unload" (which essentially removes 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 the device.
Either way, the end result should be the same.
6. A note on firmware
Some devices also require firmware which is uploaded from the host PC to the card in order to operate.
In some cases, when the device is correctly recognized, the associated drivers provide information as to which firmware file is required -- look in the system log or use the command dmesg | grep dvb (see an example of this in the "Out of the Box Support" section above).
In other cases, obtaining the correct firmware is not so straightforward a task. The very first thing you need to know is what device you're using; see Gathering Information About Your Unidentified/Unsupported Device. Once you have established the device's identity, you can then move on to obtaining the correct firmware. In addition, information in wiki articles (eg. such as DVB-T USB Devices) will cite the appropriate firmware required. If you're still at a loss, a Google search may shed light on what file you need. Note, however, that not all supported devices have easily available firmware (eg. Hauppauge HVR 1100 & 1300). Firmware for such cards could be loaded via temporary installation in a Mirosoft 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
Solution for 2.4.x kernels
The Linux DVB drivers will only work with reasonably new 2.6 kernels. Consequently, you should upgrade your system to one which runs 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.
Further documentation
- See Testing your DVB device for instructions on testing your newly installed device