This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

The left and right audio channels are exchanged!!

Other Parts Discussed in Thread: OMAP-L137

Dear Sir,

We have a serious problem with OMAP-L137. After the Linux is booted, we run  the following command

arecord -d 20 -D 'hw:0,0' -r 96000 -f S32_LE -c 2 | aplay -D 'hw:0,0' -c 2

and feed the left channel by a sinusoid wave and the right channel has no signal, and see the output channels on a scope. One wonderful event happens. After a while the left and right channels are exchanged!!!! In the other words, the right output channel has a sinusoid signal and the left output channel has no signal. We saw the I2S and WCLK. They are correct. In other words, The audio codec does not exchange the channels. The input of the audio codec that comes from ARM is exchanged. In the other test, we decreased the sampling rate to 48000 and run the command for long time. The channels did not exchange. It seems the problem is when the sampling rate is set to 88200 or 96000. However, we want to work in 96000 Hz. Someone in the Audio Converters Forum said that it may be from DMA and the ARM makes mistake. We think so. What should we do?

Our LSP version: 02.20.00.07 GA. (The last one)

Jack,

 

  • Hi Jack,

    Thanks for your post.

    In my understanding, if you exchange the right & left output channels, you should validate the codec registers accordingly in the code, because by default, left channel would have been configured. In this context, if you try to exchange left & right output channels, appropriately, left & right output channel codec registers needs to be changed. For this, you need to refer the audio codec datasheet which you are using, and try find out the appropriate codec registers for left & right output audio channels.

    Hence, by the above reason, till the input of the audio codec from ARM are getting exchanged and not the actual audio codec exchanges the channels. To confirm this, you could also probe the left and right ouput channels after the data comes out from the audio codec and you will not see the desired ouput. Also, validate the minimum & maximum sampling to be used for the particular audio codec from the datasheet to narrow down whether it is audio codec register configuration issue or sampling rate issue.

    Please debug the code step by step on the codec register configuration on left & right output channels and try validate the values as compliant to the codec datasheet. When you swap the channels, you need to configure the codec registers in the way that, left channel should act as right and right channel should act as left as well appropriately the left and right channel register values needs to be validated.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

     

  • This happens because the ARM has not enough time to read and write from/into the ALSA library.

    Jack

  • Hey Jack,

    Thanks for your update and It would help others.