Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Possible bug(s) in av7110.c:SetVolume



Hi,

I am using vdr-1.1.20 with DVB drivers from CVS (some days old).

If I am changing the sound volume in vdr, I get the following error in 
syslog:

Dec 30 07:31:03 eddie vdr[1650]: ERROR (dvbdevice.c,660): Operation not 
permitted

The volume setting is working.

I tracked that down to the function SetVolume in av7110.c which I show 
below for illustration.
I've inserted some printks to see what's going on.

static int
SetVolume(av7110_t *av7110, int volleft, int volright)
{
        int err=0;
        int chleft, chright;
        
        switch (av7110->adac_type) {
        case DVB_ADAC_TI:
          printk ("av7110: SetVolume DVB_ADAC_TI l=%d r=%d\n", volleft, 
volright);
                chleft=(volleft*256)/946;
                chright=(volright*256)/946;
                if (chleft > 0x45)
                        chleft=0x45;
                if (chright > 0x45)
                        chright=0x45;
                err=SendDAC(av7110, 3, 0x80 + chleft);
                if (err)
                        return err;
                err=SendDAC(av7110, 4, chright);
                break;
                
        case DVB_ADAC_CRYSTAL:
          printk ("av7110: SetVolume DVB_ADAC_CRYSTAL l=%d r=%d\n", 
volleft, volright);
                chleft=127-volleft/2;
                chright=127-volright/2;
                i2c_writereg(av7110, 0x20, 0x03, chleft);
                i2c_writereg(av7110, 0x20, 0x04, chright);

        default:
                err = -1;
        }

        if(!err) {
                av7110->audiostate.mixer_state.volume_left = volleft;
                av7110->audiostate.mixer_state.volume_right = volright;
        }
        printk ("av7110: SetVolume err=%d\n", err); 
        return err;
}

What I see in the syslog when I do a make insmod is:

Dec 30 07:53:04 eddie kernel: Linux video capture interface: v1.00
Dec 30 07:53:04 eddie kernel: DVB: registering new adapter 
(Technotrend/Hauppauge PCI rev2.1 or 2.2).
Dec 30 07:53:04 eddie kernel: DVB: registering frontend 0:0 (stv0299 
based (e.g. Alps BSRU6 or LG TDQB-S00x))...
Dec 30 07:53:08 eddie kernel: DVB: AV7111(0) - firm f0240009, rtsl 
b0250018, vid 71010068, app 00012502
Dec 30 07:53:08 eddie kernel: av7110: SetVolume DVB_ADAC_TI l=255 r=255
Dec 30 07:53:08 eddie kernel: av7110: SetVolume err=0

When I start vdr I get:
Dec 30 07:54:35 eddie vdr[2056]: switching to channel 1
Dec 30 07:54:35 eddie kernel: av7110: SetVolume DVB_ADAC_CRYSTAL l=220 
r=220
Dec 30 07:54:35 eddie kernel: av7110: SetVolume err=-1
Dec 30 07:54:35 eddie vdr[2056]: ERROR (dvbdevice.c,660): Operation not 
permitted

Question 1: Why is av7110->adac_type == DVB_ADAC_TI on startup, and == 
DVB_ADAC_CRYSTAL later? I have not tracked that down but will try it 
later.

Question 2: Is it OK that the case DVB_ADAC_CRYSTAL falls through to the 
default case and therefore always returns err=-1? Or is it simply a 
missing break statement?

Wolfgang



 




-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index