Search:  
Gentoo Wiki

HARDWARE_avertv_cardbus

PC Card

Contents

Abstract

Here I'm trying to make the AVerMedia AVerTV Cardbus Hybrid DVB-T/Analog TV/FM Radio (E506) work with gentoo linux.

My main goal is to get Analog TV to work, because DVB-T is net yet available where I live.

Wiki Formating and eye Candy will be added when bigger steps are made or I have time to kill.

Base System

Software and Devices I worked with.


AVerMedia AVerTV Cardbus TV/Radio Hybrid

Components:

   * Philips SAA7135HL PCI Audio/Video Broadcast Decoder
   * Xceive XC3028 Silicon Tuner
   * Zarlink MT352 Digital Terrestrial TV Demodulator 


Dmesg output out of the Box:

pccard: CardBus card inserted into slot 1
Linux video capture interface: v2.00
saa7130/34: v4l2 driver version 0.2.14 loaded
PCI: Enabling device 0000:04:00.0 (0000 -> 0002)
ACPI: PCI Interrupt 0000:04:00.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11
saa7133[0]: found at 0000:04:00.0, rev: 209, irq: 11, latency: 0, mmio: 0x60000000
PCI: Setting latency timer of device 0000:04:00.0 to 64
saa7133[0]: subsystem: 1461:f436, board: UNKNOWN/GENERIC [card=0,autodetected]
saa7133[0]: board init: gpio is 220000
saa7133[0]: i2c eeprom 00: 61 14 36 f4 00 00 00 00 00 00 00 00 00 00 00 00
saa7133[0]: i2c eeprom 10: 00 ff e2 0e 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 ff 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


Hardware

Samsung P35 XVM (Notebook)

2 GHZ Intel Pentium Mobile (Centrino)

1024 MB Ram

ATI 9700 Mobilty 64 MB (M10)

80 GB Seagate Momentus


Software

2.6.21 Kernel (sys-kernel/gentoo-sources-2.6.21)

ATI fglrx driver 8.35.5 (x11-drivers/ati-drivers-8.35.5)

OpenSoure Ati Driver

Xorg 7.2 and XFCE 4.4

tvtime (media-tv/tvtime-1.0.2-r1)

Making it work

The described steps are my diary of what I did. Expect changes here as I wander on.


Disabling Video for Linux (vl4) and DVB Support in Kernel

Linux Kernel Configuration: Kernel
Device Drivers --> 
  Multimedia Devices -->
  [ ] Video for Linux
    Digital Video Broadcasting Devices --->
    [ ] DVB for Linux

Recompile your Kernel afterwards


Obtaining Experimental Drivers

You need mercurial to get your drivers:

emerge mercurial

Create a directory for your drivers and download them. What I did:

cd /usr/src
mkdir linux tv
cd linuxtv
hg clone http://mcentral.de/hg/~mrec/v4l-dvb-experimental

Now you should have the latest experimental tree. You need to compile and install it.

cd v4l-dvb-experimental
make
make install

I haven't found out for sure but I think you have to re-install the drivers every time you recompile your kernel.

Warning:

I just recompiled my Kernel and I had to make clean && make && make install the experimental drivers again.

"make install" is enough every time you recompile your kernel.. you don't need to recompile the experimental drivers -- Inventore1

Instead of all these steps you can simply set

V4l_DVB_HG_REPO_URI="http://mcentral.de/hg/~mrec/v4l-dvb-experimental"

in your make.conf and do

emerge v4l-dvb-hg

Reboot

Reboot your system, plug your Card in and the following Dmesg output should be seen:

