Nick Rosier wrote:

Mike,

check the thread "PVR-150MCE Volume Control". It contains a patch by
Bryan that fixes this. Hopefully it will make it in the next release
of the driver.

N.

Ok, I'm new to the list so I'm looking through some archives... (I'm pretty sure I've found the correct patch) Anyways, here is a re-post for anybody who comes by this thread under PVR500 rather than 150.

http://www.opensubscriber.com/message/[email protected]/1880604.html

-Mike

Index: driver/cx25840-audio.c =================================================================== --- driver/cx25840-audio.c (revision 339) +++ driver/cx25840-audio.c (working copy) @@ -273,12 +273,12 @@ * we stop the microcontroller and mute all inputs */ va->flags = VIDEO_AUDIO_TREBLE | VIDEO_AUDIO_BASS; - /* Volume runs +18dB to -96dB, change to -96dB to +0dB */ - va->step = 193; - va->volume = cx25840_read_setting(client, PATH1_VOLUME); - //va->volume = (0xff - va->volume) << 8; - va->volume = (va->volume <= 36) ? 0xffff : - 0xffff - ((va->volume - 36) * 0xffff / va->step); + /* Volume runs +18dB to -96dB in 1/2dB steps + * change to fit the msp3400 -114dB to +12dB range */ + va->step = 228; + va->volume = 228 - cx25840_read_setting(client, PATH1_VOLUME); + va->volume = (va->volume / 2) + 23; + va->volume = va->volume << 9; /* bass is 49 steps +12dB to -12dB */ va->bass = cx25840_read_setting(client, PATH1_EQ_BASS_VOL); va->bass = (((48 - va->bass) * 0xffff) + 47) / 48; @@ -296,8 +296,16 @@ void cx25840_set_v4l_audio(struct i2c_client *client, struct video_audio *va) { - //int volume = 0xff - (va->volume >> 8); - int volume = 229 - (va->volume * 193 / 0xffff); + // First convert the volume to msp3400 values (0-127) + int volume = va->volume >> 9; + // now scale it up to cx25840 values + // -114dB to -96dB maps to 0 + // this should be 19, but in my testing that was 4dB too loud + if (volume <= 23) + volume = 0; + else + volume -= 23; + volume = 228 - (volume * 2); int bass = 48 - (va->bass * 48 / 0xffff); int treble = 48 - (va->treble * 48 / 0xffff); int balance = va->balance >> 8;

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
ivtv-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ivtv-devel

Reply via email to