i.mx6 audio loopback

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

i.mx6 audio loopback

2,081 Views
shanxigjz
Contributor II

Hi all,

I am trying do the audio loopback on i.mx6 sabresd board.

Audio is in from mic port of board, and out to speaker from headphone port.

I used following command:

            arecord -Dhw:0,0 -c 2 -f S16_LE -r 44100 | aplay

It is ok that i can hear the audio output from speaker.

But there is a serious delay, i measured with an oscilloscope,

and it is about 400ms.

Now the problem is:

How can i reduce this delay time? My customer's requirement is 100ms.

And I think that the time is costed by the memory copy.

Can bellow flow be achieved? without the alsa frame work.

audio--->SSI RX FIFO--->SSI TX FIFO---->

Labels (3)
0 Kudos
12 Replies

1,179 Views
sinanakman
Senior Contributor III

Hi Gao and Lei, I would be interested in this discussion as I am working on improving audio latencies on iMX6.

Is it possible to have this discussion in English, is there a auto-translate option in the forum ?

Thanks

Sinan Akman

0 Kudos

1,179 Views
abeeshmp
Contributor I

Hi Sinan Akman,

Did u get SPDIF to ASRC P2P channel working? I am facing an issue in this p2p SDMA transfer. SDMA reads only left channel FIFO of SPDIF. Do you have any idea to make SDMA to read both left and right FIFO of SPDIF?

0 Kudos

1,179 Views
sinanakman
Senior Contributor III

Hi Abesh, we weren't trying to do this over asrc but rather directly from spdif to ssi. Both fifo's were filling. We had (still have) sync issues but this is different. You should have both fifo's being filled. Do you get any error in status registers ?

0 Kudos

1,179 Views
abeeshmp
Contributor I

Hi Sinan,

Could you please provide some inputs to make SPDIF to SSI(without ASRC) working in our side?

Did you use more than one SDMA channel for transfer data from spdif to ssi?

Did you enable Dual FIFO in SSI?

0 Kudos

1,179 Views
sinanakman
Senior Contributor III

Hi Abeesg, IIRC we tried this on one channel but we then had our own sdma related issues so I don't remember if we

went further enough for two channels. In your case, you seemed to get the two channels out of sync perhaps as a result

of problem in you signal. Can you simple try this on one channel and if it works try it on another channel, i.e. have left

and right working separately first. If you get everything clean then we can look into why you might be having syncing

the both channels. Please let me know how far you are able to get with one channel only.

Regards

Sinan Akman

0 Kudos

1,179 Views
abeeshmp
Contributor I

Hi Sinan,

Thanks for your reply.

We are getting "Rx FIFO resync" interrupt from spdif.

0 Kudos

1,179 Views
leige-b42127
Senior Contributor II

应该可以,但是我们没有参考代码。还有一种方法,audio codec内部应该都可以配置loopback模式的,让数据只在audio codec内部出入。

0 Kudos

1,179 Views
shanxigjz
Contributor II

你好,谢谢。

后一种方法是不行的,因为我们客户板子的的输入和输出不是在一个codec里面做的。

输入信号是从一个芯片进来的,输出是到另外一个芯片。

关于直接 SSI RX DMA----> SSI TX DMA 的方法,

您能告诉我大概需要修改哪些地方,

或者有什么可以参考的东西吗?

改起来的话难度大吗?

谢谢。

0 Kudos

1,179 Views
leige-b42127
Senior Contributor II

Use SDMA P2P mode, DMA src_addr = ssi RX fifo addr, DMA dest_addr = SSI TX fifo addr.
You can take ASRC P2P code for sample.

0 Kudos

1,179 Views
sinanakman
Senior Contributor III

Hi Lei, thanks for your reply and writing this again in English for me. This is actually interesting. We were trying to get p2p sdma working between spdif and ssi but we observed that every once a while sdma repeats transferring the same frame. We asked FSL if they know of any customer who successfully implemented p2p with any device other than asrc but haven't heard back. Would you know of any working implementation of p2p that does not use asrc.

Thanks and best regards

Sinan Akman

0 Kudos

1,179 Views
leige-b42127
Senior Contributor II

what do you mean "SDMA repeats the same frame"? did you mean 2 channels, but only one channel data is transferring?
when using SSI p2p, dual fifo is not needed, you should disable ssi dual fifo mode.

0 Kudos

1,179 Views
sinanakman
Senior Contributor III

Hi Lei, in our experiment we used only one channel and didn't use the dual fifo. We observed that every once a while after a dma transfer is completed the same data was transferred again as if there was an error  and the previous transfer was repeated. Do you know anyone who had used spdif-ssi p2p sdma successfully ?

0 Kudos