I am working with an i.MX 8 QXP processor on a custom board. I am creating an ALSA SoC machine driver that connects an SAI to an external codec. For the SAI, we are using the freescale driver implemented in fsl_sai.c, imx-pcm-dma-v2.c, and fsl-edma-v3.c. To test the driver, I am simply using aplay and /dev/urandom to generate noise. All configurations for sample size, number of channels, and sample rates work except for when the number of channels is set to 32. The SAI and codec should be able to support 32 channels.
When I start aplay with 32 channels, there is no audio for exactly 10 seconds and aplay closes with the following error: "aplay: pcm_write:2051: write error: Input/output error". These symptoms indicate that the function snd_pcm_period_elapsed is not being called. This function should be called periodically in the callback function imx_pcm_dma_v2_complete. I added some debug statements into imx_pcm_dma_v2_complete and was able to see that this callback was never being called only when the number of channels is set to 32. Furthermore, I found that the interrupt handler fsl_edma3_tx_handler never executes when the number of channels is set to 32.
Has anyone else seen a similar issue? Does anyone know what causes it? Does anyone know how to fix it?