Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: Volume bug for DVB_ADAC_CRYSTAL.
Hi,
Are Årseth wrote:
> For driver version 0.9.4 in driver/dvb.c in the function SetVolume() the
> following code didn't work for me:
>
> case DVB_ADAC_CRYSTAL:
> volleft=127-((volleft*100)/255);
> volright=127-((volright*100)/255);
> i2c_writereg(dvb, 0x20, 0x03, volleft);
> i2c_writereg(dvb, 0x20, 0x04, volright);
> return 0;
>
> The result is that the volume out form the tv card is very low. The reason is
> obvious since volleft/right never can reach 0. The correct way to scale
> volleft/right must be like this:
>
> case DVB_ADAC_CRYSTAL:
> volleft=127-((volleft*127)/255);
> volright=127-((volright*127)/255);
> i2c_writereg(dvb, 0x20, 0x03, volleft);
> i2c_writereg(dvb, 0x20, 0x04, volright);
> return 0;
please use the NEWSTRUCT branch, there these issues are fixed.
> But the values 64->127 gives almost Zero volume so the volume slider in VDR
> gets very sensitive. A better scaling is then:
>
> case DVB_ADAC_CRYSTAL:
> volleft=64-((volleft*64)/255);
> volright=64-((volright*64)/255);
> i2c_writereg(dvb, 0x20, 0x03, volleft);
> i2c_writereg(dvb, 0x20, 0x04, volright);
> return 0;
>
> Which works very well for me :)
this problem is caused because the volume level for the ADAC is in
linear scale while your ear feels sound pressures in a logarithmic
scale. it's ap to the application to apply this mapping before
submitting the ioctl. You can implement this using a simple lookup-table
with 256 entries.
Holger
--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.
Home |
Main Index |
Thread Index