This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: mcasp1 can not work

Part Number: TDA4VM

Tool/software:

HI

We use sdk 10.

We want to use mcasp1 (I2S) to send data to the ad2428.

The mcasp1 pinmux is:

static pinmuxPerCfg_t gMcasp1PinCfg[] =
{
    /* MyMCASP1 -> MCASP1_ACLKX -> AB27 */
    {
        PIN_PRG0_PRU1_GPO5, PIN_MODE(12) | \
        ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
    },
    /* MyMCASP1 -> MCASP1_AFSX -> AA28 */
    {
        PIN_PRG0_PRU1_GPO8, PIN_MODE(12) | \
        ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
    },
    /* MyMCASP1 -> MCASP1_AXR2 -> AD29 */
    {
        PIN_PRG0_PRU1_GPO4, PIN_MODE(12) | \
        ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
    },
    /* MyMCASP1 -> MCASP1_AXR3 -> AC26 */
    {
        PIN_PRG0_PRU1_GPO6, PIN_MODE(12) | \
        ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
    },
    /* MyMCASP1 -> MCASP1_AXR6 -> AA25 */
    {
        PIN_PRG0_PRU1_GPO10, PIN_MODE(12) | \
        ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
    },
    /* MyMCASP1 -> MCASP1_AXR7 -> AG26 */
    {
        PIN_PRG0_PRU1_GPO11, PIN_MODE(12) | \
        ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
    },
    {PINMUX_END}
};

Dts config is:

	main_mcasp1_pins_default: main-mcasp1-default-pins {
		pinctrl-single,pins = <
			J721E_IOPAD(0x114, PIN_INPUT, 12) /* (AB27) PRG0_PRU1_GPO5.MCASP1_ACLKX */
			J721E_IOPAD(0x120, PIN_INPUT, 12) /* (AA28) PRG0_PRU1_GPO8.MCASP1_AFSX */
			J721E_IOPAD(0x110, PIN_INPUT, 12) /* (AD29) PRG0_PRU1_GPO4.MCASP1_AXR2 */
			J721E_IOPAD(0x118, PIN_INPUT, 12) /* (AC26) PRG0_PRU1_GPO6.MCASP1_AXR3 */
			J721E_IOPAD(0x128, PIN_INPUT, 12) /* (AA25) PRG0_PRU1_GPO10.MCASP1_AXR6 */
			J721E_IOPAD(0x12c, PIN_INPUT, 12) /* (AG26) PRG0_PRU1_GPO11.MCASP1_AXR7 */
		>;
	};
	
	&mcasp1 {
	status = "okay";
	#sound-dai-cells = <0>;

	pinctrl-names = "default";
	pinctrl-0 = <&main_mcasp1_pins_default>;

	op-mode = <0>;          /* MCASP_IIS_MODE */
	tdm-slots = <4>;
	auxclk-fs-ratio = <256>;

	serial-dir = <	/* 0: INACTIVE, 1: TX, 2: RX */
		2 2 1 1
	>;
	tx-num-evt = <0>;
	rx-num-evt = <0>;
};


	codec_audio: sound {
		compatible = "simple-audio-card";
		simple-audio-card,name = "ad242x";
		status = "okay";

		/* 纯播放链路 */
		simple-audio-card,dai-link@0 {
			format = "i2s";
			bitclock-master = <&cpu_dai>;
			frame-master = <&cpu_dai>;

			cpu_dai: cpu {
				sound-dai = <&mcasp1>;  // 必须与下方mcasp1的label匹配
				dai-tdm-slot-num = <4>;
				dai-tdm-slot-width = <32>;
				dai-tdm-slot-tx-mask = <1 1 1 1>; // Slot0-3均启用
			};

			simple-audio-card,codec {
				sound-dai = <&dummy_codec>;
			};
		};
	};

	dummy_codec: dummy-codec {
		compatible = "linux,snd-soc-dummy";
		#sound-dai-cells = <0>;
		status = "okay";
	};

Then we can see the dummy sound card

root@j721e-evm:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7

The use command speaker-test -D hw:0,0  -t wav to test 

And using an oscilloscope to measure MCASP1_AXR2, MCASP1_AXR3, MCASP1_AXR6, and MCASP1_AXR7, but there are no waveforms. What modifications are needed?

BR

