dvb/linuxtv-dvb MAKEDEV-DVB.sh README-2.6 README.bt8xx TODO TROUBLESHOOTING makelinks Makefile NEWS README

Thomas Schmidt pkg-vdr-dvb-changes@lists.alioth.debian.org
Sun, 23 May 2004 08:56:28 +0000


Update of /cvsroot/pkg-vdr-dvb/dvb/linuxtv-dvb
In directory haydn:/tmp/cvs-serv6953/dvb/linuxtv-dvb

Modified Files:
	Makefile NEWS README 
Added Files:
	MAKEDEV-DVB.sh README-2.6 README.bt8xx TODO TROUBLESHOOTING 
	makelinks 
Log Message:
added files from release 1.1.1

Index: NEWS
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/dvb/linuxtv-dvb/NEWS,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- NEWS	29 Apr 2004 10:46:24 -0000	1.1.1.1
+++ NEWS	23 May 2004 08:56:26 -0000	1.2
@@ -1,3 +1,36 @@
+Changes for linuxtv-dvb-1.1.1:
+o fixed various timing issues in frontend code to speed up tuning
+o fixed pointer bug in ring buffer handling which potentially
+  affected common interface communication
+o fixed av7110 debi functions for ARM64, added better error checking
+o fixed software demux section filter bug which caused data loss
+  if there were two sections in one TS packet and the first section
+  was smaller than 18 bytes
+o frontend fixes for ves1820 and stv0299
+o added support for Fujitsu-Siemens Activy card 
+o various minor cleanup things
+
+
+Changes for linuxtv-dvb-1.1.0:
+
+  Too many to list them all ;-)
+  The most important things:
+
+o This release is from a different CVS tree (dvb-kernel), which is
+  structured like the Linux kernel source tree.
+o test/demo applications and utilies are unbundled and released
+  seperately
+o support for Linux 2.6.x; in fact, this release is a snapshot of
+  the stuff which is part of the 2.6.x kernel
+o added support for bt8xx based DVB cards and various USB things
+o completely new saa7146 driver, which is shared among DVB and
+  some analog TV cards
+o firmware binaries are not part of the release because of licensing
+  problems; see the README for information where to get
+
+
+============================================================================
+
 Changes for linuxtv-dvb-1.0.1:
 o DMA fix by Jon Burgess
 o fixed PCI latency setting in SAA7146 driver

--- NEW FILE: README.bt8xx ---
How to get the Nebula, PCTV and Twinhan DST cards working
=========================================================

This class of cards has a bt878a as the PCI interface, and require the
bttv driver.

Please pay close attention to the warning about the bttv module options
below for the DST card.

2) 2.6
======

For 2.6, you don't need the latest bttv driver, everything is in
the kernel drivers. Please use 2.6.1 and above.

Build and intsall the driver like described in README.

1) 2.4
======

For 2.4, make sure you are using an uptodate kernel 2.4.23 and above.
This is the *only* way to go when you are experimenting with 
bleeding-edge stuff like DVB.

You need an up-to-date bttv driver for the bt8xx-based cards to work.

Two methods to get a recent version:
a) Patch your kernel (and possibly recompile it)
b) Compile an external package

Method a)
The most recent patches for 2.4.23 so far are at
http://bytesex.org/patches/2.4.23-4/

You need to fetch at least the following patches:
20_v4l2-2.4.23.diff.gz
30_video-buf-2.4.23.diff.gz
31_ir-input-2.4.23.diff
31_tuner-2.4.23.diff.gz
32_bttv-2.4.23.diff.gz

Decompress them with "gzip -d *.gz" and the apply them one after
another to your 2.4.23 kernel tree via "patch -p1 < [...]"

Then select the bttv driver and recompile your kernel and modules.
Remeber to enable the V4L functionality. For the 'BT848 Video For
Linux' in the 'Video for Linux' section to show up you need to enable
'I2C support' and 'I2C bit-banging interfaces' in the charcter devices
section, as well as 'Sound' => 'Sound card support'.

Method b)

