How to Obtain, Build and Install V4L-DVB Device Drivers
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.
Load and Unload 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 - Compilation
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.
Errata - Loading Modules
After running the "make install" command, 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
All conflicting *.ko.gz files must be removed. The following command line can help you locate these conflicting files in all your installed kernels:
for file in `find /lib/modules -name "*.ko"`; do if -e $file.gz ; then echo "$file.gz should be removed"; fi; done
Usually all conflicting module files resulting of v4l-dvb installation will be located in:
/lib/modules/[your kernel version]/kernel/drivers/media
Once the conflicting *.ko.gz have been moved elsewhere or renamed (to *.ko.gz.disabled for example), use the v4l-dvb reload command (I usually add a depmod for safety in order to rebuild modules dependencies):
make reload depmod -a
Your modules should now be loaded correctly.
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?