Integrating Multiple AK5554 Codecs with i.MX8MN SAI Lines

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

Integrating Multiple AK5554 Codecs with i.MX8MN SAI Lines

597 Views
jadellamorte
Contributor II

I am currently working on a project involving the integration of two AK5554 codecs with the same SA5I line on an i.MX8MN platform. My objective is to configure the system in such a way that it effectively functions as eight audio channels, with all channels connected to the right "AIN." I see both codecs as sound cards in Linux. However, regardless of the audio channel on which a tone is played, it only records to channel 1,.

As an alternative approach, I could  move some  resistors to establish a separate SAI2 line that can connect to the second codec. But I need to maintain synchronicity between the two SAI lines.
When I tried before they were out of sync
see image below

 

image.png

So my questions are

  1. How can I configure the i.MX8MN platform to enable the two AK5554 codecs to act as eight channels, all connected to the right "AIN," while ensuring that each channel records correctly on that same SAI5 line?
  2. If I choose to proceed with the hardware modification and establish a separate SAI2 line for the second codec, what steps should I take to synchronize the two SAI lines effectively?

Thanks in advance!

 

0 Kudos
3 Replies

573 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

External connections are required for the i.MX8MN to operate different SAI instances synchronously with each other. This would depend on the sources of the master clock, bit clock, and frame sync. If all are external, then both SAI instances need to be configured to receive all three. If one or the other SAI is generating them, then the other SAI needs to be configured to receive them. There is no way to route the signals internally, so external, board level connections need to be made.

Best regards.

Jorge.

547 Views
jadellamorte
Contributor II
Hi Jorge, thanks for the reply!

So then what about for my first question of getting 2 ak5554 on one SAI and having each input as a different channel in Linux

0 Kudos

537 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

Researching internally, it seems that also it is possible, there is an example about how to do a similar application, here is the example about how to do it with i.MX8MM and AK4458:

On 8MM EVK board, when comment I2C access to AK4458, AK4458 sound card device will be registered, without connecting to audio board. Attached is the patch, after apply it, you can find below sound card devices.

root@imx8mmevk:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: imxspdif [imx-spdif], device 0: S/PDIF PCM snd-soc-dummy-dai-0 [S/PDIF PCM snd-soc-dummy-dai-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: btscoaudio [bt-sco-audio], device 0: 30020000.sai-bt-sco-pcm bt-sco-pcm-0 [30020000.sai-bt-sco-pcm bt-sco-pcm-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: btscoaudio [bt-sco-audio], device 1: 30020000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-1 [30020000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: wm8524audio [wm8524-audio], device 0: 30030000.sai-wm8524-hifi wm8524-hifi-0 [30030000.sai-wm8524-hifi wm8524-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 4: ak4458audio [ak4458-audio], device 0: Audio multicodec-0 [Audio multicodec-0]
Subdevices: 1/1
Subdevice #0: subdevice #0

In imx-ak4458.c, imx_aif_hw_params, if you don't enable tdm and dsd, slots of each lane is set to 2.

So when play stereo music, only TXD0 has signal.

When play 4 channels music, you can observe signal on TXD0 and TXD1. Channel 0 and 1 are sent to TXD0, channel 2 and 3 are sent to TXD1

I hope this information helps you.

Best regards.

0 Kudos