This is documentation for some old versions of ZapDvb (0.20 and earlier). If you are using a 2.4 kernel or are using SuSE 8.1 ... 9.0 you may still find it helpful. For a 2.6 kernel you will need newer DVB kernel drivers, see www.linuxtv.org. Even with an older system you should try to compile the new ZapDvb applications - it contains many new features! See current ZapDvb version.

This chapter focuses on the first of two installation steps. Here we discuss the installation and loading of the DVB drivers. For later kernels (hopefully since 2.4.21) this chapter will become obsolete because currently the driver gets integrated into the kernel source tree.

Building the Metzler Driver (for SuSE8.2):

If you trust binary RPMs and have a default SuSE8.2 installation you don't need to build the drivers by yourself. Anyhow you may want to remove some unused file or packages from your system - so please continue to read this...

We assume in this text to start from a fresh SuSE8.2 default installation. But SuSE has made a severe mistake: wrong kernel sources were included in the release media. Consider downloading some updated sources from ftp://ftp.suse.com/pub/people/mantel/next. There is also a source rpm named km_dvb somewhere on the SuSE server - which can be used to build SuSE's version of the dvb drivers (but we don't use them).

The modules for the SuSE default kernel are installed under /lib/modules/2.4.20-4GB. The "-4GB" is a bit tricky, we will revisit it soon. The SuSE dvb drivers are installed under the dvb subdirectory. Consider deleting this directory - these drivers don't help you and and accidentally loading wrong modules into the kernel can become very confusing. In case you want them back later: the files where installed from the k_deflt-2.4.20 rpm.

Another thing that you should remove or disable is /usr/sbin/rcdvb, a script that tries to start those SuSE drivers that you just deleted. We will start the Metzler drivers via modules.conf. You can use the Yast run-level editor to disable rcdvb instead of deleting it (it's not enabled by default, but you might have done this by attempting to configure your dvb card via Yast).

Consider removing the packages kvdr and vdr too (because they don't help you). That software relies on the presence of a SAA7113 chip which is missing in simple DVB cards. If you still want to remove something in order to clean up your system, have a look at the package dvb which provides szap, czap and tzap. You probably can't use czap (cable-dvb) or tzap (terrestrial-dvb) and szap will be replaced by zapdvb.

Finally, to build the drivers we need the kernel sources. Unpack the SuSE kernel sources (remember that you should use the updated sources). You don't need to build the kernel completely but you must 'prepare' the build machinery for your system (this was the "-4GB" thing already mentioned). Take the following steps:

cd /usr/src/linux
cp /boot/vmlinuz.config .config     # the SuSE defaults

make xconfig
# eventually change the kernel architecture from i586
# to whatever better matches your hardware - see menu
# 'Processor types and features'. Save the configuration.
# SuSE made another mistake - ignore the error message.

make dep      # this takes a moment
make bzImage      # can be killed after a few seconds

The above steps have created or modified some files that are used by the Metzler Makefile. To continue building the drivers now download zapdvb_metzler-1.1.6.tgz (see: download page) and unpack the sources of the driver. Then change to the subdirectory driver (the driver sources are to be installed inside the zapdvb source tree):

tar -xzf dvb_metzler-0.1.6.tgz  # unpack the archive -> zapdvb
cd zapdvb     # build dir for zapdvb
cd DVB/driver     # build dir for driver
make        # builds the drivers
# you can see that the '-march' option for the GCC compiler reflects the
# selected processor type (I used Pentium3). Ignore the compiler warnings

su        # must have root privileges
make install      # installs them to /lib/modules/.../misc

Marcus Metzler decided to install the driver und /lib/modules/.../misc, which is nice because it does not interfere with SuSE.

Here is a step-by-step summary of what we did until now:

Installing the Metzler Drivers from a RPM

The RPM that you can download is called dvb_metzler-1.1-6.i686.rpm and is built for a SuSE 8.2 system. The architecture is 'Pentium3' which should be Bk for most systems. The rpm contains scripts that modify modules.conf to automatically load the drivers upon request. The mechanism is described below. If your front-end is not a stv0299 modules.conf must be edited by hand. The rpm script will also create the device nodes that are required to use DVB. But now issue the following commands to start:

su          # must have root privileges
rpm -U --force zapdvb_metzler-1.1-6.rpm
creating device nodes ...
changing module config ...
running depmod ...

As you have seen a post-install script was running. To avoid this use the --noscripts option in the rpm command lines. The zapdvr directory contains the shell script zapdvb_driver that can do the same things under manual control.

Testing the Core Driver

For testing you should open a separate shell window and watch the output of:

tail -f /var/log/messages

Now get another shell window and type the following to load the driver by hand:

modprobe dvb-saa7146

and you should get log messages like:

kernel: Linux video capture interface: v1.00
kernel: i2c-core.o: i2c core module version 2.7.0 (20021208)
kernel: dvb_register_adapter: registering new adapter (KNC1 DVB-S).
kernel: saa7146_core.o: saa7146: bus:0, rev:1, mem:0xd29d2000.
kernel: av7110: SAA7113 not found on KNC card
kernel: dvb_register_device: register adapter0/demux0 @ minor: 4 (0x04) ...
kernel: dvb_register_device: register adapter0/dvr0 @ minor: 5 (0x05) ...
kernel: dvb_register_device: register adapter0/net0 @ minor: 7 (0x07) ...
Finding the Right Front-end

Something important is still missing: the front-end (some people say tuner for it). The KNC card uses stv0299 - so try to load the module:

modprobe stv0299

with some luck you will see the following success message in the system log (use the tail command described above):

kernel: client_register
kernel: dvb_register_device: register adapter0/frontend0 @ minor: 3 (0x03) ...
kernel: stv0299: tuner at 0x61
kernel: stv0299: attaching stv0299 at 0xd0 to adapter saa7146

If you did not see such a friendly message try the other front-ends:

modprobe ves1820
modprobe ves1893
modprobe grundig_29504-401  # only until version 1.1.6
modprobe tda8083

If all front-ends failed you have a problem - write one or wait until somebody else does it for you. Sorry!

Configuring the DVB Driver for Automatic Loading

One of the cool Linux features it the automatic loading of device drivers (e.g kernel modules). This feature is configured by the file /etc/modules.conf. If you want to modify the file by hand add the following lines at the end of the file (include the comments please):

alias char-major-250 dvb-saa7146 # zapdvb-inserted
add below dvb-saa7146 stv0299    # zapdvb-inserted

The zapdvb sources or the zapdvb-0.1.i686.rpm contain a shell script that can do this for us. Continue reading this documentation or locate the shell script zapdvb_driver either from the zapdvb sources (see the description of how to build zapdvb) or from in /usr/local/bin (if the zapdvb-0.1 RPM was installed). The script will also create the device nodes that are required to use DVB.

If you installed from a RPM and your frontend is not a stv0299 please change the last line of modules.conf to match your hardware and update the zapdvb_driver script.

Where are We? What is Next?

We have installed the DVB driver and tested if the modules load. Now we need some DVB software like szap plus mpegtools or zapdvb. Therefore the next chapter will describe how to build and how to install zapdvb.

In the following chapter we will not discuss mpegtools or any other software with the exception of MPlayer. zapdvb integrates all the software you need to convert the Transport Stream read from the driver to MPEG2 output data (click here for theory).