i.mx28 audio works unexpected. Audio data can not be sent to I2S's FIFOs from DMA module.

cancel
Showing results for 
Search instead for 
Did you mean: 

i.mx28 audio works unexpected. Audio data can not be sent to I2S's FIFOs from DMA module.

Jump to solution
2,063 Views
F_D_
Contributor I

Hi.I've got a problem with playing audio in i.mx28 EVK.Would anyone help me?Thanks.

Details showed follow:

Issue Details

Reproducibility:Sometimes
Steps to Reproduce:

Loop to playback a small sound file(such as a WAV with 3 seconds).For example,execute shell script bellow:

#!/bin/sh

while :

do

echo "aplay again..."

aplay test.wav  #play a small audio file which hold  3 seconds.

done

Expected Result:The audio should work without trouble forever.
Observed Result:After repeat-playing for some times(maybe several hours or more),the "aplay" would be blocked.Then,neither re-executing "aplay" nor reloading audio-related drivers(alsa driver,sgtl5000,DAI,DMA,and so on.. ) can solve this problem until reboot the system.
Subject:i.mx28 audio works unexpected. Audio data can not be sent to I2S's FIFOs from DMA module.
Description:We have approved that: the problem takes because of data in DMA module can not be sent to I2S's FIFOs(Note that,we wrote audio data directly to HW_SAIF_DATA after problem appeared,the audio data was sent to sgtl5000 immediately ).When problem appeared,we record the registers value as follow:
HW_APBX_CTRL1 = 0x00500000
HW_APBX_CTRL2 = 0x0
HW_APBX_CH4_CURCMDAR = 0x40c0a3c0
HW_APBX_CH4_NXTCMDAR = 0x40c0a360
HW_APBX_CH4_CMD = 0x2000000e
HW_APBX_CH4_BAR = 0x40c20020
HW_APBX_CH4_SEMA = 0x00010000
HW_APBX_CH4_DBG1 = 0x0160000d
HW_APBX_CH4_DBG2 = 0x20001fe0

HW_SAIF_CTRL = 0x08000801
HW_SAIF_STAT = 0x80000050
HW_SAIF_DATA = 0x0
HW_SAIF_VER = 0x01010000

Oh,God. My poor English!!!
Labels (1)
0 Kudos
1 Solution
760 Views
PeterChan
NXP Employee
NXP Employee

Dear All,

Regarding to playback issue in this original post, please go to https://community.freescale.com/thread/300291 and apply the patch there. The fix will also be available in the coming i.MX28 BSP release in Feb.

Regards,

Peter

View solution in original post

0 Kudos
10 Replies
760 Views
DanielWinner
Contributor I

I am experiencing a similar issue with audio on the iMX283/7.  When using 24-bit audio, the SAIF uses seperate FIFO entries for left and right samples.  If you do a simultaneous arecord/aplay (loop through the processor) sometimes the left and right channels will be swapped.  I have seen that most of the time this occurs because the receive SAIF underruns and from that point on you are swapped.  If I run the command several times, eventually it will not work anymore and the only solution is to reboot.  I have been trying to get someone from Freescale who knows about this hardware because clearly I think that the linux driver is not properly talking to the hardware which will allow it to get into a state where it cannot be recovered.  The manual is fairly vague about the correct way to talk to the SAIF and clearly there is missing information because it will not work simply by doing what the manual says.  I am using the latest stable kernal (3.7rc3) at the time or writing. 

0 Kudos
760 Views
mehmet
Contributor I

I don't think so. If there is a solution, they should share with us. It is not a new problem, We struggle for a year, but there is no solution. It is not a homework or hobby project, it is vital project for my company.

Thanks.

Mehmet

0 Kudos
761 Views
PeterChan
NXP Employee
NXP Employee

Dear All,

Regarding to playback issue in this original post, please go to https://community.freescale.com/thread/300291 and apply the patch there. The fix will also be available in the coming i.MX28 BSP release in Feb.

Regards,

Peter

0 Kudos
760 Views
Yuri
NXP TechSupport
NXP TechSupport

I.MX28 BSP will be updated soon (end of Jan/beginning of Feb).

I have no exact information about the sound issue, but may be it will be fixed too.

0 Kudos
760 Views
MarekVasut
Senior Contributor I

Is that going to be based on upstream kernel now?

0 Kudos
760 Views
Ramtry
Contributor III

Hi Zheng,

As for as my knowledge is concern, you can play the Audio in two ways of interface which are I2S and SAIF. The audio operation STGL5000 is depends CTRL_MODE pin. If CTRL_MODE  = 0 then the Data's transferred using I2C and if CTRL_MODE = 1 then the Data's transferred using I2S. Please check the hardware configuration of IC. By default stereo audio codec is controlled by the I2C interface. The audio data is transferred from the user data

buffer to/from the SAIF FIFO through the DMA channel. Playback uses SAIF0 and Record uses SAIF1.

SAIF0 works in master mode and provides the MCLK, BCLK and LRCLK, SAIF1 and SGTL5000 codec

work in slave mode, using clock of SAIF0. The BCLK and LRCLK are configured according to the audio

sample rate.

This is just general information form my side.

Thank you,

RAM

760 Views
mehmet
Contributor I

Hello all,

I have same problem for a year and the project can be cancelled for this issue. It is so important for us. Is there any solution for now?

Hey, Freescale employees, We wait your help for a year but there is no response.

Thanks.

Mehmet

0 Kudos
760 Views
RegisDargent
Contributor I

I seem to get the same symptoms (at least aplay blocking after some 4600 loops, no audio working any more) with L2.6.35_10.12.01 SDK (with patches_for_L2.6.35_MX28_SDK_10.12_SOURCE.tar.gz).

I cannot reload the modules as my kernel is monolithic.

0 Kudos
760 Views
F_D_
Contributor I

Thanks.My SDK version is L2.6.31_10.08.01_SDK_source_bundle.tar.bz2.I'm sorry,would you please tell me the detailed information of SDK1005 ? SDK1005's full name,and how to get it ?

Do you know who am I? said:

What's you SDK version? This issue shoud be fixed in SDK1005.

0 Kudos
760 Views
admin
Specialist II

What's you SDK version? This issue shoud be fixed in SDK1005.

0 Kudos