can't play wav file (i.mx8mm)

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

can't play wav file (i.mx8mm)

Jump to solution
555 Views
sung-ho
Contributor II

Hi

I'm trying to play wav file on my custom board(i.mx8mm, android 11.0.0_2.6.0).

when i play tinyplay utility, it is stuck. it stopped at wait_for_avail function and error message is like this.

"playback write error (DMA or IRQ trouble?)"

audio output is SAI3, and it is connected to external codec(wm8904).

sai3: sai@30030000 {
#sound-dai-cells = <0>;
compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
reg = <0x30030000 0x10000>;
interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MM_CLK_SAI3_IPG>, <&clk IMX8MM_CLK_DUMMY>,
<&clk IMX8MM_CLK_SAI3_ROOT>,
<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
dmas = <&sdma2 4 2 0>, <&sdma2 5 2 0>;
dma-names = "rx", "tx";
status = "disabled";
};


&sai3 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
assigned-clock-rates = <1536000>;
status = "okay";
};

what do i have to do?

can anyone give some advice? 

Labels (1)
Tags (2)
0 Kudos
1 Solution
500 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @sung-ho,

I hope you are doing well.

From the log, it seems that the sdma firmware is correctly loaded.

Please refer to /arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi, where sound-wm8524  is defined.

Thanks & Regards,
Dhruvit Vasavada

View solution in original post

0 Kudos
4 Replies
528 Views
sung-ho
Contributor II

Hi Dhruvit,
thanks for your reply.

i thought f/w was loaded correctly because there was no error in sdma_load_script(i think it is f/w loading function).
but i'm not sure f/w was really loaded correctly.

in the end of imx-sdma.c, MODULE_FIRMWARE("imx/sdma/sdma-imx7d.bin"); is wrapped in #if like below
#if IS_ENABLED(CONFIG_SOC_IMX7D)
MODULE_FIRMWARE("imx/sdma/sdma-imx7d.bin");
#endif

do i have to add CONFIG_SOC_IMX7D config?

anyway, i uploaded log and device tree files.
in the log, tinyplay start point is line 1249.

sometimes it stuck at pcm open, and sometime it stuck at wait_for_avail,
but today, it only stuck at pcm open and i can't reproduce the other case.

let me know if you need anything

Thanks and BR

0 Kudos
501 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @sung-ho,

I hope you are doing well.

From the log, it seems that the sdma firmware is correctly loaded.

Please refer to /arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi, where sound-wm8524  is defined.

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
484 Views
sung-ho
Contributor II

Hi Dhruvit

thank you. your reply was very helpful to me.

i modified device tree like the example you told me, and it works well now.

0 Kudos
538 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @sung-ho,

I hope you are doing well.

Please make sure sdma firmware(imx/sdma/sdma-imx7d.bin) is correctly loaded.

Please provide me with the dts file, boot logs and error logs for further debugging.

Please refer to Chapter 7 Audio and Section 11.6 Audio in i.MX Linux Reference Manual and imx-test for Audio-related tests.

Thanks & Regards,
Dhruvit Vasavada

0 Kudos