I am seeing a very peculiar channel swap issue on the OMAP4430. I have provided all the details of the issue. I am really stuck right now and looking for any help/pointers to move forward.
Or Is this an existing issue reported on OMAP4430? If so what was the root cause and how was it resolved?
Issue Summary:
In the stereo 48K recorded audio, the left and right channels are swapped randomly – sometimes at the beginning, sometimes in the middle. This is observed during playback also, when played an audio file that has data only on left channel.
Setup:
Android Gingerbread, L27.G.5 source base. OMAP4430 (I2S Master) talking to an Audience Codec (Slave) through McBSP3. sDMA is used to transfer audio data from/to peripheral to/from OMAP’s memory. Stereo 48K recording. Sample size per channel is 16 bit. A user space linux utility is running that calls a blocking system read call to record audio with a large buffer of size 122880. Once buffer is filled the utility writes the buffer data to a file and calls again Read. Using packet mode of transfer in DMA. McBSP3 thresholds are set at 128 words.DMA chaining is used. Logical channels 2 and 3 are used.
Ruled Out:
Clocks and Frame Sync from OMAP4430 are clean. The polarity of these clocks and frame sync are verified to be as expected. Oscilloscope probes connected to the test points to monitor McBSP3 Clk, FS, Dx and DR lines shows that audience codec sends the data on the correct channels. There is no programming error in calculating offsets within the data buffers that accumulates audio data during record or drains data during playback.
Experiments done:
On MCBSP settings, tried dual phase, 16 bit per phase – same issue. Single phase, 32 bit also has same issue.
Attachments:
SerialConsole.log – Log that has McBSP, DMA settings during record and a subsequent playback.
ve_rec120424094530.pcm – Recorded file
chswap_logs\rec_reg_dump\mcbsp3_reg0.rd – McBSP3 register dump during record
chswap_logs\rec_reg_dump\sdma_reg0.rd – sDMA channels register dump
chswap_logs\rec_reg_dump\omap4430_aud_mcbsp_rec.rd1 – Clock register dump to be given as input for the TI clocktree tool.
chswap_logs\pb_reg_dump\mcbsp3_reg0.rd – McBSP3 register dump during playback
chswap_logs\pb_reg_dump\sdma_reg0.rd – sDMA channels register dump
chswap_logs\pb_reg_dump\omap4430_aud_mcbsp_rec.rd1 – Clock register dump to be given as input for the TI clocktree tool.