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

Tim Farrington timf at iinet.net.au
Thu Aug 14 18:00:29 CEST 2008


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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: m115.txt
Url: http://www.linuxtv.org/pipermail/linux-dvb/attachments/20080815/0844c34f/attachment-0001.txt 


More information about the linux-dvb mailing list