FS#8602 - Remove audiohw_set_lineout_vol call from sound.c

Attached to Project: Rockbox
Opened by Christian Gmeiner (ChristianGmeiner) - Tuesday, 12 February 2008, 18:12 GMT
Task Type Patches
Category Drivers
Status Unconfirmed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Hi all.

I have found a funny thing, which should get fixed. In set_prescaled_volume there is this call:
audiohw_set_lineout_vol(tenthdb2master(0), tenthdb2master(0));

As far as I can see this call is not needed here. So this patch removes it, but as I own only a sansa e280 I can not test this change. I hope to commit this soon.

If this call is needed... do we need it every time audio changes or only once at init?

This task depends upon

Comment by Thom Johansen (preglow) - Tuesday, 12 February 2008, 20:15 GMT
This call sets the line out volume to 0 dB always, which is how line outs usually works. It doesn't need to be set in every set_prescaled_volume(), but it should be set some time during init, at least.
Comment by Christian Gmeiner (ChristianGmeiner) - Tuesday, 12 February 2008, 20:55 GMT
Okay.. this is my second try.
I make now use of audiohw_postinit to set lineout volume. Maybe we should check datasheet if we
need to set linout volume - maybe default value is okay?
Comment by Robert Kukla (roolku) - Tuesday, 12 February 2008, 22:59 GMT
Since you now call audiohw_set_lineout_vol() from the audio codec specific files you could work out the values and registers and set them directly
Comment by Thom Johansen (preglow) - Wednesday, 13 February 2008, 11:09 GMT
The closest corresponding datasheet to wm8758 indicates 0 dB is the default, but I can't be bothered to check the others. Since these data sheets aren't exact matches, we'd need to verify with owners of the devices what the actual defaults are anyway.
Comment by Christian Gmeiner (ChristianGmeiner) - Wednesday, 13 February 2008, 12:02 GMT
I did a quick internet research and found this:

- wm8751 - --> 0db default -> see page 26
for wm8975 and wm8758 I found no datasheet. But I think that they have all 0db as default.