How to Obtain, Build and Install V4L-DVB Device Drivers: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
mNo edit summary
 
(Rearrange it in a more logical sequence)
Line 1: Line 1:
First of all, you need quite recent kernel. The v4l-dvb tree is backwards compatable against recent vanilla kernels. Kernel version 2.6.10 or later is required to build the dvb modules, and version 2.6.12 or later is required to build support for hybrid devices. If you configured kernel manually, please note that some capabilites should be enabled like EVDEV. Stock kernel usually have everything required. You also need to install kernel-source package to have kernel headers.


== Check kernel version ==
Then you need to download latest snapshot, or pull tree from hg. V4L and DVB kernel modules are available via Mercurial. To acquire the latest sources, you must first have mercurial installed (which requires python 2.3).Some Linux distributions already include it. If yours doesn't, you can download a [http://www.selenic.com/mercurial/wiki/index.cgi/BinaryPackages binary package] or [http://www.selenic.com/mercurial/wiki/index.cgi/Download retrieve the source].

First of all, you need a quite recent kernel.
The v4l-dvb tree is backwards compatible with recent vanilla kernels.
Kernel version 2.6.10 or later is required to build the dvb modules, and version 2.6.12 or later is required to build support for hybrid devices.
If you configured the kernel manually, please note that some capabilities should be enabled like EVDEV.
Stock kernels usually have everything required.
You also need to install the kernel-source package to have kernel headers.

== Install Mercurial ==

V4L and DVB kernel modules are available via Mercurial.

To acquire the latest sources, you must first have mercurial installed (which requires python 2.3).
Some Linux distributions already include it. In Debian, just do "apt-get install mercurial".

If your distribution doesn't include it, you can download a
[http://www.selenic.com/mercurial/wiki/index.cgi/BinaryPackages binary package] or [http://www.selenic.com/mercurial/wiki/index.cgi/Download retrieve the source].

== Retrieve v4l-dvb sources ==

Now you need to pull the tree from hg.


To retrieve the v4l-dvb source tree:
To retrieve the v4l-dvb source tree:
Line 16: Line 36:
hg clone http://linuxtv.org/hg/dvb-apps
hg clone http://linuxtv.org/hg/dvb-apps


== Build the Modules ==
Ok, consider you've downloaded snapshot and unpacked it and you have kernel headers. Change into the v4l-dvb directory:

Change into the v4l-dvb directory:


cd v4l-dvb
cd v4l-dvb
Line 24: Line 46:
make
make


Then install the modules:
If compilation fails on v4l-dvb/v4l/dvb_net.c with errors (kernel 2.6.17):

error: 'struct net_device' has no member named 'xmit_lock'

Then edit the v4l-dvb/v4l/dvb_net.c file, go to the error lines and replace this text:

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)

by this one:
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)

The compilation should now continue. Then install the modules:


make install
make install
Line 58: Line 68:
The conflicting *.ko.gz files must be removed. For the saa7134 device for example, move videodev.ko.gz, compat_ioctl32.ko.gz, v4l2_common.ko.gz, v4l1_compat.ko.gz, video_buf.ko.gz, ir_kbd_i2c.ko.gz and ir_common.ko.gz in another directory. Then unload their modules with 'rmmod', rebuid dependencies with 'depmod -a' and reinstall them with 'modprobe'. The saa7134 module should now load correctly.
The conflicting *.ko.gz files must be removed. For the saa7134 device for example, move videodev.ko.gz, compat_ioctl32.ko.gz, v4l2_common.ko.gz, v4l1_compat.ko.gz, video_buf.ko.gz, ir_kbd_i2c.ko.gz and ir_common.ko.gz in another directory. Then unload their modules with 'rmmod', rebuid dependencies with 'depmod -a' and reinstall them with 'modprobe'. The saa7134 module should now load correctly.


== Test the modules ==
At this point, check to see if your device is working. Usually, the make install will install the modules in the kernel module folder, which will autoload the drivers on boot. I ran the below commands and it locked up my box and caused problems. For example, do...

<pre>dmesg | grep -i saa
[ 33.089365] saa7133[0]: subsystem: 17de:7350, board: Kworld ATSC110 [card=90,autodetected]
</pre>

If this comes back with your card name to something other than "UNKNOWN", then you on on the right track and do not have to do what is listed below.



To remove (rmmod) all modules at once from the running kernel (in memory):
To remove (rmmod) all modules at once from the running kernel (in memory):
Line 80: Line 83:


Usually correctly installed modules will show some info in dmesg, errors will appear in dmesg also.
Usually correctly installed modules will show some info in dmesg, errors will appear in dmesg also.


== Errata ==

If compilation fails on v4l-dvb/v4l/dvb_net.c with errors (kernel 2.6.17):

error: 'struct net_device' has no member named 'xmit_lock'

Then edit the v4l-dvb/v4l/dvb_net.c file, go to the error lines and replace this text:

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)

by this one:
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)

The compilation should now continue.

At this point, check to see if your device is working. Usually, the make install will install the modules in the kernel module folder, which will autoload the drivers on boot. I ran the below commands and it locked up my box and caused problems. For example, do...

