Audio LOST after ~10 hrs on i.MX 6Q

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Audio LOST after ~10 hrs on i.MX 6Q

7,286 Views
_at
Contributor III

Hi All,

 

We are facing strange issue of loosing audio after ~10 hrs of playback.

Platform:: We have customized platform of SabreSD i.MX 6Q.

 

Audio Source connected on port-5 of AUDMUX as MASTER using I2S. Port-1 connected SSI-1. Hence, audio received from AudioSource chip -> PORT-5 -> PORT-1 -> SSI-1.

Audio Codec (playback) connected on Port-6 of AUDMUX as SLAVE using I2S. Port-2 connected SSI-2. Hence, audio playback through SSI-2 -> PORT-2 -> PORT-6 -> Audio Codec chip

 

Existing audio driver for recording path was SSI-1 -> MEMORY. Means one DMA channel setup for DMA_FROM_DEVICE.

We have introduced ASRC in between Recording path (SSI-1 -> ASRC -> MEMORY). So, we have setup two DMA channel; one for SSI-1 -> ASRC i.e. DMA_DEV_TO_DEV & second for ASRC -> MEMORY i.e. DMA_FROM_DEVICE at driver level.

We reference existing playback source code of DMA Channel setup for DMA_DEV_TO_DEV.

Bus width for above channels are DMA_SLAVE_BUSWIDTH_2_BYTES.

 

Modified clock source of  ssi1_clk, ssi2_clk & ssi3_clk to pll4_audio_main_clk in clock.c file.

Now, in our android applicatin we receive recording samples using AudioRecord object & play those sample using AudioTrack. This task done in only one thread at application side.

 

Result:

After above setup we are able to play recoreded content for approx ~10 hrs. but after that we receive error: "Unvalid SDMA MODE" & audio lost.

As per this log, it seems that DMA channel for DMA_DEV_TO_DEV (SSI-1 -> ASRC) met with an error.We try to read reg value of SDMAARM_EVTERR (Ref pg. no-4871:: 55.20.10 -DMA Request Error Register (SDMAARM_EVTERR) i.MX 6Q RM).

Which suggest that error bit set for above channel; this probably means there is an overflow of data for that channel.

But we could not identify how its possible.

 

Can anybody help me out to find where we made mistake in setup of DMA channel ? What is the probable reason for above scenario ?

 

For everybody reference, i am attaching patch here-with.

Please go through it & give comments upon it.

 

-Ankit.

Original Attachment has been moved to: asrc_V1_for_fsl_community.zip

Tags (3)
0 Kudos
68 Replies

1,808 Views
jonghosong
Contributor I

Hi NXP..

I've also same issue. We use slave mode SSI0. SSI1 output and SSI1 input.

We play music continuously throughout SSI0 output ( 48kHz, 16bit LSB mode and use ASRC) .

System doesn't play anything and is holding after printing out log "Unvalid SDMA mode".

I think that this issue is not resolved from NXP. this issue is critical issue for stability.

0 Kudos

1,808 Views
fabio_estevam
NXP Employee
NXP Employee

Jongho/Ankit,

I know this is an old thread, but I am wondering if the following U-Boot patch could help on this issue?

uboot-imx.git - Freescale i.MX u-boot Tree 

0 Kudos

1,811 Views
leige-b42127
Senior Contributor II

can you try the attached patch?

0 Kudos

1,808 Views
nagendrasarma
Contributor III

hi Freescale,

i have requirement of capturing 6(5.1) channel audio, how can i achieve this using imx6 ?

regards

Nagendra

0 Kudos

1,808 Views
saurabh206
Senior Contributor III

Hi,

Nagendra

Its good idea to start new discussion for your requirement.

Thanks

Saurabh

0 Kudos

1,811 Views
saurabh206
Senior Contributor III

Hi,

Lei Ge

Thanks for reply..

But Attached patched is already there in our kernel.

We have already allocated memory using dma_alloc_noncahced.

static int sdma_request_channel(struct sdma_channel *sdmac)

