Suitable 4 channel audio codec for iMX6 Apalis


We need an 4 Audio channels to be anayzed and produced in our device.

Which one you recommendate?

We have two candidates found for now

  1. Analog Devices AD1937
  2. Texas Instruments PCM3168A

If more codecs are known to be good with Apalis iMX6 all recommendating are wellcome.

Who has made Apalis imx 6 drivers for either them? Can we source it from somewhere?

BR Hannu

The Apalis iMX6 has two possible serial audio interfaces SSI and SAI which both support I2S. Do you plan to use a specific one?

There is a codec driver for PCM3168A in our kernel tree, see sound/soc/codecs/pcm3168a.c. The chip has also been successfully used with Colibri iMX7. The Colibri iMX7 uses the same SAI IP, the Apalis iMX6 has a ESAI which is very similar. The bootlin team worked on support for this chip and wrote a blog post about it.

There is also a codec driver for AD1937 in our kernel tree, see sound/soc/codecs/ad193x-i2c.c. I would expect it can be made to work with reasonable effort as well.

We also have customers which used CS42888 and AK5388AEQ.

In all cases you will need to adjust the device tree to make sure that the SoC side audio controller (SAI/SSI) is correctly configured and tied to the audio codec. We can support you on this task through this developer community on best effort basis, but if the changes needed are more involved we need to refer to one of our service partners.

Yes, the ESAI is the better option for the AD1397. The regular SAI can only do one stereo input and one stereo output while the ESAI can have more channels.

Since not all SoC pins are available on the module edge connector, the ESAI_TX2_RX3 is not available on the Apalis iMX6. This means the ESAI can only feature up to 5 transmitter and 3 receiver interface pins. Since the receiver pins are shared with the transmitter pins, this means you can use the 5 transmitter pins only if no receiver pins are used or you can use only 2 transmitter when 3 receiver are used.

In the simple stereo mode (I2S like), each transmitter or receiver pin can transport one stereo signal. In your case, this means for 4 channels, you actually need only 2 data lines. This means, you can use the AD1937 for 4 channel input and 4 channel output by using 2 RX and 2 TX data pins of the ESAI interface.

Besides the two RX and two TX data pins, the AD1937 requires the RX_FS, TX_FS, RX_CLK and TX_CLK, but it does not require the HF_CLK signals.

The Pinout Designer includes the pin 96 for the RX_HF_CLK, but by default it is using pin 72. However pin 72 should not be in the Pinout Designer, since it features a level shifter on the module which makes the RF_HF_CLK function unusable. I have noted this issue in order to correct it in a future version of the database of the Pinout Designer.


It seems that AD 1937 would be better for my use case but do I need to use ESAI bus?

There is an ESAI on both SOM:s iMX6 and imx7 but from SOM side I can use only 4 pcs of TX lines , TX0, TX1, TX3 and TX4

And, what surprises me that only one RX0 is the only receiving port. Is it enough?

Additional there is ESAI_RX_CLK, ESAI_RX_FS, ESAI_RX_HF_CLK signals and ESAI_TX_CLK, ESAI_TX_FS and ESAI_TX_HF_CLK signals

When I’m using Toradex pinout Designer tool it does not include pin
96 ( USBH_OC# GPIO03 ESAI_RX_HF_CLK I/O RX high frequency clock ) to the ESAI BUS, even iMX6 manual says it belongs to it

PS I’m referring Apalis iMX6 datasheet page 52

BR Hannu

Hi peter
OK, I’ll do that way. I’ll consult our SW guys when we go to the point where we have hardware ready.
Thank you

You are welcome