Liupt

  • root@j721e-evm:~# speaker-test -D hw:0,0 -t wav

    speaker-test 1.2.11

    Playback device is hw:0,0
    Stream parameters are 48000Hz, S16_LE, 1 channels
    WAV file(s)
    Rate set to 48000Hz (requested 48000Hz)
    Buffer size range from 32 to 32768
    Period size range from 32 to 32768
    Periods = 4
    was set period_size = 12000
    was set buffer_size = 32768
    0 - Front Left
    Time per period = 1.005434
    0 - Front Left
    Time per period = 1.499926
    0 - Front Left
    Time per period = 1.499931
    0 - Front Left
    Time per period = 1.250356
    0 - Front Left
    Time per period = 1.499527
    0 - Front Left
    Time per period = 1.499912
    0 - Front Left
    Time per period = 1.499957
    0 - Front Left
    Time per period = 1.499908
    0 - Front Left
    Time per period = 1.499945
    0 - Front Left
    Time per period = 1.499921
    0 - Front Left
    Time per period = 1.499974
    0 - Front Left
    Time per period = 1.499941
    0 - Front Left
    Time per period = 1.499944
    0 - Front Left
    Time per period = 1.499925
    0 - Front Left
    Time per period = 1.499968
    0 - Front Left
    Time per period = 1.250318
    0 - Front Left
    Time per period = 1.499558
    0 - Front Left
    Time per period = 1.499950
    0 - Front Left
    Time per period = 1.499948
    0 - Front Left
    Time per period = 1.499946

    This is the log of the playback test command.

  • Hi

    there is some thing wrong with mcasp1.

    root@j721e-evm:~# dmesg | grep sound

    [ 21.483744] platform sound: deferred probe pending

    if i delete this line sound-dai = <&mcasp1>;  // 必须与下方mcasp1的label匹配

    it would be ok

    BR

    liupt

     

  • Hi liupt,

    You device tree settings for the MCASP1 are incorrect.

    Looking at the pinmuxing:

    	main_mcasp1_pins_default: main-mcasp1-default-pins {
    		pinctrl-single,pins = <
    			J721E_IOPAD(0x114, PIN_INPUT, 12) /* (AB27) PRG0_PRU1_GPO5.MCASP1_ACLKX */
    			J721E_IOPAD(0x120, PIN_INPUT, 12) /* (AA28) PRG0_PRU1_GPO8.MCASP1_AFSX */
    			J721E_IOPAD(0x110, PIN_INPUT, 12) /* (AD29) PRG0_PRU1_GPO4.MCASP1_AXR2 */
    			J721E_IOPAD(0x118, PIN_INPUT, 12) /* (AC26) PRG0_PRU1_GPO6.MCASP1_AXR3 */
    			J721E_IOPAD(0x128, PIN_INPUT, 12) /* (AA25) PRG0_PRU1_GPO10.MCASP1_AXR6 */
    			J721E_IOPAD(0x12c, PIN_INPUT, 12) /* (AG26) PRG0_PRU1_GPO11.MCASP1_AXR7 */
    		>;
    	};
     

    Which lines are supposed to be outputs? In this configuration, they are all set as inputs (which I don't think is correct).

    Looking at the MCASP1 node, the serializer lines are set up incorrectly.

    Each number within the serial-dir property corresponds to a serializer. Since you are using AXR 2, 3, 6, and 7, the serial-dir property should reflect that. There are 12 serializers within the MCASP1 node, therefore I've put 12 lines in the serial-dir property. Depending on whether they are set to RX or TX, change the Xs accordingly.

    &mcasp1 {
    	status = "okay";
    	#sound-dai-cells = <0>;
    
    	pinctrl-names = "default";
    	pinctrl-0 = <&mcasp1_pins_default>;
    
    	op-mode = <0>;          /* MCASP_IIS_MODE */
    	tdm-slots = <2>;
    	auxclk-fs-ratio = <256>;
    
    	serial-dir = <	/* 0: INACTIVE, 1: TX, 2: RX */
    		0 0 X X
    		0 0 X X
    		0 0 0 0
    	>;
    	tx-num-evt = <0>;
    	rx-num-evt = <0>;
    };

    For the snd-dummy and codec master:

    codec_test: codec_test {
        compatible = "linux,snd-soc-dummy";
        #sound-dai-cells = <0>;
    };
    
    codec_audio: sound {
        compatible = "simple-audio-card";
            simple-audio-card,name = "J721E-TEST";
            simple-audio-card,format = "i2s";
            simple-audio-card,bitclock-master = <&sound_master>;
            simple-audio-card,frame-master = <&sound_master>;
            
            sound_master: simple-audio-card,cpu {
                sound-dai = <&mcasp1>;
                system-clock-direction-out;
            };
            
            simple-audio-card,codec {
                sound-dai = <&codec_test>;
            };
    };

    Best,
    Jared

  • Hi 

    I had modify the code:

    	codec_test: codec_test {
    		compatible = "linux,snd-soc-dummy";
    		#sound-dai-cells = <0>;
    		status = "okay";
    	};
    
    	codec_audio: sound {
    		compatible = "simple-audio-card";
    			simple-audio-card,name = "J721E-TEST";
    			simple-audio-card,format = "i2s";
    			simple-audio-card,bitclock-master = <&sound_master>;
    			simple-audio-card,frame-master = <&sound_master>;
    			status = "okay";
    			sound_master: simple-audio-card,cpu {
    				sound-dai = <&mcasp1>;
    				system-clock-direction-out;
    			};
    			
    			simple-audio-card,codec {
    				sound-dai = <&codec_test>;
    			};
    	};
    	
    	main_mcasp1_pins_default: main-mcasp1-default-pins {
    		pinctrl-single,pins = <
    			J721E_IOPAD(0x114, PIN_INPUT, 12) /* (AB27) PRG0_PRU1_GPO5.MCASP1_ACLKX */
    			J721E_IOPAD(0x120, PIN_INPUT, 12) /* (AA28) PRG0_PRU1_GPO8.MCASP1_AFSX */
    			J721E_IOPAD(0x110, PIN_INPUT, 12) /* (AD29) PRG0_PRU1_GPO4.MCASP1_AXR2 */
    			J721E_IOPAD(0x118, PIN_INPUT, 12) /* (AC26) PRG0_PRU1_GPO6.MCASP1_AXR3 */
    			J721E_IOPAD(0x128, PIN_OUTPUT, 12) /* (AA25) PRG0_PRU1_GPO10.MCASP1_AXR6 */
    			J721E_IOPAD(0x12c, PIN_OUTPUT, 12) /* (AG26) PRG0_PRU1_GPO11.MCASP1_AXR7 */
    		>;
    	};
    	
    	&mcasp1 {
    	status = "okay";
    	#sound-dai-cells = <0>;
    
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_mcasp1_pins_default>;
    
    	op-mode = <0>;          /* MCASP_IIS_MODE */
    	tdm-slots = <4>;
    	auxclk-fs-ratio = <256>;
    
    	serial-dir = <	/* 0: INACTIVE, 1: TX, 2: RX */
    		0 0 2 2
    		0 0 1 1
    		0 0 0 0
    	>;
    	tx-num-evt = <0>;
    	rx-num-evt = <0>;
    };

    But sitll failed .

    root@j721e-evm:~# dmesg | grep sound
    [ 21.737609] platform sound: deferred probe pending

    So there is still something wrong.

    J721E_IOPAD(0x114, PIN_INPUT, 12) /* (AB27) PRG0_PRU1_GPO5.MCASP1_ACLKX */
    J721E_IOPAD(0x120, PIN_INPUT, 12) /* (AA28) PRG0_PRU1_GPO8.MCASP1_AFSX */

    should Be ?

    J721E_IOPAD(0x114, PIN_OUTPUT, 12) /* (AB27) PRG0_PRU1_GPO5.MCASP1_ACLKX */
    J721E_IOPAD(0x120, PIN_OUTPUT, 12) /* (AA28) PRG0_PRU1_GPO8.MCASP1_AFSX */

    and I enter k3conf show clocks 175

    root@j721e-evm:~# k3conf show clocks 175
    |------------------------------------------------------------------------------|
    | VERSION INFO                                                                 |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Jul 25 14:13:02 UTC 2024)              |
    | SoC    | J721E SR1.1                                                         |
    | SYSFW  | ABI: 4.0 (firmware version 0x000a '10.0.8--v10.00.08 (Fiery Fox))') |
    |------------------------------------------------------------------------------|
    
    |---------------------------------------------------------------------------------------------------------------------------------------------------------|
    | Device ID | Clock ID | Clock Name                                                            | Clock Function                                           |
    |---------------------------------------------------------------------------------------------------------------------------------------------------------|
    |   175     |     0    | DEV_MCASP1_VBUSP_CLK                                                  | Input clock                                              |
    |   175     |     1    | DEV_MCASP1_AUX_CLK                                                    | Input muxed clock                                        |
    |   175     |     2    | DEV_MCASP1_AUX_CLK_PARENT_HSDIV3_16FFT_MAIN_4_HSDIVOUT0_CLK           | Parent input clock option to DEV_MCASP1_AUX_CLK          |
    |   175     |     3    | DEV_MCASP1_AUX_CLK_PARENT_HSDIV4_16FFT_MAIN_2_HSDIVOUT2_CLK           | Parent input clock option to DEV_MCASP1_AUX_CLK          |
    |   175     |     4    | DEV_MCASP1_AUX_CLK_PARENT_HSDIV3_16FFT_MAIN_15_HSDIVOUT0_CLK          | Parent input clock option to DEV_MCASP1_AUX_CLK          |
    |   175     |     6    | DEV_MCASP1_AUX_CLK_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT            | Parent input clock option to DEV_MCASP1_AUX_CLK          |
    |   175     |     7    | DEV_MCASP1_AUX_CLK_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT_1          | Parent input clock option to DEV_MCASP1_AUX_CLK          |
    |   175     |     8    | DEV_MCASP1_AUX_CLK_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT_2          | Parent input clock option to DEV_MCASP1_AUX_CLK          |
    |   175     |     9    | DEV_MCASP1_AUX_CLK_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT_3          | Parent input clock option to DEV_MCASP1_AUX_CLK          |
    |   175     |    10    | DEV_MCASP1_MCASP_ACLKX_POUT                                           | Output clock                                             |
    |   175     |    11    | DEV_MCASP1_MCASP_ACLKX_PIN                                            | Input clock                                              |
    |   175     |    12    | DEV_MCASP1_MCASP_ACLKR_POUT                                           | Output clock                                             |
    |   175     |    13    | DEV_MCASP1_MCASP_ACLKR_PIN                                            | Input clock                                              |
    |   175     |    14    | DEV_MCASP1_MCASP_AHCLKX_POUT                                          | Output clock                                             |
    |   175     |    15    | DEV_MCASP1_MCASP_AHCLKX_PIN                                           | Input muxed clock                                        |
    |   175     |    16    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_BOARD_0_HFOSC1_CLK_OUT             | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    17    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_GLUELOGIC_HFOSC0_CLKOUT            | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    18    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_MCASP_AHCLKO_MUX_OUT0              | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    19    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_MCASP_AHCLKO_MUX_OUT1              | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    20    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_MCASP_AHCLKO_MUX_OUT2              | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    21    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_MCASP_AHCLKO_MUX_OUT3              | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    22    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_BOARD_0_MLB0_MLBCLK_OUT            | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    23    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_BOARD_0_MLB0_MLBCP_OUT2            | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    24    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT   | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    25    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT_1 | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    26    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT_2 | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    27    | DEV_MCASP1_MCASP_AHCLKX_PIN_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT_3 | Parent input clock option to DEV_MCASP1_MCASP_AHCLKX_PIN |
    |   175     |    28    | DEV_MCASP1_MCASP_AHCLKR_POUT                                          | Output clock                                             |
    |   175     |    29    | DEV_MCASP1_MCASP_AHCLKR_PIN                                           | Input muxed clock                                        |
    |   175     |    30    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_BOARD_0_HFOSC1_CLK_OUT             | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |   175     |    31    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_GLUELOGIC_HFOSC0_CLKOUT            | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |   175     |    32    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_MCASP_AHCLKO_MUX_OUT0              | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |   175     |    33    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_MCASP_AHCLKO_MUX_OUT1              | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |   175     |    34    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_MCASP_AHCLKO_MUX_OUT2              | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |   175     |    35    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_MCASP_AHCLKO_MUX_OUT3              | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |   175     |    36    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_BOARD_0_MLB0_MLBCLK_OUT            | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |   175     |    37    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_BOARD_0_MLB0_MLBCP_OUT2            | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |   175     |    38    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT   | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |   175     |    39    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT_1 | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |   175     |    40    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT_2 | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |   175     |    41    | DEV_MCASP1_MCASP_AHCLKR_PIN_PARENT_ATL_MAIN_0_ATL_IO_PORT_ATCLK_OUT_3 | Parent input clock option to DEV_MCASP1_MCASP_AHCLKR_PIN |
    |---------------------------------------------------------------------------------------------------------------------------------------------------------|
    
    

    Currently, the mcasp1 node is defined as follows:

    mcasp1: mcasp@2b10000 {
    compatible = "ti,am33xx-mcasp-audio";
    reg = <0x0 0x02b10000 0x0 0x2000>,
    <0x0 0x02b18000 0x0 0x1000>;
    reg-names = "mpu","dat";
    interrupts = <GIC_SPI 546 IRQ_TYPE_LEVEL_HIGH>,
    <GIC_SPI 547 IRQ_TYPE_LEVEL_HIGH>;
    interrupt-names = "tx", "rx";

    dmas = <&main_udmap 0xc401>, <&main_udmap 0x4401>;  
    dma-names = "tx", "rx";  
    
    clocks = <&k3_clks 175 1>;  
    clock-names = "fck";  
    power-domains = <&k3_pds 175 TI_SCI_PD_EXCLUSIVE>;  
    status = "disabled";  
    

    };

    The clock being used is clocks = <&k3_clks 175 1>;, but since we are the master device, the clock should be output. Should I use clocks = <&k3_clks 175 10>; instead?

  • HI

    I also add CONFIG_SND_SOC_DAVINCI_MCASP=y in decofig ,But still 

    dmesg | grep sound
    [ 21.452021] platform sound: deferred probe pending

    Then i modify code like this

    	codec_test: codec_test {
    		compatible = "linux,snd-soc-dummy";
    		#sound-dai-cells = <0>;
    		status = "okay";
    	};
    
    	codec_audio: sound {
    		compatible = "simple-audio-card";
    			simple-audio-card,name = "J721E-TEST";
    			simple-audio-card,format = "i2s";
    			simple-audio-card,bitclock-master = <&sound_master>;
    			simple-audio-card,frame-master = <&sound_master>;
    			status = "okay";
    			sound_master: simple-audio-card,cpu {
    				sound-dai = <&codec_test>;
    				system-clock-direction-out;
    			};
    			
    			simple-audio-card,codec {
    				sound-dai = <&codec_test>;
    			};
    	};

    still not work

    dmesg | grep sound
    [ 21.452021] platform sound: deferred probe pending

  • Hi 

    codec_test: codec_test {
    compatible = "linux,snd-soc-dummy";   。。。。》There is no corresponding driver in the kernel
    #sound-dai-cells = <0>;
    status = "okay";
    };

    so this problem make codec_audio deferred probe pending.

    Our custom board connects the AD2428 via I2S. I want to use aplay to play audio and send it through I2S. Is it necessary to configure a codec? If it is necessary, could you provide a codec that works?

    BR

    liupt

  • HI

    Now i modify the code 

    	sound {  
    		compatible = "simple-audio-card";  
    		simple-audio-card,name = "J721E-TEST";  
    		simple-audio-card,format = "i2s";  
    		simple-audio-card,bitclock-master = <&sound_master>;  
    		simple-audio-card,frame-master = <&sound_master>;  
    		status = "okay";  
    
    		// CPU 端配置(I2S 控制器)  
    		sound_master: simple-audio-card,cpu {  
    			sound-dai = <&mcasp1>;   
    			system-clock-direction-out;   
    			master-enable;             
    			dai-tdm-slot-num = <2>;    
    			dai-tdm-slot-width = <32>;   
    		};  
    
    		// Codec 端伪配置  
    		simple-audio-card,codec {  
    			sound-dai = <&sound>;     
    		};  
    	};  

    We can find the sound 

    root@j721e-evm:~# aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: J721ETEST [J721E-TEST], device 0: 2b10000.mcasp-codec_test codec_test-0 [2b10000.mcasp-codec_test codec_test-0]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    root@j721e-evm:~# speaker-test -D hw:0,0 -t wav

    speaker-test 1.2.11

    Playback device is hw:0,0
    Stream parameters are 48000Hz, S16_LE, 1 channels
    WAV file(s)
    Rate set to 48000Hz (requested 48000Hz)
    Buffer size range from 32 to 262144
    Period size range from 16 to 32768
    Periods = 4
    was set period_size = 12000
    was set buffer_size = 48000
    0 - Front Left
    Write error: -5,Input/output error
    xrun_recovery failed: -5,Input/output error
    Transfer failed: Input/output error

    BR

    liupt

  • HI

    root@j721e-evm:~# dmesg | grep -i sdma
    [ 7.759878] snd_soc_ti_sdma: exports duplicate symbol sdma_pcm_platform_register (owned by kernel)
    [ 7.861687] snd_soc_ti_sdma: exports duplicate symbol sdma_pcm_platform_register (owned by kernel)

    Supplement the DMA error logs

  • Hi liupt,

    J721E_IOPAD(0x114, PIN_OUTPUT, 12) /* (AB27) PRG0_PRU1_GPO5.MCASP1_ACLKX */
    J721E_IOPAD(0x120, PIN_OUTPUT, 12) /* (AA28) PRG0_PRU1_GPO8.MCASP1_AFSX */

    If these are supposed to be output, yes.

    The clock being used is clocks = <&k3_clks 175 1>;, but since we are the master device, the clock should be output. Should I use clocks = <&k3_clks 175 10>; instead?

    No, the "input muxed clock" just signifies that the clock is the output of a mux.

    I also add CONFIG_SND_SOC_DAVINCI_MCASP=y in decofig ,But still 

    The ti_arm64_prune.config fragment should take care of all reguired .config changes.

    compatible = "linux,snd-soc-dummy";   。。。。》There is no corresponding driver in the kernel

    The linux,snd-soc-dummy falls within ./sound/soc/soc-utils.c There shouldn't be any issues with using it.

    Our custom board connects the AD2428 via I2S. I want to use aplay to play audio and send it through I2S. Is it necessary to configure a codec? If it is necessary, could you provide a codec that works?

    It is necessary to configure a codec, and the dummy codec does work.

    Here's a thread with a working example of the device tree with a dummy codec: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1480088/processor-sdk-j784s4-how-to-control-the-volume-using-amixer-command

    The issue with the AD2428, is that there isn't a Linux driver that corresponds to it. Because of this, you'll either have to write your own custom driver, or use the dummy codec as a stand-in. 

    Best,
    Jared

  • HI

    Enabling CONFIG_SND_SOC_DAVINCI_MCASP causes the error:
    snd_soc_ti_sdma: exports duplicate symbol sdma_pcm_platform_register (owned by kernel)

    Supplement the DMA error logs. Therefore, this error indicates it should not be enabled.

    codec_test: codec_test {
    compatible = "linux,snd-soc-dummy";
    #sound-dai-cells = <0>;
    status = "okay";
    };

    it still doesn't work. The codec_test fails to complete initialization, causing:
    [ 21.719063] platform sound0: deferred probe pending

    What other configurations are needed when using linux,snd-soc-dummy?

    BR

    liupt

  • Hi liupt,

    Enabling CONFIG_SND_SOC_DAVINCI_MCASP causes the error:

    CONFIG_SND_SOC_DAVINCI_MCASP should be set to m, so that it builds as a module.

    To generate the .config, run:

    # with the proper variables set
    make defconfig ti_arm64_prune.config

    Best,
    Jared

  • Hi Jared

    Why i still can not use codec_test: codec_test {
    compatible = "linux,snd-soc-dummy";
    #sound-dai-cells = <0>;
    status = "okay";
    };

    do you have other suggestion ?

    BR

    liupt

  • Hi Liupt,

    I've set up the MCASP1 on a TDA4VM-SK for testing. A couple of things, ensure that there are no pinmux conflicts and apply the following patch. After this, there was no deferred probe message.

    k3-j721e-sk-mcasp1.dtso:

    /dts-v1/;
    /plugin/;
    
    #include "k3-pinctrl.h"
    
    &main_pmx0 {
    	mcasp1_pins_default: mcasp1-default-pins {
    		pinctrl-single,pins = <
    			J721E_IOPAD(0xd4, PIN_OUTPUT, 12) /* (AB26) PRG0_PRU0_GPO9.MCASP0_ACLKX */
    			J721E_IOPAD(0xd8, PIN_OUTPUT, 12) /* (AB25) PRG0_PRU0_GPO10.MCASP0_AFSX */
    			J721E_IOPAD(0xb0, PIN_INPUT, 12) /* (AF28) PRG0_PRU0_GPO0.MCASP0_AXR0 */
    			J721E_IOPAD(0xb4, PIN_INPUT, 12) /* (AE28) PRG0_PRU0_GPO1.MCASP0_AXR1 */
    			J721E_IOPAD(0xc0, PIN_OUTPUT, 12) /* (AD25) PRG0_PRU0_GPO4.MCASP0_AXR2 */
    			J721E_IOPAD(0xc4, PIN_OUTPUT, 12) /* (AC29) PRG0_PRU0_GPO5.MCASP0_AXR3 */
    		>;
    	};
    
    };
    
    &{/} {
    	codec_test: codec_test {
    		compatible = "linux,snd-soc-dummy";
    		#sound-dai-cells = <0>;
    	};
    
    	codec_audio: sound {
    	compatible = "simple-audio-card";
    		simple-audio-card,name = "J721E-TEST";
    		simple-audio-card,format = "i2s";
    		simple-audio-card,bitclock-master = <&sound_master>;
    		simple-audio-card,frame-master = <&sound_master>;
    
    		sound_master: simple-audio-card,cpu {
    			sound-dai = <&mcasp1>;
    			system-clock-direction-out;
    		};
    
    		simple-audio-card,codec {
    			sound-dai = <&codec_test>;
    		};
    	};
    };
    
    &mcasp1 {
    	status = "okay";
    	#sound-dai-cells = <0>;
    
    	pinctrl-names = "default";
    	pinctrl-0 = <&mcasp1_pins_default>;
    
    	op-mode = <0>;          /* MCASP_IIS_MODE */
    	tdm-slots = <2>;
    	auxclk-fs-ratio = <256>;
    
    	serial-dir = <	/* 0: INACTIVE, 1: TX, 2: RX */
    		2 2 1 1
    		0 0 0 0
    		0 0 0 0
    	>;
    	tx-num-evt = <0>;
    	rx-num-evt = <0>;
    };

    Patch to add dt bindings for the snd-soc-dummy-dai:

    • 6.6 kernel:
      From bd51a9362a4f6fddaea59bb10f0178e67a510926 Mon Sep 17 00:00:00 2001
      From: Jared McArthur <j-mcarthur@ti.com>
      Date: Thu, 17 Apr 2025 13:25:13 -0500
      Subject: [PATCH 1/1] ASoC: soc-utils: Add dt bindings for snd-soc-dummy-dai
       codec
      
      Provides a simple-card without codec for testing purposes.
      
      Forward port of a patch from 2015 [1].
      
      [1]: https://patchwork.kernel.org/project/alsa-devel/patch/5652E348.8080002@invoxia.com/
      
      Signed-off-by: Jared McArthur <j-mcarthur@ti.com>
      ---
       sound/soc/soc-utils.c | 10 ++++++++++
       1 file changed, 10 insertions(+)
      
      diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
      index 941ba0639a4e..1cdbecb2f480 100644
      --- a/sound/soc/soc-utils.c
      +++ b/sound/soc/soc-utils.c
      @@ -14,6 +14,7 @@
       #include <sound/pcm.h>
       #include <sound/pcm_params.h>
       #include <sound/soc.h>
      +#include <linux/module.h>
       
       int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots)
       {
      @@ -247,9 +248,18 @@ static int snd_soc_dummy_probe(struct platform_device *pdev)
       	return ret;
       }
       
      +#ifdef CONFIG_OF
      +static const struct of_device_id soc_dummy_ids[] = {
      +	{ .compatible = "linux,snd-soc-dummy", },
      +	{ }
      +};
      +MODULE_DEVICE_TABLE(of, soc_dummy_ids);
      +#endif
      +
       static struct platform_driver soc_dummy_driver = {
       	.driver = {
       		.name = "snd-soc-dummy",
      +		.of_match_table = of_match_ptr(soc_dummy_ids),
       	},
       	.probe = snd_soc_dummy_probe,
       };
      -- 
      2.34.1
      
    • 6.1 kernel: https://patchwork.kernel.org/project/alsa-devel/patch/5652E348.8080002@invoxia.com/ 

    Best,
    Jared

  • Hi 

    Thanks ,that did work

    BR

    liupt