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

From LinuxTVWiki
Jump to navigation Jump to search
No edit summary
(update instructions for new v4l-dvb repository)
Line 23: Line 23:
2) Follow your normal procedure for recompiling and installing your kernel if you changed anything with menuconfig in step 1.
2) Follow your normal procedure for recompiling and installing your kernel if you changed anything with menuconfig in step 1.


3a) Check out v4l-kernel CVS files following the instructions at linuxtv.org [Repeated here].
3a) Check out v4l-dvb CVS files following the instructions at linuxtv.org [Repeated here].
cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/video4linux login
cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/video4linux login
cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/video4linux co v4l-kernel
cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/video4linux co v4l-dvb

3b) (optional) If you would like to include latest DVB frontend module support within your build, check out dvb-kernel CVS files following the instructions at linuxtv.org [Repeated here]. If you choose to complete this step, you will also have to complete step 4b as well.
3b) (optional) You can later update your sources by running:
cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login
cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co -P dvb-kernel
3c) (optional) You can later update your sources by running:
cvs -z3 up -dP
cvs -z3 up -dP


4a) Change into the v4l-kernel directory:
4) Change into the v4l-dvb directory:
cd v4l-kernel
cd v4l-dvb
4b) If you followed step 3b above for DVB frontends to be built, then you will need to patch the Makefile and symlink the frontend code using the tree-merging scripts. The scripts do everything you need in order to merge the required frontend code into the v4l tree. It assumes that both cvs trees are located in the same directory level, and that it is being called from within /v4l-kernel:
make merge-trees


5) Compile the modules:
5) Compile the modules:
make
make


6a) As root, after compiling the modules you can make them available to the OS with:
6) As root, after compiling the modules you can make them available to the OS with:
make install
make install
6b) (optional) If, for any reason, the above doesn't work with your setup, there is another option. This will not work in the merge-trees build environment:
make v4l_install


7) Now you can install the driver you need into the OS. Each driver from within CVS has been built.
7) Now you can install the driver you need into the OS. Each driver from within CVS has been built.
Line 52: Line 46:
The -v option is handy for checking where the driver module actually was found. If your startup scripts are configured correctly, these modules can be set up to load automatically on system boot.
The -v option is handy for checking where the driver module actually was found. If your startup scripts are configured correctly, these modules can be set up to load automatically on system boot.


8a) (optional) If you later decide to recompile v4l-kernel against a different kernel, you must wipe out the version info:
8) (optional) If you later decide to recompile v4l-dvb cvs against a different kernel, you must wipe out the version info:
make distclean
make distclean
8b) It should also be noted that both 'make clean' and 'make distclean' will remove the dvb-kernel symlinks that were created by the optional 'make merge-trees' command.

9) One of the most common problem with CVS build is missing dvb headers. Here is example of gcc output:

In file included from /usr/src/cvs/video4linux/cx88.h:33,
from /usr/src/cvs/video4linux/cx88-video.c:37:
/usr/src/cvs/video4linux/media/video-buf-dvb.h:5:20: dvbdev.h: No such file or directory
/usr/src/cvs/video4linux/media/video-buf-dvb.h:6:20: dmxdev.h: No such file or directory
/usr/src/cvs/video4linux/media/video-buf-dvb.h:7:23: dvb_demux.h: No such file or directory
/usr/src/cvs/video4linux/media/video-buf-dvb.h:8:21: dvb_net.h: No such file or directory
/usr/src/cvs/video4linux/media/video-buf-dvb.h:9:26: dvb_frontend.h: No such file or directory
In file included from /usr/src/cvs/video4linux/cx88.h:33,
from /usr/src/cvs/video4linux/cx88-video.c:37:
/usr/src/cvs/video4linux/media/video-buf-dvb.h:28: error: field `demux' has incomplete type
/usr/src/cvs/video4linux/media/video-buf-dvb.h:29: error: field `dmxdev' has incomplete type
/usr/src/cvs/video4linux/media/video-buf-dvb.h:30: error: field `fe_hw' has incomplete type
/usr/src/cvs/video4linux/media/video-buf-dvb.h:31: error: field `fe_mem' has incomplete type
/usr/src/cvs/video4linux/media/video-buf-dvb.h:32: error: field `net' has incomplete type
make[2]: *** [/usr/src/cvs/video4linux/cx88-video.o] Error 1
make[1]: *** [_module_/usr/src/cvs/video4linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.11-1-686'
The problem is in missing files in some kernel sources installation (For example on Fedora or Ubuntu). These files
are present in original kernel sources and are stripped somehow in those distributions. (These header files are located in drivers/media/dvb/dvb-core, not include/linux/dvb) To fix this problem you can download original kernel sources or kernel source packet and manually extract the missing files gcc warns you about. You can place them to directory with other kernel headers or directly into v4l directory.

The best course of action to take, when faced with this problem, is to edit v4l/Make.config and disable CONFIG_VIDEO_BUF_DVB. Find the following lines:

ifneq ($(KERNELRELEASE),)
CONFIG_VIDEO_BUF_DVB := $(shell test $(SUBLEVEL) -ge 12 -a $(PATCHLEVEL) -ge 6 && echo m)
endif

and change replace it with:

ifneq ($(KERNELRELEASE),)
CONFIG_VIDEO_BUF_DVB := n
endif

This will, of course, disable any dvb functionality from the v4l-kernel cvs tree. If you are having this problem, and need dvb, then you will have to upgrade to a newer kernel, or use a vanilla kernel from http://www.kernel.org.

Revision as of 22:00, 26 November 2005

An outline of the procedure used to successfully build the drivers in video4linux CVS. If you want the drivers already working properly in the kernel these are not the instructions to follow.

I did this on linux-2.6.12-gentoo and tested the lgdt3302 driver for a card I own. It should be applicable to the other drivers in CVS as well. CVS is usually only going to work on recent linux kernels.

If your kernel is already set up as outlined in step one, then it is safe to skip to step 3.

1) Configure your kernel. If multimedia drivers in addition to those specified here are selected, you may end up loading an old copy of a module compiled by the kernel rather than the new version just compiled from CVS.

Run:

   make menuconfig

in the Linux source directory and set things like this:

   Device Driver --->
       Multimedia Devices --->
           <M> Video for Linux
               Digital Video Broadcasting Devices --->
                   [*] DVB for Linux
                   <M> DVB Core

If you don't need any of the digital drivers, then you do not need to select DVB Core.

                   < > DVB Core

No other drivers or options should be selected under Multimedia Devices ---> or any lower level.

2) Follow your normal procedure for recompiling and installing your kernel if you changed anything with menuconfig in step 1.

3a) Check out v4l-dvb CVS files following the instructions at linuxtv.org [Repeated here].

   cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/video4linux login
   cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/video4linux co v4l-dvb

3b) (optional) You can later update your sources by running:

   cvs -z3 up -dP

4) Change into the v4l-dvb directory:

   cd v4l-dvb

5) Compile the modules:

   make

6) As root, after compiling the modules you can make them available to the OS with:

   make install

7) Now you can install the driver you need into the OS. Each driver from within CVS has been built.

My particular driver needs:

   modprobe -v cx8800
   modprobe -v cx88-dvb

The -v option is handy for checking where the driver module actually was found. If your startup scripts are configured correctly, these modules can be set up to load automatically on system boot.

8) (optional) If you later decide to recompile v4l-dvb cvs against a different kernel, you must wipe out the version info:

   make distclean