Personal tools
You are here: Home Digital Video Broadcast Terrestrial Compiling mcentral experimental v4l DVB drivers for SAA7134 and XC3028

Compiling mcentral experimental v4l DVB drivers for SAA7134 and XC3028

v4l-dvb-experimental

This tree works well with the M-103C module with the card and tuner specified as a module parameter. The M-103C is not specifically supported by the SAA7134 driver, however the AVerMedia cardbus 506 is supported, and it appears to be close enough to work.

2.6.23 kernel

The driver compiles without error with a 2.6.23 kernel. The environment used is Fedora 8 (i386, with a vanilla i686 kernel). Prerequisite packages include 'kernel-devel' for the current kernel, as well as compilers etc.

$ hg clone http://mcentral.de/hg/~mrec/v4l-dvb-experimental/
$ make

The default 'make install' overwrites the RPM based v4l kernel modules. So that I had an easy back-out plan, I manually copied the modules to '/lib/modules/`uname -r`/updates'.  The search path for finding modules is specified in /etc/depmod.d/depmod.conf, and defaults to 'updates extra built-in weak-updates'; so putting the modules into the 'update' directory means they will be used before the RPM based v4l modules.

cp -v v4l/*.ko /lib/modules/`uname -r`/updates ; depmod -a

I have hard coded the saa7134 options. Given the driver isn't fully supported, hard coding the card and tuner numbers seemed to be a reasonable compromise. The file 'CARDLIST.saa7134' and 'CARDLIST.tuner' files should be consulted to verify the numbers are correct (and it is reasonable to expect them to change).

Download the firmware[3], and copy it to '/lib/firmware'.  I used the latest v5 firmware file. Contray to the xc3028 readme file, extracting firmware from Windows drivers wasn't necessary.

 

2.6.24 kernel

When I tried to compile the mcentral ' v4l-dvb-experimental' tree against a 2.6.24 kernel, I got the error:

  CC [M]  /usr/local/src/v4l-dvb-experimental/v4l/flexcop-pci.o
In file included from /usr/local/src/v4l-dvb-experimental/v4l/flexcop-common.h:23,
                 from /usr/local/src/v4l-dvb-experimental/v4l/flexcop-pci.c:10:
/usr/local/src/v4l-dvb-experimental/v4l/dvb_frontend.h:42:33: error: media/v4l_dvb_tuner.h: No such file or directory
In file included from /usr/local/src/v4l-dvb-experimental/v4l/flexcop-common.h:23,
                 from /usr/local/src/v4l-dvb-experimental/v4l/flexcop-pci.c:10:
/usr/local/src/v4l-dvb-experimental/v4l/dvb_frontend.h:165: error: field 'tuner_ops' has incomplete type

This posting suggests the following command:

make LINUXINCLUDE="-I`pwd`/linux/include -I`pwd`/v4l -Iinclude -include include/linux/autoconf.h"

Which successfully compiles the v4l-dvb-experimental tree. Once agin, just do a simple install:

cp -v v4l/*.ko /lib/modules/`uname -r`/updates ; depmod -a

If compiling for a new kernel, a 'make clean' is insufficient, and a 'make distclean' is required.

Loading the 7134 modules

Tweak the modprobe.conf [1] to set the 7134 card to 117. Note that because we have a quad tuner (i.e. four M-103C modules), then the card and the tuner has to be listed 4 times.

Future

I attempted to move from the v4l-dvb-experimental tree to the v4l-dvb tree (here), but I haven't managed to get this working (yet). At some stage I would be keen to be able to have the drivers as part of the standard kernel. 

Links

Appendices

 

[1] /etc/modprobe.conf

#
# Avermedia M103-C Hybrid MiniPCI module. Card 117 is an
# Avermedia cardbus 506, but it has an XC30x8 tunner and
# MT253 demodulator. Tuner 71 is the Xceive XC3028 tuner
# driver, which also supports the XC3018 tuner.
#
options saa7134 alsa=1 card=117,117,117,117 tuner=71,71,71,71 i2c_scan=1

[2] dmesg show M103 eeprom

saa7130/34: v4l2 driver version 0.2.14 loaded
saa7133[0]: found at 0000:05:08.0, rev: 209, irq: 24, latency: 32, mmio: 0xd0400000
saa7133[0]: subsystem: 1461:f636, board: UNKNOWN/GENERIC [card=0,autodetected]
saa7133[0]: board init: gpio is 220100
saa7133[0]: i2c eeprom 00: 61 14 36 f6 00 00 00 00 00 00 00 00 00 00 00 00
saa7133[0]: i2c eeprom 10: ff ff ff ff ff 20 ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 20: 01 40 01 02 02 01 01 03 08 ff 00 0e ff ff ff ff
saa7133[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 40: ff 65 00 ff c2 1e ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: registered device video0 [v4l2]
saa7133[0]: registered device vbi0
saa7134 ALSA driver for DMA sound loaded
saa7133[0]/alsa: saa7133[0] at 0xd0400000 irq 24 registered as card -1

 

 

[3] Links to xc3028/xc2028/xc2018 firmware

 

[4] xc3028 readme

 
== Hauppauge HVR 900 == 
==== Installation ==== 
1. get the v4l-dvb repository from linuxtv and type make for generating all symlinks in v4l-dvb/v4l
2. copy tuner.h into v4l-dvb/linux/include/media/ in your v4l directory
3. simply replace following files in the repository
* Makefile
* em28xx-cards.c
* em28xx.h
* tuner-core.c
* tuner-types.c
* xc3028.c
with the files in this directory and simply recompile (copy these files to v4l-dvb/v4l) 
==== Firmware ==== 
this device needs a firmware, which is stored in emBDA.sys
build the firmwareextractor with
$ gcc convert.c -o convert
and extract the firmware
$ ./convert emBDA.sys > /lib/firmware/xceive_xc_3028.fw
(I only tested that tool with Hauppauge HVR 900, Terratec might work too but without any guarantee - please send me BDA files of other xc3028 devices) 
==== General ==== 
* the xc3028 works very reliable and the frequencies are correct for europe
* Please add your email, product name, vendor/product id to the discussion in the v4l wiki at www.linuxtv.org
* I'll not be responsible for any damage caused by this driver, use it with your own risk 
==== TODO ==== 
* some cleanup
* figuring out channel locks 

Markus Rechberger <mrechberger@gmail.com>

[5] boot time dmesg loading v4l-dvb-experiment tree with kernel 2.6.24.3-34.fc8  (Note: Flexcop and SAA7148 based DVB-S cards are also present)

 

Linux video capture interface: v2.00
b2c2-flexcop: B2C2 FlexcopII/II(b)/III digital TV receiver chip loaded successfully
flexcop-pci: will use the HW PID filter.
flexcop-pci: card revision 2
ACPI: PCI Interrupt 0000:04:06.0[A] -> GSI 17 (level, low) -> IRQ 22
DVB: registering new adapter (FlexCop Digital TV device)
b2c2-flexcop: MAC address = 00:d0:d7:13:d7:5c
saa7146: register extension 'dvb'.
saa7130/34: v4l2 driver version 0.2.14 loaded
b2c2-flexcop: found the stv0299 at i2c address: 0x68
DVB: registering frontend 0 (ST STV0299 DVB-S)...
b2c2-flexcop: initialization of 'Sky2PC/SkyStar 2 DVB-S' at the 'PCI' bus controlled by a 'FlexCopIIb' complete
ACPI: PCI Interrupt 0000:04:07.0[A] -> GSI 20 (level, low) -> IRQ 23
saa7146: found saa7146 @ mem f89fe000 (revision 1, irq 23) (0x13c2,0x0003).
DVB: registering new adapter (Technotrend/Hauppauge WinTV Nexus-S rev2.X)
adapter has MAC addr = 00:d0:5c:20:3d:7c
dvb-ttpci: gpioirq unknown type=0 len=0
dvb-ttpci: info @ card 1: firm f0240009, rtsl b0250018, vid 71010068, app 80002622
dvb-ttpci: firmware @ card 1 supports CI link layer interface
dvb-ttpci: adac type set to 0 @ card 1
saa7146_vv: saa7146 (0): registered device video0 [v4l2]
saa7146_vv: saa7146 (0): registered device vbi0 [v4l2]
DVB: registering frontend 1 (ST STV0299 DVB-S)...
input: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:04:07.0/input/input4
dvb-ttpci: found av7110-0.
ACPI: PCI Interrupt 0000:05:08.0[A] -> GSI 21 (level, low) -> IRQ 24
saa7133[0]: found at 0000:05:08.0, rev: 209, irq: 24, latency: 32, mmio: 0xd0400000
saa7133[0]: subsystem: 1461:f636, board: AVerMedia Cardbus TV/Radio (E506R) [card=117,insmod option]
saa7133[0]: board init: gpio is 220000
saa7133[0]: i2c eeprom 00: 61 14 36 f6 00 00 00 00 00 00 00 00 00 00 00 00
saa7133[0]: i2c eeprom 10: ff ff ff ff ff 20 ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 20: 01 40 01 02 02 01 01 03 08 ff 00 0e ff ff ff ff
saa7133[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 40: ff 65 00 ff c2 1e ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c scan: found device @ 0xa0  [eeprom]
saa7133[0]: i2c scan: found device @ 0xc2  [tuner (analog)]
tuner 3-0061: chip found @ 0xc2 (saa7133[0])
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
tuner 0x61: Configuration acknowledged
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
tuner 0x61: Configuration acknowledged
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
/usr/local/src/v4l-dvb-experimental/v4l/xc3028-tuner.c: attach request!
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: xc3028 tuner successfully loaded
saa7133[0]: registered device video1 [v4l2]
saa7133[0]: registered device vbi1
saa7133[0]: registered device radio0
ACPI: PCI Interrupt 0000:05:09.0[A] -> GSI 22 (level, low) -> IRQ 25
saa7133[1]: found at 0000:05:09.0, rev: 209, irq: 25, latency: 32, mmio: 0xd0400800
saa7133[1]: subsystem: 1461:f636, board: AVerMedia Cardbus TV/Radio (E506R) [card=117,insmod option]
saa7133[1]: board init: gpio is 220000
tuner 4-0061: chip found @ 0xc2 (saa7133[1])
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
tuner 0x61: Configuration acknowledged
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
tuner 0x61: Configuration acknowledged
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
/usr/local/src/v4l-dvb-experimental/v4l/xc3028-tuner.c: attach request!
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: xc3028 tuner successfully loaded
saa7133[1]: i2c eeprom 00: 61 14 36 f6 00 00 00 00 00 00 00 00 00 00 00 00
saa7133[1]: i2c eeprom 10: ff ff ff ff ff 20 ff ff ff ff ff ff ff ff ff ff
saa7133[1]: i2c eeprom 20: 01 40 01 02 02 01 01 03 08 ff 00 0e ff ff ff ff
saa7133[1]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[1]: i2c eeprom 40: ff 65 00 ff c2 1e ff ff ff ff ff ff ff ff ff ff
saa7133[1]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[1]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[1]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[1]: i2c scan: found device @ 0xa0  [eeprom]
saa7133[1]: i2c scan: found device @ 0xc2  [tuner (analog)]
Loading base firmware: xc3028_init0.i2c.fw
Loading default analogue TV settings: xc3028_BG_PAL_A2_A.i2c.fw
xc3028-tuner.c: firmware 2.7
ANALOG TV REQUEST
ANALOG TV REQUEST
saa7133[1]: registered device video2 [v4l2]
saa7133[1]: registered device vbi2
saa7133[1]: registered device radio1
ACPI: PCI Interrupt 0000:05:0a.0[A] -> GSI 23 (level, low) -> IRQ 16
saa7133[2]: found at 0000:05:0a.0, rev: 209, irq: 16, latency: 32, mmio: 0xd0401000
saa7133[2]: subsystem: 1461:f636, board: AVerMedia Cardbus TV/Radio (E506R) [card=117,insmod option]
saa7133[2]: board init: gpio is 220000
tuner 5-0061: chip found @ 0xc2 (saa7133[2])
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
tuner 0x61: Configuration acknowledged
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
tuner 0x61: Configuration acknowledged
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
/usr/local/src/v4l-dvb-experimental/v4l/xc3028-tuner.c: attach request!
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: xc3028 tuner successfully loaded
saa7133[2]: i2c eeprom 00: 61 14 36 f6 00 00 00 00 00 00 00 00 00 00 00 00
saa7133[2]: i2c eeprom 10: ff ff ff ff ff 20 ff ff ff ff ff ff ff ff ff ff
saa7133[2]: i2c eeprom 20: 01 40 01 02 02 01 01 03 08 ff 00 0e ff ff ff ff
saa7133[2]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[2]: i2c eeprom 40: ff 65 00 ff c2 1e ff ff ff ff ff ff ff ff ff ff
saa7133[2]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[2]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[2]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[2]: i2c scan: found device @ 0xa0  [eeprom]
saa7133[2]: i2c scan: found device @ 0xc2  [tuner (analog)]
Loading base firmware: xc3028_init0.i2c.fw
Loading default analogue TV settings: xc3028_BG_PAL_A2_A.i2c.fw
xc3028-tuner.c: firmware 2.7
ANALOG TV REQUEST
ANALOG TV REQUEST
saa7133[2]: registered device video3 [v4l2]
saa7133[2]: registered device vbi3
saa7133[2]: registered device radio2
ACPI: PCI Interrupt 0000:05:0b.0[A] -> GSI 20 (level, low) -> IRQ 23
saa7133[3]: found at 0000:05:0b.0, rev: 209, irq: 23, latency: 32, mmio: 0xd0401800
saa7133[3]: subsystem: 1461:f636, board: AVerMedia Cardbus TV/Radio (E506R) [card=117,insmod option]
saa7133[3]: board init: gpio is 220000
tuner 6-0061: chip found @ 0xc2 (saa7133[3])
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
tuner 0x61: Configuration acknowledged
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
tuner 0x61: Configuration acknowledged
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
/usr/local/src/v4l-dvb-experimental/v4l/xc3028-tuner.c: attach request!
/usr/local/src/v4l-dvb-experimental/v4l/tuner-core.c: xc3028 tuner successfully loaded
saa7133[3]: i2c eeprom 00: 61 14 36 f6 00 00 00 00 00 00 00 00 00 00 00 00
saa7133[3]: i2c eeprom 10: ff ff ff ff ff 20 ff ff ff ff ff ff ff ff ff ff
saa7133[3]: i2c eeprom 20: 01 40 01 02 02 01 01 03 08 ff 00 0e ff ff ff ff
saa7133[3]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[3]: i2c eeprom 40: ff 65 00 ff c2 1e ff ff ff ff ff ff ff ff ff ff
saa7133[3]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[3]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[3]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[3]: i2c scan: found device @ 0xa0  [eeprom]
saa7133[3]: i2c scan: found device @ 0xc2  [tuner (analog)]
Loading base firmware: xc3028_init0.i2c.fw
Loading default analogue TV settings: xc3028_BG_PAL_A2_A.i2c.fw
xc3028-tuner.c: firmware 2.7
ANALOG TV REQUEST
ANALOG TV REQUEST
saa7133[3]: registered device video4 [v4l2]
saa7133[3]: registered device vbi4
saa7133[3]: registered device radio3
/usr/local/src/v4l-dvb-experimental/v4l/xc3028-tuner.c: attach request!
DVB: registering new adapter (saa7133[0])
DVB: registering frontend 2 (Zarlink MT352 DVB-T)...
/usr/local/src/v4l-dvb-experimental/v4l/xc3028-tuner.c: attach request!
DVB: registering new adapter (saa7133[1])
DVB: registering frontend 3 (Zarlink MT352 DVB-T)...
md: md0 stopped.
/usr/local/src/v4l-dvb-experimental/v4l/xc3028-tuner.c: attach request!
DVB: registering new adapter (saa7133[2])
DVB: registering frontend 4 (Zarlink MT352 DVB-T)...
/usr/local/src/v4l-dvb-experimental/v4l/xc3028-tuner.c: attach request!
DVB: registering new adapter (saa7133[3])
DVB: registering frontend 5 (Zarlink MT352 DVB-T)...
saa7134 ALSA driver for DMA sound loaded
saa7133[0]/alsa: saa7133[0] at 0xd0400000 irq 24 registered as card -1
saa7133[1]/alsa: saa7133[1] at 0xd0400800 irq 25 registered as card -1
saa7133[2]/alsa: saa7133[2] at 0xd0401000 irq 16 registered as card -1
saa7133[3]/alsa: saa7133[3] at 0xd0401800 irq 23 registered as card -1

[6] /proc/interrupts

$ cat /proc/interrupts
           CPU0       CPU1
  0:        426          0   IO-APIC-edge      timer
  1:          2          0   IO-APIC-edge      i8042
  3:          2          0   IO-APIC-edge
  4:          2          0   IO-APIC-edge
  8:          1          0   IO-APIC-edge      rtc
  9:          1          0   IO-APIC-fasteoi   acpi
 12:          4          0   IO-APIC-edge      i8042
 14:       8849          0   IO-APIC-edge      libata
 15:          0          0   IO-APIC-edge      libata
 16:     111939          0   IO-APIC-fasteoi   ehci_hcd:usb1, saa7133[2], saa7133[2]
 17:       2642          0   IO-APIC-fasteoi   uhci_hcd:usb2
 18:          0          0   IO-APIC-fasteoi   uhci_hcd:usb3
 19:      36654          0   IO-APIC-fasteoi   libata, eth0
 20:     103262          0   IO-APIC-fasteoi   sata_svw
 21:    1180629          0   IO-APIC-fasteoi   wctdm
 22:     533737          0   IO-APIC-fasteoi   Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver
 23:    2251724          0   IO-APIC-fasteoi   saa7146 (0), saa7133[3], saa7133[3]
 24:     139993          0   IO-APIC-fasteoi   saa7133[0], saa7133[0]
 25:     120534          0   IO-APIC-fasteoi   saa7133[1], saa7133[1]
NMI:          0          0   Non-maskable interrupts
LOC:     604214     669645   Local timer interrupts
RES:     201848     565481   Rescheduling interrupts
CAL:        606        632   function call interrupts
TLB:       1530       3491   TLB shootdowns
TRM:          0          0   Thermal event interrupts
SPU:          0          0   Spurious interrupts
ERR:          0
MIS:          0
Document Actions