Download http://bytesex.org/snapshot/video4linux-xxxxyyzz.tar.gz, where
xxxxyyzz is the date of the release.

Extract it and do the usual "make" and "make install".
  $ tar xzfv video4linux-xxxxyyzz.tar.gz
  $ make
  $ make install

This will give you (amongst other stuff) a recent bttv driver.

Now build and install the driver like described in README.

3) Loading Modules
==================

You can either modify and use the "insmod-bt8xx.sh" script in the
build-2.4 directory or simply do everything by hand.

In general you need to load the bttv driver, which will handle the gpio
and i2c communication for us. Next you need the common dvb-bt8xx device
driver and one frontend driver.

The bttv driver will HANG YOUR SYSTEM IF YOU DO NOT SPECIFY THE
COORECT  CARD ID! A list of possible card ids can be found inside
"bttv-cards.c" inside the bttv driver package.

Pay attention to failures to load these frontends. 
(E.g. dmesg, /var/log/messages).

3a) Nebula / Pinnacle PCTV
--------------------------

   $ modprobe bttv i2c_hw=1 card=0x68
   $ modprobe dvb-bt8xx
   
For Nebula cards use the "nxt6000" frontend driver:
   $ modprobe nxt6000

For Pinnacle PCTV cards use the "cx24110" frontend driver:
   $ modprobe cx24110

3b) TwinHan
-----------

   $ modprobe bttv i2c_hw=1 card=0x71
   $ modprobe dvb-bt8xx
   $ modprobe dst

The value 0x71 will override the PCI type detection for dvb-bt8xx,
which  is necessary for TwinHan cards.

If you're having an older card (blue color circuit) and card=0x71 locks
your machine, try using 0x68, too. If that does not work, ask on the
mailing list.

The DST module takes a couple of useful parameters, in case the dst
drivers fails to detect your type of card correctly.

dst_type takes values 0 (satellite), 1 (terrestial TV), 2 (cable).

dst_type_flags takes bit combined values:
1 = new tuner type packets. You can use this if your card is detected
    and you have debug and you continually see the tuner packets not
    working (make sure not a basic problem like dish alignment etc.)

2 = TS 204. If your card tunes OK, but the picture is terrible, seemingly
    breaking up in one half continually, and crc fails a lot, then
    this is worth a try (or trying to turn off)

4 = has symdiv. Some cards, mostly without new tuner packets, require
    a symbol division algorithm. Doesn't apply to terrestial TV.

You can also specify a value to have the autodetected values turned off
(e.g. 0). The autodected values are determined bythe cards 'response
string' which you can see in your logs e.g.

dst_check_ci: recognize DST-MOT

or 

dst_check_ci: unable to recognize DSTXCI or STXCI

--- NEW FILE: README-2.6 ---
Instructions for patching a 2.6 kernel with this release
--------------------------------------------------------

(Note: Alternatively you can use build-2.6/ to build without
patching the kernel, but this currently does not work for
bt878 based cards due to include patch problems.)


The DVB driver in 2.6.1 and above is regularly kept up-to-date, so it's  possible
that it's even newer than the latest release tarball. There might be some cases
though, where you want a specific release tarball driver compiled into the
kernel. 

There is a script called "makelinks" which -- well -- makes links from the 
CVS version of the driver to the kernel tree you supply on the command line.
The driver from the kernel is erased, instead the local source will be used if
you compile your kernel again.

Step-by-step instruction:

1) Call "./makelinks <your-kernel-directory>. This will copy and link the
driver files to your kernel, remove some old files, move some files around.

2) Next, use "make menuconfig" or whatever and select the av7110 driver if
you haven't done so before. 

The av7110 driver needs a firmware to work properly.

If you want to compile it into the driver as it used to be in the past, you can
download firmware files from http://www.linuxtv.org:81/download/dvb/ The most
recent version is dvb-ttpci-01.fw. You need to select "Compile av7110 firmware
into the driver" and  specify the filename path (usually
/usr/lib/hotplug/firmware/dvb-ttpci-01.fw) within the DVB subsystem configuration
of the kernel.

