Talk:How to Obtain, Build and Install V4L-DVB Device Drivers

From LinuxTVWiki
Revision as of 22:15, 28 February 2009 by CityK (Talk | contribs)

Jump to: navigation, search
Note: This article originated in the old V4L wiki, wherein it was entitled differently, and since entering into the combined V4L-DVB wiki, its contents have been added to from the merger of relevant information from the former DVB wiki article "How to install DVB device drivers"; for user contribution history, please also refer to the, now archived, former DVB article.

Comment April 23/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.

I get a bunch of conflicts when I tried to do this. I run a custom 2.6 kernel, built from 2.6.18. I don't understand how the V4L tree jibes with the drivers from the kernel source. I suspect that if you are going to install drivers from a V4L tree, you should *not* configure the modules in the kernel tree (which modules should you not configure?).

There seems to be a big gap in the howtos, between those for newbies who have never set up any dvb card for linux, and those intended for developers.

Mrdemeanour 16:46, 17 October 2006 (CEST)

Apr 2007:

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'
No version yet.
Updating/Creating .config
File not found: /lib/modules/2.6.15-27-desktop64-smp/build/.config at ./scripts/ 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/ 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?

First, try this step
cd /var/v4l-dvb (or wherever you put the download)
make distclean
make clean
Another reason for this issue is because your symbolic link for /lib/modules/<kernel-version>/build is broken. Before running make, remove the link and create a new pointing to the right location.
For your example above,
rm /lib/modules/2.6.15-27-desktop64-smp/build
ln -s /usr/src/kernels/2.6.15-27-desktop64-smp/build /lib/modules/2.6.15-27-desktop64-smp/build
and then, the remaining steps should work fine.

Note: On Ubuntu 8.04 (Hardy Heron), installation had the same error as above but was solved somewhat differently. First you must install the linux-headers and the linux kernel source. To do so, type the following (and those are back ticks, not single quotes, people!)

 sudo apt-get install linux-headers-`uname -r` linux-source

You'll notice that the source code is installed as a tar file in the /usr/src directory. This is not particularly useful. Let's untar it, do so by typing:

 sudo tar xjf /usr/src/linux-source-`uname -r`.tar.bz2 -C /usr/src

And then create a symbolic link to the source (if there isn't already one) by typing:

 cd /usr/src
 sudo rm linux
 sudo ln -s /usr/src/linux-source-`uname -r` linux

Finally, let's make sure we have the /lib/modules/`uname -r`/build directory pointing to THE HEADERS... NOT THE KERNEL SOURCE. This is the million dollar hurdle, and it bears repeating. The /lib/modules/<your kernel version>/build should point to the correct linux-headers, not the source code of the kernel. (Yes, weird, I know) Type:

 cd /lib/modules/`uname -r`
 sudo rm build
 sudo ln -s /usr/src/linux-headers-`uname -r` build

Now you can go to your v4l source directory that you downloaded using hg, and do a

 rm v4l/.version

and all should be good with the world. This was a supreme PITA, so I am hopeful that this will save somebody their sanity.

If you are having problems with a module not compiling, and it is not important to you, do a

find . -name my_bad_module_name.c -print

Then go to the directory that contains it. You will find a Makefile. Edit it and put a # at the start of the line that has the module name.

May 2007:

Kernel 2.6.17 Compilation Errors

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:


by this one:


The compilation should now continue.

Jan 2008 comments:

Compilation for Kernels before 2.6.22

On old kernels (2.6.22 and older) there is a set of device drivers which will not compile as they require later kernel for the devices to be supported, and this will result in compilation errors. These can be fixed by disabling the compilation of unneeded (ones that require newer kernel) modules

make allmodconfig

Still it seems that for kernels older than 2.6.20 the compatibility may have been broken. ( If you figure out a way to compile on 2.6.17 put it here.)

Mar 2008 Comments: I need help! I'm getting the issue as stated at the bottom of the page (more errata was it?). I can follow the instructions given but I dont have all of the paths/folders as described and dont know enough to help myself.

I the v4l-dvb package is in my home directory. I get the message saying "file not found: /lib/modules/2.6.22-14-server/build/.config" I dont have a folder called "build" at this path (or anywhere else I can see) so dont expect the symbolic link instructions pasted below to work.

What information can I give so that you can help me? I'm using ubuntu server 7.10.

"If you see the issue above, it is because your symbolic link for /lib/modules/<kernel-version>/build is broken. Before running make, remove the link and create a new pointing to the right location.
For your example above,
rm /lib/modules/2.6.15-27-desktop64-smp/build
ln -s /usr/src/kernels/2.6.15-27-desktop64-smp/build /lib/modules/2.6.15-27-desktop64-smp/build"