pccard: CardBus card inserted into slot 1
Linux video capture interface: v2.00
saa7130/34: v4l2 driver version 0.2.14 loaded
PCI: Enabling device 0000:04:00.0 (0000 -> 0002)
ACPI: PCI Interrupt 0000:04:00.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11
saa7133[0]: found at 0000:04:00.0, rev: 209, irq: 11, latency: 0, mmio: 0x60000000
PCI: Setting latency timer of device 0000:04:00.0 to 64
saa7133[0]: subsystem: 1461:f436, board: AVerMedia Cardbus TV/Radio (E506R) [card=117,autodetected]
saa7133[0]: board init: gpio is 220000
saa7133[0]: i2c eeprom 00: 61 14 36 f4 00 00 00 00 00 00 00 00 00 00 00 00
saa7133[0]: i2c eeprom 10: 00 ff e2 0e 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 ff 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
tuner 1-0061: chip found @ 0xc2 (saa7133[0])
/usr/src/linuxtv/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
tuner 0x61: Configuration acknowledged
/usr/src/linuxtv/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
tuner 0x61: Configuration acknowledged
/usr/src/linuxtv/v4l-dvb-experimental/v4l/tuner-core.c: setting tuner callback
/usr/src/linuxtv/v4l-dvb-experimental/v4l/xc3028-tuner.c: attach request!
/usr/src/linuxtv/v4l-dvb-experimental/v4l/tuner-core.c: xc3028 tuner successfully loaded
saa7133[0]: registered device video0 [v4l2]
saa7133[0]: registered device vbi0
saa7133[0]: registered device radio0
mt352_read_register: readreg error (reg=127, ret==-5)
saa7133[0]/dvb: frontend initialization failed

That's nice so far. You noticed that DVB is not working yet with this driver!

You could start your favorite TV Applcation right now and try to tune in but you will discover that you are missing sufficient firmware! Dmesg output after starting tvtime:

Loading base firmware: xc3028_init0.i2c.fw
xc3028-tuner.c: Unable to load firmware
xc3028-tuner.c: ** PLEASE HAVE A LOOK AT **
xc3028-tuner.c: http://linuxtv.org/v4lwiki/index.php/Talk:Em2880#Firmware
ANALOG TV REQUEST
Loading base firmware: xc3028_init0.i2c.fw
xc3028-tuner.c: Unable to load firmware
xc3028-tuner.c: ** PLEASE HAVE A LOOK AT **
xc3028-tuner.c: http://linuxtv.org/v4lwiki/index.php/Talk:Em2880#Firmware
xc3028-tuner: no firmware uploaded (tuning not possible)


Obtaining Firmware for the XE3028 Tuner

At this point I don't actually know what I am doing because I don't know which firmware to use. You can get four firmware archives here

http://konstantin.filtschew.de/v4l-firmware/

I took the first one, and untared it into /lib/firmware

tar -xzf firmware.tgz -C /lib/firmware

Well the firmware is loaded correctly as soon as you start your TV Applcation. Here my Dmesg:

Loading base firmware: xc3028_init0.i2c.fw
switching to television!
upload_firmware, Loading specific analogue TV settings: xc3028_BG_PAL_A2_A.i2c.fw
xc3028-tuner.c: firmware 0.0 loaded
ANALOG TV REQUEST
xc3028_tuner_set_params, Loading specific configuration for requested mode xc3028_BG_PAL_A2_A.i2c.fw
Note:

Some newsgroup guy told some other newsgroup guy to use firmware_v3.tgz. Right now I'm testing it.


Sound (does not work yet)

According to Forums/rumors ect all you have to do is load the saa7134_alsa module

modprobe saa7134_alsa

Dmesg:

saa7134 ALSA driver for DMA sound loaded
saa7133[0]/alsa: saa7133[0] at 0x60000000 irq 11 registered as card -1

I failed to make this work. I have no sound!

I just saw a /dev/dsp1 device being created. But no sound from it!

arecord -l 

lists the device as card 1

just did

alsamixer -c 1 -V all

to select the Saa7134 Mixer chip and boosted volume to max. Still no sound!

got it:

sox -r 32000 -w -t alsa hw:1,0 -t alsa hw:0,0