Alternatively, you can use the hotplug facilities of 2.6 to let the driver load 
it's firmware upon driver insertion. Have a look at
linux/documentation/firmware.txt for further details.

*Pitfall*: 
If you compile the driver statically into the kernel, you must make sure that
you compile the firmware into the driver. There is currently no way to prevent
in-kernel compilation without the firmware being compiled in. If you do it anyway,
there will be no way that you can load the firmware.

Build and install the new kernel as usual.

--- NEW FILE: TODO ---
2.6:
[ ] module stuff
- change MODULE_PARM() to module_param(), have a look at
http://lwn.net/Articles/22197/ for details


all:
[ ] code audit
- code audit for return values, ie. change all -1 or -2 return
codes to real ERRNO values. [Hmm, is this done already?]

saa7146:
[ }
- add support for more planar capture modes, so that mp1e/nvrec work out of the box
- replace vmalloc_32() with pci_alloc_consistent() for dma memory stuff

dvb:
[ ] general dvb core stuff
- 2.5.x: replace "video_usercopy()" (or dvb_usercopy()) with
  generic_usercopy(), make a patch for lkml. note: done, awaiting
  approval from lkml

[ ] dvb_demux.c: Fix module removal if in use.
- If rmmod of dvb-core is attempted while demux is in use, 
  by e.g. szap, non-fatal oops will follow: 
  Code;  f88c0823 <[dvb-core]dvb_demux_release+7/18>   <=====
  0:   8b 50 50                  mov    0x50(%eax),%edx   <=====

[ ] budget: Fix coexistence of several ttpci-budget-* modules.
- After one or two rmmod/insmod of dvb-kernel modules suite
  when there are 2 or more different ttpci-budget-* moules,
  an oops is issued during the remmod:
  Code;  f88f01a9 <[dvb-core]dvb_unregister_device+d/2c>   <=====
  0:   89 50 04                  mov    %edx,0x4(%eax)   <=====

[ ] dummy: Add support for dummy (loopback) DVB interface
- People without DVB hardware should be able to load drivers and
  participate in development.

[ ] sw_demux: intelligent 0x47 SYNC.
- each TS packet should start with 0x47 byte. If there is no 0x47 byte
  at expected position, search for first 0x47 byte and check if previous 
  3 188-byte offsets also contain 0x47. If yes, consider this new sync 
  position. vpeirq has to be changed a bit and some changes in sw_demux
  too.

--- NEW FILE: makelinks ---
#!/bin/sh
# link drivers sources from CVS or release tarball into your 2.6.x kernel sources;
# an alternative way of compiling is to use the build-2.6 stuff, but
# buld-2.6 won't work for bt878 based cards due to include patch brain damage...


if test -z $1 || ! test -d $1 ; then
	echo
	echo "  usage: $0 <path_to_kernel_to_patch>"
	echo
	exit 
fi

echo "patching $1..."

cd linux
PWD=`pwd`

for x in `find drivers -type d | grep -v CVS | grep -v compat` ; do
	mkdir -p -v $1/$x 
done

for x in `find Documentation -type d | grep -v CVS ` ; do
	mkdir -p -v $1/$x 
done

for x in `find include -type d | grep -v CVS` ; do
	mkdir -p -v $1/$x 
done

for x in `find Documentation -type f | grep -v CVS | grep -v .cvsignore` ; do
	ln -v -f -s $PWD/$x $1/$x
done

for x in `find drivers -type f | grep -v CVS | grep -v .cvsignore` ; do
	ln -v -f -s $PWD/$x $1/$x
done

for x in `find $1/drivers/media/dvb -type f | grep "saa"` ; do 
	rm -rf $x
done

for x in `find include -type f | grep -v CVS | grep -v .cvsignore` ; do
	ln -v -f -s $PWD/$x $1/$x
done


Index: README
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/dvb/linuxtv-dvb/README,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- README	29 Apr 2004 10:46:24 -0000	1.1.1.1
+++ README	23 May 2004 08:56:26 -0000	1.2
@@ -1,41 +1,179 @@
-linuxtv-dvb-1.0.0
+linuxtv-dvb-1.1.1
 =================
 
