AverMedia AverTV Cardbus Hybrid E506R

From Gentoo-en
Jump to: navigation, search
Stock post message.png To-do list for AverMedia AverTV Cardbus Hybrid E506R:
  • Add some card picture
  • Add generic DVB-T configuration page, place here a link

Introduction

The AverMedia AVerTV Cardbus Hybrid supports analog TV, DVB-T and FM radio. It has following inputs:

  • 75 Ohm (UHF/VHF) TV Antenna Input
  • Composite Video
  • S-Video
  • Stereo Audio L/R
  • FM (RF Radio Antenna Input)

Requirements

  • 2.6.26 or newer kernel (2.6.30+ recommended)
  • XC3028 firmware

What works

  • Analog TV
  • Digital TV
  • S-Video input
  • Composite input
  • FM Radio
  • Remote control

Linux Kernel

Note: The author recommends the latest kernel. Since 2.6.30 there is no need to apply any patch.

There are known problems with 2.6.26 (DVB-T initialization fails) and 2.6.28 (OOPS during initialization) kernels that causes the card initialization to fail. Kernel 2.6.27 works flawlessly, 2.6.29 is untested by the author.

Patching the kernel for the card

If you have 2.6.26 or 2.6.28, you need to apply corresponding patch first:

File: avermedia-e506r-2.6.26.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);

File: avermedia-e506r-2.6.28.patch
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c	Mon Oct 13 09:37:06 2008 -0200
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c	Fri Nov 14 01:03:00 2008 +0000
@@ -6151,7 +6151,7 @@
 		struct v4l2_priv_tun_config  xc2028_cfg;
 		struct xc2028_ctrl           ctl;
 
-		memset(&xc2028_cfg, 0, sizeof(ctl));
+		memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
 		memset(&ctl, 0, sizeof(ctl));
 
 		ctl.fname   = XC2028_DEFAULT_FIRMWARE;
Choose the file you need, save it into avermedia-e506r.patch to your kernel directory and apply the patch by running:
patch -p1 < avermedia-e506r.patch

Patching the kernel for remote control

Note: If you have 2.6.30+ kernel, you don't need to patch the kernel.

The patch has been submitted to linux-dvb mailing list already, you can try it yourself now. It was tested with 2.6.28 kernel and is part of the upcoming kernel 2.6.30.

Download the file Avermedia-cardbus-remote-control.patch, store it into your kernel directory and apply the patch by running:
patch -p2 < Avermedia-cardbus-remote-control.patch

With this patch you should have corresponding /dev/input/event? created, you can use it for example with LIRC.

Kernel configuration

Enable the SAA7134 card including the DVB in the kernel.

Linux Kernel Configuration: Kernel config
Multimedia devices  --->
         *** Multimedia core support ***
     <*> Video For Linux
     <*> DVB for Linux

         *** Multimedia drivers ***
     [*] Load and attach frontend and tuner driver modules as needed
     [ ] Customize analog and hybrid tuner modules to build  --->
     [*] Video capture adapters  --->
     [ ] DVB/ATSC adapters  --->

Video capture adapters  --->
     [*] Autoselect pertinent encoders/decoders and other helper chips
     <M>   Philips SAA7134 support
     <M>     Philips SAA7134 DMA audio support
     <M>     DVB/ATSC Support for saa7134 based TV cards

If you want modules outside the kernel, choose SAA7134 as module. See #In-kernel firmware if you want complete in-kernel support, you can select to compile SAA7134 inside the kernel afterwards.

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:
  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 into /lib/firmware:
    cp xc3028-v27.fw /lib/firmware

Finishing the job

After the job is done (kernel is built, Lilo/Grub is updated, system reboot is done), you should be able to fully enjoy your DVB card, you should be able to see /dev/dvb/* structure.

Tips and tricks

In-kernel firmware

There exists support for external firmware linked directly into kernel since version 2.6.27.

Linux Kernel Configuration: In-kernel firmware
Generic Driver Options  --->
     -*- Userspace firmware loading support
     [*]   Include in-kernel firmware blobs in kernel binary
     (xc3028-v27.fw) External firmware blobs to build into the kernel binary
     (/lib/firmware) Firmware blobs root directory

You have an option to specify the firmware root directory and the space-separated list of firmware files. The shown configuration above causes the kernel to contain /lib/firmware/xc3028-v27.fw firmware.

Now you can optionally select to compile SAA7134 inside the kernel:

Linux Kernel Configuration: Modules inside the kernel
Video capture adapters  --->
     [*] Autoselect pertinent encoders/decoders and other helper chips
     <*>   Philips SAA7134 support
     <*>     Philips SAA7134 DMA audio support
     <*>     DVB/ATSC Support for saa7134 based TV cards

Double-initialization problems

If you see the following message in /var/log/messages, you have double-initialization problem.

File: /var/log/messages: Double initialization symptom
firmware: requesting xc3028-v27.fw
sysfs: duplicate filename 'i2c-1' can not be created
Linux Kernel Configuration: Cause of the problem
I2C support  --->
     <*>   I2C device interface

The firmware loading path initializes the device while the device is already being initialized. There are two workarounds:

  • Use in-kernel firmware. This doesn't cause the device to initialize while loading the firmware.
  • Disable I2C device interface. This prevents early creation of i2c device.

DVB-T applications

To get the DVB up and running (with applications) is not trivial, you will probably find some tutorials using:

  • media-tv/linuxtv-dvb-apps, provides frequency table list in /usr/share/dvb and dvbscan tool.
  • media-tv/w_scan if you don't have a frequency table for your location - the tool will create one table for you. If you are interrested in the channel to frequency mapping, you can find it at this page, but to fill the frequency table correctly you need more information than the frequency.
  • dvbscan tool from media-tv/linuxtv-dvb-apps to scan for TV programs, you can use it as soon as you have proper frequency table.

Some clever applications don't need frequency table and are able to scan the channels for you:

Controlling the remote control

You need to apply the patch from #Patching the kernel for remote control first, you can follow the article LIRC to get the remote control working afterwards.