<pre>dmesg | grep -i saa
[ 33.089365] saa7133[0]: subsystem: 17de:7350, board: Kworld ATSC110 [card=90,autodetected]
</pre>

If this comes back with your card name to something other than "UNKNOWN", then you on on the right track and do not have to do what is listed below.

== More Errata ==


Comment April 06
Comment April 06

Revision as of 10:21, 10 May 2007

Check kernel version

First of all, you need a quite recent kernel. The v4l-dvb tree is backwards compatible with recent vanilla kernels. Kernel version 2.6.10 or later is required to build the dvb modules, and version 2.6.12 or later is required to build support for hybrid devices. If you configured the kernel manually, please note that some capabilities should be enabled like EVDEV. Stock kernels usually have everything required. You also need to install the kernel-source package to have kernel headers.

Install Mercurial

V4L and DVB kernel modules are available via Mercurial.

To acquire the latest sources, you must first have mercurial installed (which requires python 2.3). Some Linux distributions already include it. In Debian, just do "apt-get install mercurial".

If your distribution doesn't include it, you can download a binary package or retrieve the source.

Retrieve v4l-dvb sources

Now you need to pull the tree from hg.

To retrieve the v4l-dvb source tree:

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

To update the sources later on:

cd v4l-dvb
hg pull -u http://linuxtv.org/hg/v4l-dvb

To retrieve the dvb-apps source tree:

hg clone http://linuxtv.org/hg/dvb-apps

Build the Modules

Change into the v4l-dvb directory:

cd v4l-dvb

Build the modules:

make

Then install the modules:

make install

The command above will copy *.ko module files into your /lib/modules kernel directories. However, you might end up with *.ko files and their older compressed version *.ko.gz in the same directory. In this case, the modprobe command might fail (example with the saa7134 module):

sudo modprobe saa7134
FATAL: Error inserting saa7134 (/lib/modules/2.6.17-8mdv/kernel/drivers/media/video/saa7134/saa7134.ko):\ 
Unknown symbol in module, or unknown parameter (see dmesg)

The dmesg then returns a list of 'unknown symbol' error messages because of compatiblity issues between the new *.ko module files and the old *.ko.gz ones:

Unknown symbol ir_codes_pinnacle_color
Unknown symbol ir_codes_encore_enltv
Unknown symbol ir_codes_proteus_2309
Unknown symbol ir_rc5_timer_keyup
Unknown symbol ir_codes_asus_pc39
Unknown symbol ir_rc5_timer_end
Unknown symbol ir_codes_pinnacle_grey

The conflicting *.ko.gz files must be removed. For the saa7134 device for example, move videodev.ko.gz, compat_ioctl32.ko.gz, v4l2_common.ko.gz, v4l1_compat.ko.gz, video_buf.ko.gz, ir_kbd_i2c.ko.gz and ir_common.ko.gz in another directory. Then unload their modules with 'rmmod', rebuid dependencies with 'depmod -a' and reinstall them with 'modprobe'. The saa7134 module should now load correctly.

Test the modules

To remove (rmmod) all modules at once from the running kernel (in memory):

make unload

To insert (insmod) all modules at once into the running kernel, without the need to install them:

make load

To perform the two commands above in a single step:

make reload

Usually correctly installed modules will show some info in dmesg, errors will appear in dmesg also.


Errata

If compilation fails on v4l-dvb/v4l/dvb_net.c with errors (kernel 2.6.17):

error: 'struct net_device' has no member named 'xmit_lock'

Then edit the v4l-dvb/v4l/dvb_net.c file, go to the error lines and replace this text:

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)

by this one:

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)

The compilation should now continue.

At this point, check to see if your device is working. Usually, the make install will install the modules in the kernel module folder, which will autoload the drivers on boot. I ran the below commands and it locked up my box and caused problems. For example, do...

dmesg | grep -i saa
[   33.089365] saa7133[0]: subsystem: 17de:7350, board: Kworld ATSC110 [card=90,autodetected]

If this comes back with your card name to something other than "UNKNOWN", then you on on the right track and do not have to do what is listed below.

More Errata

Comment April 06 A kernel 2.6.12 wouldn't build the modules but 2.6.16 worked well. I would suggest cd /usr/src/linux before retrieving the mercurial patches - the scripts couldn't find the kernel headers otherwise.

After following the steps above and getting down all needed sources I get the following output does this mean this driver does support 64bit kernels?

root@1[v4l-dvb]# make make -C /usr/local/src/v4l-dvb/v4l make[1]: Entering directory `/usr/local/src/v4l-dvb/v4l' scripts/make_makefile.pl No version yet. Updating/Creating .config File not found: /lib/modules/2.6.15-27-desktop64-smp/build/.config at ./scripts/make_kconfig.pl line 30. make[1]: Leaving directory `/usr/local/src/v4l-dvb/v4l' make[1]: Entering directory `/usr/local/src/v4l-dvb/v4l' Updating/Creating .config File not found: /lib/modules/2.6.15-27-desktop64-smp/build/.config at ./scripts/make_kconfig.pl line 30. make[1]: *** No rule to make target `.myconfig', needed by `config-compat.h'. Stop. make[1]: Leaving directory `/usr/local/src/v4l-dvb/v4l' make: *** [all] Error 2

or do I move my sources?