-The is the final release of the linuxtv DVB drivers for Linux 2.4.
-Our development will continue in the dvb-kernel CVS tree, which has
-significant changes to support Linux 2.6, but also supports Linux 2.4.
+Digital Video Broadcast drivers for Linux 2.4.19+ and Linux 2.6.x.
 
-This release tarball includes:
-- the DVB driver core
-- drivers for PCI cards based on the Philips SAA7146 PCI bridge,
-  and cards based on the B2C2 FlexCopII; see the file CARDS for
-  full information
-- a number of frontend drivers for DVB-S, DVB-C and DVB-T
-- two older, unmaintained drivers for Margi and EM8300 MPEG decoder cards
-- some utilities and test programs
-- TeX source for the "Linux DVB API Version 3" documentation
+Note: Unlike in previous releases, the test/utility programs have
+been unbundled and are released seperately as linuxtv-dvb-apps-1.1.0.
 
-For a list of supported hardware see the file CARDS.
-For installation instructions see the INSTALL file,
-See the file FAQ for some very frequently asked questions and
-information about DVB applications for Linux.
 
-For more information and latest releases visit:
-http://www.linuxtv.org/
+Linux 2.6.x:
+  The DVB drivers are already included in Linux 2.6.x, so you usually
+  don't need this package. What you will need, hwoever, is firmware.
+  see below.
 
-Developer mailing list:
-http://linuxtv.org/mailinglists.xml
+Linux 2.4.19+:
+  Due to changes in the video4linux layer we don't support kernels
+  older than 2.4.19. If you need to use an older kernel you must
+  apply video4linux patches to the kernel first.
 
-If you have questions please make use of the search function
-of the mailing list archive before asking on the list:
-http://linuxtv.org/cgi-bin/htwrap.pl
 
+Quick start:
+------------
+
+1. Get firmware:
 
-linuxtv-dvb-1.0.1
-=================
+  Some DVB cards need firmware to operate. Due to licensing problems
+  we won't distribute the firmware binaries with the driver source,
+  you must get them seperately. See below for details about where
+  to get and where to put.
 
-This is the usual bugfix release. Please use this one instead of 1.0.0 
-before reporting bugs to the LinuxDVB Mailinglist.
+  For Linux 2.6.x also see linux/Documentation/dvb/firmware.txt and
+  linux/Documentation/firmware_class/README.
 
+  Note: The firmware loader has been backported from 2.6 to 2.4.24,
+  but the drivers do not yet support this. You must compile the
+  firmwares into the drivers.
 
