FS#12860 - iPod 5g line out silent

Attached to Project: Rockbox
Opened by Dave Marsh (sysadmindave) - Monday, 06 May 2013, 20:33 GMT
Last edited by Michael Sevakis (MikeS) - Thursday, 09 May 2013, 23:35 GMT
Task Type Bugs
Category Drivers
Status Closed
Assigned To No-one
Operating System iPod 5G
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I haven't isolated the code change that caused this yet, but in current git builds the dock port line out never has signal, where with the latest stable release (3.13) on the same iPod it works fine. Hardware problems ruled out- works the same on both of my 5G iPods.

I'll add detail if I find the exact problem, but wanted to get it reported just in case someone knows the cause immediately. I did see that there are a number of wm8758 changes recently, so that probably needs a closer look.
This task depends upon

Closed by  Michael Sevakis (MikeS)
Thursday, 09 May 2013, 23:35 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed, b210a3a
Comment by AndyP (AndyP) - Wednesday, 08 May 2013, 11:37 GMT
git snapshot build fd9e2568908f91b5bcf7378dc28f6ec070d6027a dated 2013-04-14 17:04 works fine for line-out on my 5.5G ipod
git snapshot build e61e9c61d0ba6990576d59efca07afa13fd97566 dated 2013-04-23 01:38 does not. This appears to be the last of the sound changes. I'll also try to find out where it broke.
Comment by Dave Marsh (sysadmindave) - Wednesday, 08 May 2013, 21:28 GMT
Looks like the sound changes are definitely what broke it- I did a git bisect on the range you gave, and the last working build for iPod line-out is the commit just prior to the 0c7b7873984e04941c9f21fa272638018fdb9a16 sound changes, so that's fd9e2568908f91b5bcf7378dc28f6ec070d6027a, the working revision that you stated.
Hard to be completely sure with the bisect, as several of the in-between cleanup commits won't build properly, but it certainly points the finger at the sound changes in 0c7b787...
Comment by Dave Marsh (sysadmindave) - Wednesday, 08 May 2013, 23:38 GMT
Found it! It looks like in the changes to sound.c and surrounding code, conversion from dB to hardware volume was forgotten for the lineout volume setting, so that when the volume was set to 0 dB in sound.c, it muted the lineout.


diff --git a/firmware/drivers/audio/wm8758.c b/firmware/drivers/audio/wm8758.c
index f7d7a5b..93ea7c2 100644
--- a/firmware/drivers/audio/wm8758.c
+++ b/firmware/drivers/audio/wm8758.c
@@ -157,6 +157,10 @@ void audiohw_set_volume(int vol_l, int vol_r)
void audiohw_set_lineout_volume(int vol_l, int vol_r)
int dac_l, amp_l, dac_r, amp_r;
+ vol_l = vol_tenthdb2hw(vol_l);
+ vol_r = vol_tenthdb2hw(vol_r);
get_volume_params(vol_l, &dac_l, &amp_l);
get_volume_params(vol_r, &dac_r, &amp_r);

Comment by Michael Sevakis (MikeS) - Thursday, 09 May 2013, 19:16 GMT
Hmmm...another one of those overlooked bits. Argh. It all started as such a mess so not too surprising. I'll give it all another review and probably commit this change.
Comment by Michael Sevakis (MikeS) - Thursday, 09 May 2013, 19:41 GMT
Pushed to b210a3a. Please double check so may close. :)
Comment by Dave Marsh (sysadmindave) - Thursday, 09 May 2013, 20:19 GMT
Confirmed, b210a3a works for me.
Comment by AndyP (AndyP) - Thursday, 09 May 2013, 20:44 GMT
Confirmed, also works for me