No reception of audio streams over ESAI1 and I2S device

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

No reception of audio streams over ESAI1 and I2S device

2,033 Views
gorvin
Contributor II

We are trying to setup A2B AD2428 sound card with custom IMX8QM based board.On the following pictures is shown how A2B master AD2428 is connected to the IMX8QM audio subsystem:

gorvin_0-1671097790344.png

gorvin_1-1671097851264.png

ALSA soundcard driver source code files as well as minimal working device tree are attached to the message. With this driver and DT the playback works fine.

The issue is that we can't get recording to work - we get only noise.

We tested the same driver with A2B master eval kit https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL.... We connected EVAL-AD2428WD1BZ over M.2 slot to IMX8QM-MEK evaluation board where connection to the audio subsystem is over SAI0. In that test setup everything works fine, the playback as well as recording.

For our custom board where A2B master is connected over ESAI1 the only change in the driver that we needed to make to initialize the A2B master successfully was in file imx-adau-a2b2428.c in function imx_hifi_hw_params():

gorvin_2-1671099012202.png

Afterward it initializes properly and playback works fine.

Since everything works fine with EVAL-AD2428WD1BZ on IMX8QM-MEK we believe that A2B related parts of driver source code are fine and that the problem is somewhere in configuration of IMX8QM audio subsystem and ESAI1.

Could anyone, please, check whether we are doing anything wrong in attached device tree and the driver source code?

Any suggestion will be appreciated.

Thanks!

7 Replies

2,008 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Dear Igor Vincic,

Please try with this next configuration on device tree (custom-soundcard.dts):

pinctrl_esai1: esai1grp {
fsl,pins = <
IMX8QM_ESAI1_FSR_AUD_ESAI1_FSR 0xc6000040
IMX8QM_ESAI1_FST_AUD_ESAI1_FST 0xc6000040
IMX8QM_ESAI1_SCKR_AUD_ESAI1_SCKR 0xc6000040
IMX8QM_ESAI1_SCKT_AUD_ESAI1_SCKT 0xc6000040
IMX8QM_ESAI1_TX0_AUD_ESAI1_TX0 0xc6000040
IMX8QM_ESAI1_TX1_AUD_ESAI1_TX1 0xc6000040
IMX8QM_ESAI1_TX2_RX3_AUD_ESAI1_TX2_RX3 0xc6000040
IMX8QM_ESAI1_TX3_RX2_AUD_ESAI1_TX3_RX2 0xc6000040
IMX8QM_ESAI1_TX4_RX1_AUD_ESAI1_TX4_RX1 0xc6000040
IMX8QM_ESAI1_TX5_RX0_AUD_ESAI1_TX5_RX0 0xc6000040
>;
};

Instead of:

pinctrl_esai1: esai1grp {
fsl,pins = <
/* A2B_SYNC */
IMX8QM_ESAI1_FST_AUD_ESAI1_FST 0x00000061 /* in/out:default, pull:disabled, strength:low */
/* A2B_BCLK */
IMX8QM_ESAI1_SCKT_AUD_ESAI1_SCKT 0x00000061 /* in/out:default, pull:disabled, strength:low */
/* A2B_DRX0 */
IMX8QM_ESAI1_TX0_AUD_ESAI1_TX0 0x00000061 /* in/out:default, pull:disabled, strength:low */
/* A2B_DRX1 */
IMX8QM_ESAI1_TX1_AUD_ESAI1_TX1 0x00000061 /* in/out:default, pull:disabled, strength:low */
/* A2B_DTX0 */
IMX8QM_ESAI1_TX5_RX0_AUD_ESAI1_TX5_RX0 0x00000020 /* in/out:default, pull:up */
/* A2B_DTX1 */
IMX8QM_ESAI1_TX4_RX1_AUD_ESAI1_TX4_RX1 0x00000020 /* in/out:default, pull:up */
>;
};

That is the default configuration on IMX8QM-MEK device tree for ESAI0 but now on ESAI1.

Best regards.

0 Kudos
Reply

1,968 Views
gorvin
Contributor II

Thanks for suggestion but that didn't help, we still receive only noise.

BTW, I2S signal on the ESAI1 visually looks OK - it has some regular shape, looks like there is data in both directions but we still record only noise.

0 Kudos
Reply

1,945 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Dear Igor Vincic,

Is it the possibility to flash NXP's precompiled image on your board and check the behavior trying to record audio from ESAI1?

On MCIMX8-8X-BB with IMX8QM EVK it is routed two in/out cards on ESAI0 and ESAI1.

It seems to be a software configuration issue.

Best regards.

0 Kudos
Reply

1,934 Views
gorvin
Contributor II

We could flash precompiled image to our board although I am not sure will it boot up on our board. We would also need to rebuild A2B sound card driver for that image.

Which precompiled image we should try, is there a download link? Is there possible to rebuild the driver for that image?

0 Kudos
Reply

1,918 Views
JorgeCas
NXP TechSupport
NXP TechSupport

The image is on the next link. 

https://www.nxp.com/webapp/Download?colCode=L5.15.71_2.2.0_MX8QM&appType=license 

It is not possible to rebuild the driver for that image, to add the A2B driver it is necessary to build the image from zero but, the MEK board it is prepared to play and record audio through ESAI1.

When you recorded from ESAI0 on your EVK board, did you flash your custom image?

0 Kudos
Reply

1,843 Views
gorvin
Contributor II

Hi Jorge,

We used our custom image which was adjusted for MEK board, for our A2B test we used DT that is crated by patch attached to this post. On MEK board connection was over SAI0 not ESAI0. You can check in DT how it was configured.

Maybe I didn't understand what you want me to do with prebuilt image. Do I need to flash it to our custom board or to MEK board?

Although ESAI1 is enabled in this image I don't understand how to get some audio to record without A2B driver, can you explain in a bit more detail what should we try to narrow down the cause of the recording issue?

Best Regards,
Igor

0 Kudos
Reply

1,825 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Dear Igor Vincic,

My question was about if you used the precompiled image on your MEK board to record audio from SAI0 but, it seems that you adapted your custom image to record audio in your A2B test.

Also, I need to check your logs on your custom board with the same conditions when you are not able to record audio from ESAI1. We need check if your codec is correctly detected.

Best regards.

0 Kudos
Reply