-Good luck and have fun!
+
+2. cd build-2.4 or build-2.6
+
+3. make
+
+4. ./insmod.sh load
+
+  Note: Some of the drivers will refuse to load and spit out
+  error messages if they cannot find their hardware. You can
+  ignore them, or edit insmod.sh and comment out drivers that
+  you don't need.
+
+  You will have to load at least two drivers:
+  - one for the main DVB card / device
+  - one for the frontend (i.e. tuner + demodulator)
+
+
+Detailed instructions for building:
+-----------------------------------
+
+If you encounter any problems while executing the follwing steps please read
+the TROUBLESHOOTING file.
+
+Simply type 'make' to build the driver. The compiled modules will be located
+in directory ./build-2.4/ or ./build-2.6/, depening on the kernel version you
+are running. There you will also find scripts to load and unload the modules.
+
+For some cards or frontends you need to download additional firmware
+binaries:
+
+- dvb-ttpci: http://www.linuxtv.org/download/dvb/
+  => wget http://www.linuxtv.org/download/dvb/dvb-ttpci-01.fw
+  Place the "dvb-ttpci-01.fw" file in the build-2.4 and/or build-2.6
+  directory. The firmware will be compiled into the driver at it used to
+  be.
+
+- alps_tdlb7: 
+  This driver needs a copy of the firmware file 'Sc_main.mc' from the
+  Haupauge windows driver in the '/usr/lib/hotplug/firmware' directory.
+  Alternatively, you can also pass the complete filename with the module
+  parameter 'firmware_file'.
+
+- tda1004x:
+  This driver needs a copy of the DLL "ttlcdacc.dll" from the Haupauge or
+  Technotrend windows driver saved as
+  '/usr/lib/hotplug/firmware/tda1004x.bin'. You can also pass the complete
+  file name with the module parameter 'tda1004x_firmware'.
+  Currently the DLL from v2.15a, or 2.16a of the technotrend PCI driver is supported.
+  Please note, even if you're using a USB device, you _must_ get the
+  file from the TechnoTrend PCI driver.
+  Windows driver URL: http://www.technotrend.de/
+
+- ttusb-dec:
+  see "ttusb-dec.txt" in linux/Documentation for details
+
+If something is missing, you get notified in the build process or when
+loading the modules.
+
+Just in case you are wondering: the "alps_bsrv2" driver is gone, please use
+the new "ves1x93" driver instead.
+
+In ./build-2.4/ or ./build-2.6/ you find the insmod script.
+
+Use './insmod.sh load' to load the driver modules, './insmod.sh unload' to 
+remove them. './insmod debug' loads the drivers with debugging enabled. 
+These scripts load all drivers for all cards but the ones based on the bt8xx.
+For bt8xx based cards please use the insmod-bt8xx.sh script instead.
+
+Now check the klog and syslog (in doubt type 'dmesg') for error messages.
+
+When you reached this point successfully you probably want to start some
+test applications, download the linuxtv-dvb-apps-1.1.tar.gz package, unpack
+it and compile it. This package contains some tools to test and debug the
+driver:
+
+linuxtv-dvb-apps-1.1/apps/szap/ contains three simple applications called 
+szap, czap and tzap for zapping with DVB-S, DVB-C or DVB-T cards.
+Read linuxtv-dvb-apps-1.1/apps/szap/ README for usage instructions.
+
+Note 1: tuning succeeded if you see the FE_HAS_LOCK flag and "status 1f"; a
+good signal has a low bit error rate (ber) and zero uncorrectable packets (unc).
+
+Note 2: you must keep ?zap running, or the frontend will go to sleep (unless
+you load dvb-core.o with dvb_shutdown_timeout=0)
+
+If your card has a hardware MPEG decoder you can watch TV with xawtv (together
+with e.g. szap for DVB tuning); Note: xawtv cannot control the DVB tuner, you
+must use ?zap
+
+For cards without hardware MPEG decoder you need a software MPEG decoder, 
+e.g. mplayer or xine (you need *very* recent versions which understand MPEG2 
+transport streams; xine v0.9.21 and mplayer dev-CVS-030723-16:39-3.3.1 seem to 
+work); Note: You must run ?zap with the -r flag to enable stream output to the 
+dvr device, and keep it running while watching tv.  
+
+Examples: 
+	mplayer - < /dev/dvb/adapter0/dvr0 
+	xine stdin://mpeg2 < /dev/dvb/adapter0/dvr0
+	
+Note: Newest mplayer and xine versions are reported to have builtin DVB support
+(see ./linux/Documentation/dvb/faq.txt for more info).
+
+For 'real' everyday use you probably don't want to use these test applications 
+but install a program like VDR or MythTV.
+(Read ./linux/Documentation/dvb/faq.txt for some links)
+
+When everything is working you probably want to install the driver on your 
+system by typing 'make install'. If you want to load the modules automatically
+when an application tries to open the device you need to add lines like these 
+to your modules.conf:
+
+	probeall /dev/dvb dvb-ttpci
+	alias /dev/dvb/* /dev/dvb
+	below dvb-ttpci alps_bsrv2 alps_tdmb7 alps_tdlb7
+	add below dvb-ttpci grundig_29504-401 grundig_29504-491
+	add below dvb-ttpci stv0299 ves1820
+
+Note: this example is for people with Technotrend-based PCI cards, they must 
+load the dvb-ttpci driver and a matching frontend drivers that are potentially
+used on these cards. In order to find out which ones are required for your
+setup check the lsmod output after loading the driver like described above.
+Those DVB modules that have a usecount greater zero are required in your 
+setup - edit the modules.conf file appropriatly]
+
+Debian users don't edit modules.conf manually but add the lines above to a new
+file in /etc/modutils/ (e.g. /etc/modutils/dvb) and call 'update-modules' then.
+
+--------------------------------------------------------------------------------
+
+The build system has been tested down to 2.4.20, if you run an older kernel
+either update your kernel or just try - maybe you need to add some tweaks in
+the dvb_compat.[hc] files. Please report your modifications on the linux-dvb 
+mailing list.
+
+If you want to build a not-standalone driver but want to patch your 2.6 kernel
+source tree with this driver please read README-2.6.
+
+More documentation is located in ./linux/Documentation/dvb/.
+
+good luck,
+
+Holger

--- NEW FILE: MAKEDEV-DVB.sh ---
#!/bin/sh
# Create device nodes for the Linux DVB API with DVB_API_VERSION 2.
# The devices created are suitable for most current PC DVB cards,
# i.e. cards having one frontend, one demux and optionally one
# MPEG decoder.
# The script creates devices for four cards by default.

if [ -e /dev/.devfsd ]; then
        echo "It seems you are using devfs. Good!"
	exit 0
fi

# get rid of old DVB API devices; do it twice for good measure...
rm -rf /dev/ost
rm -rf /dev/ost
rm -rf /dev/dvb
rm -rf /dev/dvb

mkdir /dev/dvb
chmod 755 /dev/dvb

for i in `seq 0 3`; do
	echo "Creating DVB devices in /dev/dvb/adapter$i"
	mkdir /dev/dvb/adapter$i
	chmod 755 /dev/dvb/adapter$i
	mknod -m 0660 /dev/dvb/adapter$i/video0    c 250   `expr 64 \* $i + 0`
	mknod -m 0660 /dev/dvb/adapter$i/audio0    c 250   `expr 64 \* $i + 1`
	mknod -m 0660 /dev/dvb/adapter$i/frontend0 c 250   `expr 64 \* $i + 3`
	mknod -m 0660 /dev/dvb/adapter$i/demux0    c 250   `expr 64 \* $i + 4`
	mknod -m 0660 /dev/dvb/adapter$i/dvr0      c 250   `expr 64 \* $i + 5`
	mknod -m 0660 /dev/dvb/adapter$i/ca0       c 250   `expr 64 \* $i + 6`
	mknod -m 0660 /dev/dvb/adapter$i/net0      c 250   `expr 64 \* $i + 7`
	mknod -m 0660 /dev/dvb/adapter$i/osd0      c 250   `expr 64 \* $i + 8`
	chown root.video /dev/dvb/adapter$i/*
done


--- NEW FILE: TROUBLESHOOTING ---
Troubleshooting - or the most common problems...
------------------------------------------------

If you encounter any troubles building and installing the driver you might
want to check that the following prerequisites are satisfied:

You must have the kernel sources for the kernel you are currently using
installed, and symlinked to /lib/modules/$(KERNEL_VERSION)/build. This should
be the default in proper installations with installed kernel source package.

If you are in doubt please get a fresh and clean kernel source tarball from
http://www.kernel.org/, unpack, configure, install and boot this one before
building the DVB driver. 80% of the bug reports on the linux-dvb mailing list
have been related to not properly installed kernel source trees in the past.

For cards with MPEG decoder onboard make sure that CONFIG_VIDEO_DEV is enabled
in the config of your running kernel. If you get unresolved symbols named
video_XXXX when loading the driver then you missed this option.

For some cards you need Input and Event Device Support enabled to get the
IR receiver on the card running. Be sure to enable CONFIG_INPUT and
CONFIG_INPUT_EVDEV if you get unresolved symbols named input_XXX.

For bttv cards you need a recent bttv driver installed, this is either part
of the kernel or available as standalone driver on Gerd Knorr's website
(http://bytesex.org/). Also you need to explicitly enable i2c and i2c bitbanging
support in your kernel for those cards.

If you get a message 'insmod: no such device' while loading the driver - don't
worry, this is normal, since you load the drivers for all possible cards some
of the drivers complain because they don't find a matching card in your system.
You can safely remove those ones from the list in the insmod scripts.

If you are sure that all the issues above don't cause your problems you might
want to ask on the linux-dvb mailing list for further assistance
(http://www.linuxtv.org/mailinglists/).

good luck,

Holger


Index: Makefile
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/dvb/linuxtv-dvb/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Makefile	29 Apr 2004 10:46:24 -0000	1.1.1.1
+++ Makefile	23 May 2004 08:56:26 -0000	1.2
@@ -1,50 +1,43 @@
-
-VERSION := 1.0.1
+VERSION := 1.1.1
 PACKAGE := linuxtv-dvb-$(VERSION)
-
-
-all:  dvb 
-
-dvb:
-	(cd driver; make)
-	(cd apps/av7110_loadkeys; make)
-	(cd apps/dvbnet; make)
-	(cd apps/dvbdate; make)
-	(cd apps/scan; make)
-	(cd apps/test; make)
-	(cd apps/szap; make)
-
-
 CVSROOT     := $(shell cat CVS/Root)
 RELEASE_TAG := LINUXTV-DVB-$(subst .,_,$(subst -,_,$(VERSION)))
 
+KERNEL_MINOR := $(shell uname -r | sed -e 's/^2\.\(.\).*/\1/')
+BUILD_DIR := $(shell pwd)/build-2.$(KERNEL_MINOR)
+
+all:
+
 release dist:
 	rm -rf release-tmp $(PACKAGE).tar.gz
 	mkdir release-tmp
