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
So my questions are
Thanks in advance!
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.
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.