does it.. will write howto soon

Note:

The problem is that the sound gets to ALSA device, but nobody forwards it to the sound card. Just use mplayer -tv alsa:... to get the sound working.

FIXME: Add the real command line

Watching TV

Sounds easy, but Linux seams to deny me watching Football in my garden =) First of all you need to tune in on your analog Channels. I did this using tvtime-scanner.

You need to configure your tvtime first in order to get your standards right. (If your are very lucky you can do this settings in tvtime itself and everything works out of the box)

tvtime-configure --frequencies=europe --norm=PAL

Beginn scanning for Signals (now you see if your card works or not)

tvtime-scanner 

This creates a channel file.

Use tvtime to have a good TV time (without sound) =)

Composite Input

Just tested Composite Input using my Xbox as source. Video works but still no sound! It seams the saa7134_alsa driver is responsible.

Bad things

ATI FGLRX Drivers

FGLRX does not support XVideo. Xserver just crashed if you start for example tvtime. Use opensource drivers instead.

Scanning does not find channels

After doing what I have written down in my own guide, scanning for channels with tvtime-scanner does not find any signals to tune into. Basically I redid everything to get rid of the

yv4l2_common: exports duplicate symbol v4l2_norm_to_name (owned by kernel)
videodev: exports duplicate symbol video_register_device (owned by kernel)
compat_ioctl32: exports duplicate symbol v4l_compat_ioctl32 (owned by kernel)


errors. As soon as you have Video for linux Kernel Options set you recieve this errors. Channel scanning and TV reception worked never the less.

I will look into this now!

Getting the card to work with kernel 2.6.26+

The analog part works with kernel 2.6.26 flawlessly, but it has a bug in DVB initialization code, so you need to patch the kernel (or use recent 2.6.27 release candidates).

Patching the kernel

The kernel 2.6.26 has a bug that causes the DVB part of the card to fail the initialization. The bug is removed in the recent release candidates of 2.6.27.


File: avermedia-e506r.patch
diff -ur a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
--- a/drivers/media/video/saa7134/saa7134-dvb.c	2008-07-13 23:51:29.000000000 +0200
+++ b/drivers/media/video/saa7134/saa7134-dvb.c	2008-08-07 20:49:47.000000000 +0200
@@ -1263,6 +1263,7 @@
 						&avermedia_xc3028_mt352_dev,
 						&dev->i2c_adap);
 		attach_xc3028 = 1;
+        break;
 	case SAA7134_BOARD_MD7134_BRIDGE_2:
 		dev->dvb.frontend = dvb_attach(tda10086_attach,
 						&sd1878_4m, &dev->i2c_adap);

Save the file into avermedia-e506r.patch into your kernel dir and apply the patch by running patch -p1 < avermedia-e506r.patch.

Configuring the kernel

Enable the SAA7134 card including the DVB in the kernel.

FIXME: Add current kernel settings

Downloading the firmware

The kernel contains a script to download a firmware for XC3028 in Documentation/video4linux/extract_xc3028.pl. To download the firmware you need to do those steps (extracted from the script):

  1. Download the windows driver with something like:
    wget http://www.steventoth.net/linux/xc5000/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip
  2. Extract the file hcw85bda.sys from the zip into the current dir:
    unzip -j HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip Driver85/hcw85bda.sys
  3. Run the script:
    perl extract_xc3028.pl
  4. Copy the generated file:
    cp xc3028-v27.fw /lib/firmware

Reboot and enjoy

Reboot and you should be able to enjoy your DVB card. You should see /dev/dvb/ structure. To get the DVB up and running (with applications) is not trivial, you will probably find some tutorials using:

See also

Mcentral

http://mcentral.de/wiki/index.php/Main_Page

Retrieved from "http://www.gentoo-wiki.info/HARDWARE_avertv_cardbus"

Last modified: Sat, 30 Aug 2008 22:00:00 +0000 Hits: 8,871