-	( cd release-tmp; cvs -z6 -d$(CVSROOT) export -r$(RELEASE_TAG) -d$(PACKAGE) DVB )
-	# work around CVS braindeadness wrt file permissions
-	chmod -x release-tmp/$(PACKAGE)/Makefile
-	chmod -x release-tmp/$(PACKAGE)/driver/av7110/av7110.c
-	chmod -x release-tmp/$(PACKAGE)/include/linux/em8300.h
+	( cd release-tmp; cvs -d$(CVSROOT) export -r$(RELEASE_TAG) -d$(PACKAGE) dvb-kernel )
+	( cd release-tmp/$(PACKAGE) && rm -rf patches-2.6 analog-2.4 mediafocusII-2.4 build-template )
 	find release-tmp -name .cvsignore | xargs rm -v
-	( cd release-tmp; tar czf ../$(PACKAGE).tar.gz $(PACKAGE) )
+	( cd release-tmp; tar cjf ../$(PACKAGE).tar.bz2 $(PACKAGE) )
 	rm -rf release-tmp
 	@echo
-	@echo --------------------------------------------------------------------------------
+	@echo --------------------------------------------------------------------------------------
 	@echo
-	@echo "driver package: ./$(PACKAGE).tar.gz"
+	@echo "driver package: ./$(PACKAGE).tar.bz2"
 	@echo
-	@echo --------------------------------------------------------------------------------
+	@echo --------------------------------------------------------------------------------------
 	@echo
 
+install:
+	$(MAKE) -C $(BUILD_DIR) install
 
-clean:
-	(cd driver; make clean)
-	(cd apps/av7110_loadkeys; make clean)
-	(cd apps/dvbnet; make clean)
-	(cd apps/scan; make clean)
-	(cd apps/test; make clean)
-	(cd apps/szap; make clean)
-
-
-
+%::
+	$(MAKE) -C $(BUILD_DIR) $(MAKECMDGOALS)
+	@echo
+	@echo --------------------------------------------------------------------------------------
+	@echo
+	@echo The driver was built in $(BUILD_DIR). Please use 
+	@echo
+	@echo $(BUILD_DIR)/insmod.sh or
+	@echo $(BUILD_DIR)/insmod-bt8xx.sh
+	@echo
+	@echo "to load and unload the modules for testing. (see README for details)"
+	@echo
+	@echo --------------------------------------------------------------------------------------
+	@echo