Bug 12853 - Channels swapped with r6556
: Channels swapped with r6556
Status: RESOLVED FIXED
Product: SB Radio
Classification: Unclassified
Component: Audio
: Include FW version in comment
: PC Windows XP
: P1 normal (vote)
: MP
Assigned To: Richard Titmuss
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-14 13:18 UTC by Spies Steven
Modified: 2009-09-08 09:15 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments
16-bit I2S mode? (51.88 KB, image/png)
2009-07-21 13:46 UTC, Caleb Crome
Details
16 bit clocks per LR clock. (51.21 KB, image/png)
2009-07-21 13:49 UTC, Caleb Crome
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Spies Steven 2009-07-14 13:18:40 UTC
The channels appear to be swapped with r6556.  As a result the custom mp3 file with filters applied for the in store demo will be channel swapped to compensate so that the high pass content will be on the right channel and the low pass content will be on the left.  Hopefully the swap is consistent and does not swap back over time.
Comment 1 Caleb Crome 2009-07-16 14:13:18 UTC
Richard, steven noticed that the channels seem to be swapped from what is expected.

From the schematics and wire harness, we expect the tweeter to be on the left channel, woofer on the right.  But when we play sounds, it appears that the opposite is true.

Do you have any comments/thoughts on that?
Comment 2 Richard Titmuss 2009-07-20 12:08:18 UTC
Discussed with Caleb, he is going to check the i2s bus.
Comment 3 Caleb Crome 2009-07-20 19:18:52 UTC
Shoot, I tried looking at this, but its mixed to mono for some reason when I use aplay.

The last line of /etc/asound.conf is commented out, so it doesn't seem the be the babydsp plugin mixing to mono.

Can you reconfigure so that babydsp is always being used, then I can put in a non-mono version when testing?
Comment 4 Richard Titmuss 2009-07-21 11:39:51 UTC
The /etc/asound.conf file controls if babydsp is used, and that should be the only place making it mono. You sure it wasn't enabled? If all lines are uncommented then the filter is used by aplay and squeezeplay.
Comment 5 Caleb Crome 2009-07-21 13:46:18 UTC
Oops, I think I was playing an mp3, which didn't work so good with aplay.

Anyway, I see that there are only 16 bit-clock periods per LR clock phase,
whereas i thought it should be 32.

And data seems to get 'left-over' in the other phase.  See attachment.  
Clearly, this doesn't seem right.  Don't know how we got this far with the
format so far off.

The data is from a sine wave that is playing only in the left channel.
Comment 6 Caleb Crome 2009-07-21 13:46:43 UTC
Created attachment 5498 [details]
16-bit I2S mode?
Comment 7 Caleb Crome 2009-07-21 13:49:59 UTC
Created attachment 5499 [details]
16 bit clocks per LR clock.
Comment 8 Richard Titmuss 2009-07-21 16:11:26 UTC
That might be aplay, it'll open the device with a different format than squeezeplay. That would explain the 16 bits. Can you do the same test using squeezeplay as the source?
Comment 9 Caleb Crome 2009-07-22 17:32:38 UTC
Richard, I found a couple of things:

tlv320aic3104 line 1212 does actually set the # of bits going over the i2s bus.  I don't know if that's strictly necessary, but I'm not sure it hutrs.

In order to test the LR swap, I'm using the babydsp plugin (damn that's going to be useful!), to set 
   *dst[0] = 0;
   *dst[1] = 0xAAAAAAAA;

When doing this, I get the signal in the LOW part (left) of the I2S signal.

I believe this is reversed from what is typically expected.  generally audio goes LRLR not RLRLR.
Comment 10 Caleb Crome 2009-07-22 17:33:59 UTC
Also,tlv320aic3104 changes the # of clocks/LRclock (line 1212).  I don't know if this is a problem or not.  I think it could be left a 32 clocks/LRCLK without problem.

-Caleb
Comment 11 Richard Titmuss 2009-07-23 08:13:19 UTC
I think we need to ask Freescale about this.
Comment 12 Richard Titmuss 2009-07-28 04:06:37 UTC
Sammy as freescale commented:

  Our driver always sends data in left channel first. 

  There is STCR register in SSI to control invert of frame sync. I just
  went through the patch gotten from Richard(it is old and I don't know
  whether it is updated now). 
  SND_SOC_DAIFMT_NB_IF format was set, I think you should try
  SND_SOC_DAIFMT_NB_NF for normal I2S mode.

Fixed in r6808 in fab4 branch (not baby-mp).