{

    struct sdma_engine *sdma = sdmac->sdma;

    int channel = sdmac->channel;

    int ret = -EBUSY;

    sdmac->bd = dma_alloc_noncached(NULL, PAGE_SIZE, &sdmac->bd_phys, GFP_KERNEL);

    if (!sdmac->bd) {

        ret = -ENOMEM;

        goto out;

    }

Thanks

Saurabh

0 Kudos

1,811 Views
saurabh206
Senior Contributor III

Hi,

Lei Ge

Is there any update for this issue?

Still we are facing this issue.

Thanks

Saurabh

0 Kudos

1,811 Views
leige-b42127
Senior Contributor II


in our default BSP, i2s is used as slave, and do not have such test, can you try i2s slave?

0 Kudos

1,811 Views
saurabh206
Senior Contributor III

Hi,

Lei Ge

Out Playback chip always works in slave mode, so we must have to use i2s in master mode.

For record path we have used the i2s in slave mode.

Thanks

Saurabh

0 Kudos

1,811 Views
leige-b42127
Senior Contributor II

did you mean playback use one audio codec chip, capture use another audio codec chip?

0 Kudos

1,811 Views
_at
Contributor III

Hi Lei Ge,

Are this two different chip ( one for Capture & another for Playback) creating an issue ?

Is there any option or way by which we can debug ??

-Ankit.

0 Kudos

1,811 Views
jamesbone
NXP TechSupport
NXP TechSupport

leige-b42127, do you think the problem of ankitpatel, it is related to use one chip for Capture and another for Playback?.  I would said that I2S in slave mode should be able to handle both.  An idea that I have is to remove one of the chips, starting for the capture, and just playback from a file save in memory. If the error it is still present this would indicate that is something with the memory instead of a problem with the Audio interface.


Have a great day,
Jaime

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,811 Views
leige-b42127
Senior Contributor II

can you try this: only playback or capture with one codec? to narrow down if the playback issue or capture issue?

0 Kudos

1,811 Views
_at
Contributor III

Hi Lei Ge,

There is no issue when we play normal audio file from memory, there is no audio lost till unlimited time..

As we mentioned earlier in post that we got error of "Unvalid SDMA MODE"  when there was Audio lost.

"" As per this log, it seems that DMA channel for DMA_DEV_TO_DEV (SSI-1 -> ASRC) met with an error.We try to read reg value of SDMAARM_EVTERR (Ref pg. no-4871:: 55.20.10 -DMA Request Error Register (SDMAARM_EVTERR) i.MX 6Q RM). Which suggest that error bit set for above channel; this probably means there is an overflow of data for that channel."

If  SDMA met with an overflow of data, it automatically STOP the dma channel ??

-Ankit.

0 Kudos

1,811 Views
leige-b42127
Senior Contributor II

If overflow happend, module will not send new request to SDMA, except there is bus error while SDMA transfer data, SDMA script will stop the channel

can you try to adjust the brustsize of the SDMA between SSI and ASRC ?

0 Kudos

1,811 Views
_at
Contributor III

Hi Lei Ge,

Currently, these are the value set:

1.  Value set to '4' in receive FIFO Watermark (RFWM0) field in the SSI FIFO Control/Status Register (SFCSR).

2.  bus width=DMA_SLAVE_BUSWIDTH_2_BYTES

3.  Parameters, Lower WML (0-7 bit) & Higher WML (16-23 bit), each set to '8' in p_2_p (r7 INFO). Means current burstsize is '8' for p2p channel.

Following experiment i am going to do for modifying burstsize of SDMA between SSI and ASRC.

I will set value '8' in receive FIFO Watermark (RFWM0) field in the SSI FIFO Control/Status Register (SFCSR).

I will set Parameters, Lower WML (0-7 bit) & Higher WML (16-23 bit), to '16'. Hence, burstsize will become 16.

 

Is it correnct?.

-Ankit.

0 Kudos

1,811 Views
leige-b42127
Senior Contributor II

hi, how do you store the music file? do you have enough memory to store the recorded music file(10 hours long), if every 10 hours this issue happens, is this a not enough store memory issue?

0 Kudos

1,810 Views
_at
Contributor III

Hi Lei Ge,

The value of 'sdmac->mode' is 'SDMA_MODE_P2P'. When i setup the P2P channel (SSI->ASRC), mode value set to 'SDMA_MODE_P2P'.

On interrupt received (because of 'overflow'), i print value of reg 'SDMA_H_EVTERR' & channel details:

//code is below

default:

spin_lock_irqsave(&sdma->irq_reg_lock, flag);

stat = readl_relaxed(sdma->regs + SDMA_H_EVTERR);

spin_unlock_irqrestore(&sdma->irq_reg_lock, flag);

pr_err("SDMA_H_EVTERR: %x, ch:%d, id:%d", stat, sdmac->channel, sdmac->chan.chan_id);

pr_err("Unvalid SDMA MODE!\n");

// Log print is:

SDMA_H_EVTERR: 4, ch:2, id:1

Unvalid SDMA MODE!

When i setup the P2P channel, i took the value of channel & its id:

//Log print is:

###ASRC RECORD: P2P dma channel ID:1 CONFIGURED! ASRC RX ReqID:37, SSI RX ReqID: 17

We are not storing audio recorded data in music file.

In our android application we receive recording samples using 'AudioRecord' object & play those sample using 'AudioTrack'. This task done in only one thread at application side.

-Ankit.

0 Kudos

1,809 Views
sinanakman
Senior Contributor III

Hi Ankit, which kernel are you using. I am trying to put together something similar (spdif to ssi over asrc using p2p dma) and I wonder with which kernel you are seeing this "Invalid SDMA mode". Thanks

0 Kudos

1,809 Views
_at
Contributor III

Hi Sinan,

We are using kernel version: 3.0.35

i.e. Default JellyBean Kernel provided by FSL.

-Ankit.

0 Kudos