[linux-dvb] Saa7134 with Avermedia M1155 hybrid card on Ubuntu 8.04

hermann pitton hermann-pitton at arcor.de
Fri Aug 15 01:10:30 CEST 2008


Hi Tim,

Am Freitag, den 15.08.2008, 00:00 +0800 schrieb Tim Farrington:
> Hi John,
> 
> I will try and help.
> 
> Try this and see if you get anywhere.
> 
> First, you need to install these:
> 
> sudo apt-get install build-essential mercurial
> 
> Next, you need to download v4l-dvb from Linuxtv.org into your home 
> directory:
> 
> hg clone http://linuxtv.org/hg/v4l-dvb
> 
> Next, in Ubuntu 8.04, you will have to remove conflicting modules:
> (beware this may affect things such as a webcam)
> 
> cd /lib/modules/`uname -r`/ubuntu
> sudo rm -rf media
> cd
> 
> Next, modify the source code in ~/v4l-dvb
> 
> In ~/v4l-dvb/linux/drivers/media/video/saa7134/saa7134-cards.c
> 
> Find this section:
> 
>     [SAA7134_BOARD_AVERMEDIA_M115] = {
>         .name           = "Avermedia M115",
>         .audio_clock    = 0x187de7,
>         .tuner_type     = TUNER_XC2028,
>         .radio_type     = UNSET,
>         .tuner_addr    = ADDR_UNSET,
>         .radio_addr    = ADDR_UNSET,
> /*add this line*/.mpeg           = SAA7134_MPEG_DVB,
>         .inputs         = {{
>             .name = name_tv,
>             .vmux = 1,
>             .amux = TV,
>             .tv   = 1,
>         }, {
>             .name = name_comp1,
>             .vmux = 3,
>             .amux = LINE1,
>         }, {
>             .name = name_svideo,
>             .vmux = 8,
>             .amux = LINE2,
>         } },
>     },
> 
> Find this section:
> 
> static int saa7134_xc2028_callback(struct saa7134_dev *dev,
>                    int command, int arg)
> {
>     switch (command) {
>     case XC2028_TUNER_RESET:
>         saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00008000, 0x00000000);
>         saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00008000, 0x00008000);
>         switch (dev->board) {
>         case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
>         case SAA7134_BOARD_AVERMEDIA_M103:
>             saa7134_set_gpio(dev, 23, 0);
>             msleep(10);
>             saa7134_set_gpio(dev, 23, 1);
>         break;
>         case SAA7134_BOARD_AVERMEDIA_A16D:
> /*add this line*/case SAA7134_BOARD_AVERMEDIA_M115:
>             saa7134_set_gpio(dev, 21, 0);
>             msleep(10);
>             saa7134_set_gpio(dev, 21, 1);
>         break;
>         }
>     return 0;
>     }
>     return -EINVAL;
> }
> 
> Find this section:
> 
> int saa7134_board_init1(struct saa7134_dev *dev)
> ...
>     case SAA7134_BOARD_AVERMEDIA_CARDBUS:
> /*    case SAA7134_BOARD_AVERMEDIA_M115: */ /*comment this line out*/
> #if 1
>         /* power-down tuner chip */
>         saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0xffffffff, 0);
>         saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0);
> #endif
>         msleep(10);
>         /* power-up tuner chip */
>         saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0xffffffff, 0xffffffff);
>         saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0xffffffff);
>         msleep(10);
>         break;
> 
> Find this section:
> 
>     case SAA7134_BOARD_AVERMEDIA_A16D:
>         saa7134_set_gpio(dev, 21, 0);
>         msleep(10);
>         saa7134_set_gpio(dev, 21, 1);
>         msleep(1);
>         dev->has_remote = SAA7134_REMOTE_GPIO;
>         break;
> 
> Create a new case entry below it:
> 
>     case SAA7134_BOARD_AVERMEDIA_M115:
>         saa7134_set_gpio(dev, 21, 0);
>         msleep(10);
>         saa7134_set_gpio(dev, 21, 1);
>         break;
> 
> Find this section:
> 
>         switch (dev->board) {
>         case SAA7134_BOARD_AVERMEDIA_A16D:
>         case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
>         case SAA7134_BOARD_AVERMEDIA_M103:
> /*add this line*/case SAA7134_BOARD_AVERMEDIA_M115:
>             ctl.demod = XC3028_FE_ZARLINK456;
>             break;
> 
> 
> In ~/v4l-dvb/linux/drivers/media/video/saa7134/saa7134-dvb.c
> 
> Find this section:
> 
>     case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
>         dprintk("AverMedia E506R dvb setup\n");
>         saa7134_set_gpio(dev, 25, 0);
>         msleep(10);
>         saa7134_set_gpio(dev, 25, 1);
>         dev->dvb.frontend = dvb_attach(mt352_attach,
>                         &avermedia_xc3028_mt352_dev,
>                         &dev->i2c_adap);
>         attach_xc3028 = 1;
>         break;
> 
> Create a new case entry below it:
> 
>     case SAA7134_BOARD_AVERMEDIA_M115:
>         saa7134_set_gpio(dev, 25, 0);
>         msleep(10);
>         saa7134_set_gpio(dev, 25, 1);
>         dev->dvb.frontend = dvb_attach(mt352_attach,
>                         &avermedia_xc3028_mt352_dev,
>                         &dev->i2c_adap);
>         attach_xc3028 = 1;
>         break;
> 
> Save these files.
> Next, use make to build the modules:
> 
> cd
> cd v4l-dvb
> make
> sudo make install
> 
> Next, you need to extract and install the firmware:
> 
> In ~/v4l-dvb/linux/Documentation/video4linux/extract_xc3028.pl
> 
> you will find instructions on how to use this file to obtain the firmware.
> 
> Then, copy the firmware to /lib:
> 
> sudo cp xc3028-v27.fw /lib/firmware/`uname -r`
> 
> reboot
> 
> check dmesg.
> 
> See if that gets anywhere.
> 
> Regards,
> Timf
> einfaches Textdokument-Anlage (m115.txt)
> First, you need to install these:
> 
> sudo apt-get install build-essential mercurial
> 
> Next, you need to download v4l-dvb from Linuxtv.org into your home directory:
> 
> hg clone http://linuxtv.org/hg/v4l-dvb
> 
> Next, in Ubuntu 8.04, you will have to remove conflicting modules:
> (beware this may affect things such as a webcam)
> 
> cd /lib/modules/`uname -r`/ubuntu
> sudo rm -rf media
> cd
> 
> Next, modify the source code in ~/v4l-dvb
> 
> In ~/v4l-dvb/linux/drivers/media/video/saa7134/saa7134-cards.c
> 
> Find this section:
> 
> 	[SAA7134_BOARD_AVERMEDIA_M115] = {
> 		.name           = "Avermedia M115",
> 		.audio_clock    = 0x187de7,
> 		.tuner_type     = TUNER_XC2028,
> 		.radio_type     = UNSET,
> 		.tuner_addr	= ADDR_UNSET,
> 		.radio_addr	= ADDR_UNSET,
> /*add this line*/.mpeg           = SAA7134_MPEG_DVB,
> 		.inputs         = {{
> 			.name = name_tv,
> 			.vmux = 1,
> 			.amux = TV,
> 			.tv   = 1,
> 		}, {
> 			.name = name_comp1,
> 			.vmux = 3,
> 			.amux = LINE1,
> 		}, {
> 			.name = name_svideo,
> 			.vmux = 8,
> 			.amux = LINE2,
> 		} },
> 	},
> 
> Find this section:
> 
> static int saa7134_xc2028_callback(struct saa7134_dev *dev,
> 				   int command, int arg)
> {
> 	switch (command) {
> 	case XC2028_TUNER_RESET:
> 		saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00008000, 0x00000000);
> 		saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00008000, 0x00008000);
> 		switch (dev->board) {
> 		case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
> 		case SAA7134_BOARD_AVERMEDIA_M103:
> 			saa7134_set_gpio(dev, 23, 0);
> 			msleep(10);
> 			saa7134_set_gpio(dev, 23, 1);
> 		break;
> 		case SAA7134_BOARD_AVERMEDIA_A16D:
> /*add this line*/case SAA7134_BOARD_AVERMEDIA_M115:
> 			saa7134_set_gpio(dev, 21, 0);
> 			msleep(10);
> 			saa7134_set_gpio(dev, 21, 1);
> 		break;
> 		}
> 	return 0;
> 	}
> 	return -EINVAL;
> }
> 
> Find this section:
> 
> int saa7134_board_init1(struct saa7134_dev *dev)
> ...
> 	case SAA7134_BOARD_AVERMEDIA_CARDBUS:
> /*	case SAA7134_BOARD_AVERMEDIA_M115: */ /*comment this line out*/
> #if 1
> 		/* power-down tuner chip */
> 		saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0xffffffff, 0);
> 		saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0);
> #endif
> 		msleep(10);
> 		/* power-up tuner chip */
> 		saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0xffffffff, 0xffffffff);
> 		saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0xffffffff);
> 		msleep(10);
> 		break;
> 
> Find this section:
> 
> 	case SAA7134_BOARD_AVERMEDIA_A16D:
> 		saa7134_set_gpio(dev, 21, 0);
> 		msleep(10);
> 		saa7134_set_gpio(dev, 21, 1);
> 		msleep(1);
> 		dev->has_remote = SAA7134_REMOTE_GPIO;
> 		break;
> 
> Create a new case entry below it:
> 
> 	case SAA7134_BOARD_AVERMEDIA_M115:
> 		saa7134_set_gpio(dev, 21, 0);
> 		msleep(10);
> 		saa7134_set_gpio(dev, 21, 1);
> 		break;
> 
> Find this section:
> 
> 		switch (dev->board) {
> 		case SAA7134_BOARD_AVERMEDIA_A16D:
> 		case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
> 		case SAA7134_BOARD_AVERMEDIA_M103:
> /*add this line*/case SAA7134_BOARD_AVERMEDIA_M115:
> 			ctl.demod = XC3028_FE_ZARLINK456;
> 			break;
> 
> 
> In ~/v4l-dvb/linux/drivers/media/video/saa7134/saa7134-dvb.c
> 
> Find this section:
> 
> 	case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
> 		dprintk("AverMedia E506R dvb setup\n");
> 		saa7134_set_gpio(dev, 25, 0);
> 		msleep(10);
> 		saa7134_set_gpio(dev, 25, 1);
> 		dev->dvb.frontend = dvb_attach(mt352_attach,
> 						&avermedia_xc3028_mt352_dev,
> 						&dev->i2c_adap);
> 		attach_xc3028 = 1;
> 		break;
> 
> Create a new case entry below it:
> 
> 	case SAA7134_BOARD_AVERMEDIA_M115:
> 		saa7134_set_gpio(dev, 25, 0);
> 		msleep(10);
> 		saa7134_set_gpio(dev, 25, 1);
> 		dev->dvb.frontend = dvb_attach(mt352_attach,
> 						&avermedia_xc3028_mt352_dev,
> 						&dev->i2c_adap);
> 		attach_xc3028 = 1;
> 		break;
> 
> Save these files.
> Next, use make to build the modules:
> 
> cd
> cd v4l-dvb
> make
> sudo make install
> 
> Next, you need to extract and install the firmware:
> 
> In ~/v4l-dvb/linux/Documentation/video4linux/extract_xc3028.pl
> 
> you will find instructions on how to use this file to obtain the firmware.
> 
> Then, copy the firmware to /lib:
> 
> sudo cp xc3028-v27.fw /lib/firmware/`uname -r`
> 
> reboot
> 
> check dmesg.
> 

thanks for helping out.

I'm crawling through my mail backlash and still haven't been on
Australian beaches, but met always very nice people from there on some
fine beaches with great waves on some of the other places.

My doubt here is, the M115 has a digital channel decoder at 0x1e/0x0f in
the eeprom. John's card does not have it.

Nothing is for sure on OEM eeprom stuff, let's see how far we can come
for now. But listing _all_ chips and xtals, yes do unsolder the tuner
shielding if needed :), is still the minimum for a report ;)

Cheers,
Hermann







More information about the linux-dvb mailing list