Codec chip can not speak normally

I am debugging my own codec chip on orin nx, the system version is jetpack5.1.2. I hope it can play sound, the codec structure is as follows.

Hardware connection

I connected the codec to the 40-pin i2s and connected I2C to I2C1.

Software configuration

The device tree is configured as follows, mainly the modification of I2c and I2s.

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Common Audio DT bindings
 *
 * Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 *
 */

#include <audio/tegra-platforms-audio-dai-links.dtsi>
#include <audio/tegra186-audio-dai-links.dtsi>
#include <audio/tegra186-audio-graph.dtsi>

/ {
    aconnect@2a41000 {
    agic-controller@2a41000 {
    status = "okay";
    };

    adsp@2993000 {
    status = "okay";
    };

    ahub {
    status = "okay";
    /* I2S1 in Short frame sync for BT SCO */
    //i2s@2901000 {
    //      status = "okay";
    //fsync-width = <0>;
    //bclk-ratio = <4>;
    //};
    i2s@2901100 {
    status = "okay";
    };
    // i2s@2901300 {
    //     status = "okay";
    // };
    };

    };

    hda@3510000 {
    nvidia,model = "NVIDIA Jetson Orin NX HDA";
    status = "okay";
    };

    hdr40_i2c1: i2c@c250000 { 
    status = "okay";

    aw_smartpa_dai_name: aw882xx_smartpa@34 {
    compatible = "awinic,aw882xx_smartpa";
    #sound-dai-cells = <0>; 
    reg = <0x34>;
    irq-gpio = <&tegra_main_gpio TEGRA234_MAIN_GPIO(H, 0) GPIO_ACTIVE_LOW>;
    status = "okay";
    };

    };

    tegra_sound: sound {
    status = "okay";
    compatible = "nvidia,tegra186-ape";
    nvidia-audio-card,name = "NVIDIA Jetson Orin NX APE";
    // nvidia-audio-card,widgets =
    //     "Headphone", "CVB-RT Headphone Jack",
    //     "Microphone", "CVB-RT Mic Jack",
    //     "Speaker", "CVB-RT Int Spk",
    //     "Microphone", "CVB-RT Int Mic";
    // nvidia-audio-card,routing =
    //     "CVB-RT Headphone Jack",     "CVB-RT HPOL",
    //     "CVB-RT Headphone Jack",     "CVB-RT HPOR",
    //     "CVB-RT IN1P",               "CVB-RT Mic Jack",
    //     "CVB-RT IN2P",               "CVB-RT Mic Jack",
    //     "CVB-RT Int Spk",            "CVB-RT SPOLP",
    //     "CVB-RT Int Spk",            "CVB-RT SPORP",
    //     "CVB-RT DMIC1",              "CVB-RT Int Mic",
    //     "CVB-RT DMIC2",              "CVB-RT Int Mic";

    nvidia-audio-card,mclk-fs = <256>;

    clocks = <&bpmp_clks TEGRA234_CLK_PLLA>,
     <&bpmp_clks TEGRA234_CLK_PLLA_OUT0>,
     <&bpmp_clks TEGRA234_CLK_AUD_MCLK>;
    clock-names = "pll_a", "pll_a_out0", "extern1";
    assigned-clocks = <&bpmp_clks TEGRA234_CLK_PLLA_OUT0>,
      <&bpmp_clks TEGRA234_CLK_AUD_MCLK>;
    assigned-clock-parents = <&bpmp_clks TEGRA234_CLK_PLLA>,
     <&bpmp_clks TEGRA234_CLK_PLLA_OUT0>;
    };

    tegra_sound_graph: sound_graph {
    compatible = "nvidia,tegra186-audio-graph-card";

    /*
     * Tegra audio graph card is based on uptream generic audio
     * graph sound card. In future there is plan to use this
     * as default sound card.
     */
    status = "disabled";

    dais = /* ADMAIF (FE) Ports */
           <&admaif1_port>, <&admaif2_port>, <&admaif3_port>,
           <&admaif4_port>, <&admaif5_port>, <&admaif6_port>,
           <&admaif7_port>, <&admaif8_port>, <&admaif9_port>,
           <&admaif10_port>, <&admaif11_port>, <&admaif12_port>,
           <&admaif13_port>, <&admaif14_port>, <&admaif15_port>,
           <&admaif16_port>, <&admaif17_port>, <&admaif18_port>,
           <&admaif19_port>, <&admaif20_port>,

           /* ADSP (FE) Ports */
           <&adsp_pcm1_port>, <&adsp_pcm2_port>,
           <&adsp_compr1_port>, <&adsp_compr2_port>,

           /* XBAR I/O ports */
           <&xbar_i2s1_port>, <&xbar_i2s2_port>, <&xbar_i2s3_port>,
           <&xbar_i2s4_port>, <&xbar_i2s5_port>, <&xbar_i2s6_port>,

           <&xbar_dmic1_port>, <&xbar_dmic2_port>,
           <&xbar_dmic3_port>, <&xbar_dmic4_port>,

           <&xbar_dspk1_port>, <&xbar_dspk2_port>,

           /* XBAR HW accelerator ports */
           <&xbar_sfc1_in_port>, <&xbar_sfc2_in_port>,
           <&xbar_sfc3_in_port>, <&xbar_sfc4_in_port>,

           <&xbar_mvc1_in_port>, <&xbar_mvc2_in_port>,

           <&xbar_afc1_in_port>, <&xbar_afc2_in_port>,
           <&xbar_afc3_in_port>, <&xbar_afc4_in_port>,
           <&xbar_afc5_in_port>, <&xbar_afc6_in_port>,

           <&xbar_asrc_in1_port>, <&xbar_asrc_in2_port>,
           <&xbar_asrc_in3_port>, <&xbar_asrc_in4_port>,
           <&xbar_asrc_in5_port>, <&xbar_asrc_in6_port>,
           <&xbar_asrc_in7_port>, <&xbar_arad_port>,

           <&xbar_mixer_in1_port>, <&xbar_mixer_in2_port>,
           <&xbar_mixer_in3_port>, <&xbar_mixer_in4_port>,
           <&xbar_mixer_in5_port>, <&xbar_mixer_in6_port>,
           <&xbar_mixer_in7_port>, <&xbar_mixer_in8_port>,
           <&xbar_mixer_in9_port>, <&xbar_mixer_in10_port>,

           <&xbar_ope1_in_port>,

           <&xbar_amx1_in1_port>, <&xbar_amx1_in2_port>,
           <&xbar_amx1_in3_port>, <&xbar_amx1_in4_port>,
           <&xbar_amx2_in1_port>, <&xbar_amx2_in2_port>,
           <&xbar_amx2_in3_port>, <&xbar_amx2_in4_port>,
           <&xbar_amx3_in1_port>, <&xbar_amx3_in2_port>,
           <&xbar_amx3_in3_port>, <&xbar_amx3_in4_port>,
           <&xbar_amx4_in1_port>, <&xbar_amx4_in2_port>,
           <&xbar_amx4_in3_port>, <&xbar_amx4_in4_port>,

           <&xbar_adx1_in_port>, <&xbar_adx2_in_port>,
           <&xbar_adx3_in_port>, <&xbar_adx4_in_port>,

           /* BE I/O Ports */
           <&i2s1_port>, <&i2s2_port>, <&i2s3_port>,
           <&i2s4_port>, <&i2s5_port>, <&i2s6_port>,

           <&dmic1_port>, <&dmic2_port>, <&dmic3_port>,
           <&dmic4_port>,

           <&dspk1_port>, <&dspk2_port>,

           /* BE HW accelerator ports */
           <&sfc1_out_port>, <&sfc2_out_port>,
           <&sfc3_out_port>, <&sfc4_out_port>,

           <&mvc1_out_port>, <&mvc2_out_port>,

           <&afc1_out_port>, <&afc2_out_port>,
           <&afc3_out_port>, <&afc4_out_port>,
           <&afc5_out_port>, <&afc6_out_port>,

           <&asrc_out1_port>, <&asrc_out2_port>,
           <&asrc_out3_port>, <&asrc_out4_port>,
           <&asrc_out5_port>, <&asrc_out6_port>,

           <&mixer_out1_port>, <&mixer_out2_port>,
           <&mixer_out3_port>, <&mixer_out4_port>,
           <&mixer_out5_port>,

           <&ope1_out_port>,

           <&amx1_out_port>, <&amx2_out_port>,
           <&amx3_out_port>, <&amx4_out_port>,

           <&adx1_out1_port>, <&adx1_out2_port>,
           <&adx1_out3_port>, <&adx1_out4_port>,
           <&adx2_out1_port>, <&adx2_out2_port>,
           <&adx2_out3_port>, <&adx2_out4_port>,
           <&adx3_out1_port>, <&adx3_out2_port>,
           <&adx3_out3_port>, <&adx3_out4_port>,
           <&adx4_out1_port>, <&adx4_out2_port>,
           <&adx4_out3_port>, <&adx4_out4_port>,

           /* ADSP related ports */
           <&adsp_admaif1_port>, <&adsp_admaif2_port>,
           <&adsp_admaif3_port>, <&adsp_admaif4_port>,
           <&adsp_admaif5_port>, <&adsp_admaif6_port>,
           <&adsp_admaif7_port>, <&adsp_admaif8_port>,
           <&adsp_admaif9_port>, <&adsp_admaif10_port>,
           <&adsp_admaif11_port>, <&adsp_admaif12_port>,
           <&adsp_admaif13_port>, <&adsp_admaif14_port>,
           <&adsp_admaif15_port>, <&adsp_admaif16_port>,
           <&adsp_admaif17_port>, <&adsp_admaif18_port>,
           <&adsp_admaif19_port>, <&adsp_admaif20_port>,

           <&admaif1_codec_port>, <&admaif2_codec_port>,
           <&admaif3_codec_port>, <&admaif4_codec_port>,
           <&admaif5_codec_port>, <&admaif6_codec_port>,
           <&admaif7_codec_port>, <&admaif8_codec_port>,
           <&admaif9_codec_port>, <&admaif10_codec_port>,
           <&admaif11_codec_port>, <&admaif12_codec_port>,
           <&admaif13_codec_port>, <&admaif14_codec_port>,
           <&admaif15_codec_port>, <&admaif16_codec_port>,
           <&admaif17_codec_port>, <&admaif18_codec_port>,
           <&admaif19_codec_port>, <&admaif20_codec_port>;

    label = "NVIDIA Jetson Concord APE";

    clocks = <&bpmp_clks TEGRA234_CLK_PLLA>,
     <&bpmp_clks TEGRA234_CLK_PLLA_OUT0>;
    clock-names = "pll_a", "plla_out0";
    assigned-clocks = <&bpmp_clks TEGRA234_CLK_AUD_MCLK>;
    assigned-clock-parents = <&bpmp_clks TEGRA234_CLK_PLLA_OUT0>;
    };
};

hdr40_snd_link_i2s: &i2s2_to_codec { 
    link-name = "aw88261-audio-v1";
    bitclock-master;
    frame-master;
    format = "i2s";

    cpu {
        sound-dai = <&tegra_i2s2 0>;
    };

    codec {
        sound-dai = <&aw_smartpa_dai_name 0>;
        prefix = "CVB-RT";
    };
};

/* Audio graph related bindings */
hdr40_snd_i2s_dap_ep: &i2s2_dap_ep { };

After adding the codec driver, compile the flash, the i2c communication is normal, and the codec driver log also shows that the initialization is completed.
The current problem is that I can’t play sound. I checked the NVIDIA Jetson Orin NX APE through alsamixer. There are many items. I found my custom codec items (those starting with CVB-RT, as defined in the device tree) in many items, and I can also adjust my codec parameters through it.
Normally, my codec will print some logs when it is called (this comes from my codec code), but now there is no log output when playing, and i2s has no waveform. I guess my codec is not called.

Is this a problem with the audio routing?
I am not very familiar with this part, and I hope you can give me some ideas to solve the problem.

My playback command

aplay -D hw:APE,0 1.wav

cat /proc/asound/cards 
 0 [HDA            ]: tegra-hda - NVIDIA Jetson Orin NX HDA
                      NVIDIA Jetson Orin NX HDA at 0x3518000 irq 111
 1 [APE            ]: tegra-ape - NVIDIA Jetson Orin NX APE
                      Unknown-NVIDIAOrinNXDeveloperKit-NotSpecified

some logs:
amixer.log (501.4 KB)
dmesg.log (83.6 KB)
pinmux.log (39.3 KB)

Supplementary content:
When I use the above aplay command to play, the event log is as follows, and it seems that there is no I2S2?

cat /sys/kernel/debug/tracing/trace_pipe | grep \*
           aplay-2051    [001] ....  1845.023151: snd_soc_dapm_path: *ADMAIF1 XBAR-RX <- (direct) <- ADMAIF1 XBAR-Playback
           aplay-2051    [001] ....  1845.023213: snd_soc_dapm_path: *I2S1 Mux <- ADMAIF1 <- ADMAIF1 XBAR-RX
           aplay-2051    [001] ....  1845.023215: snd_soc_dapm_path: *I2S1 XBAR-TX <- (direct) <- I2S1 Mux
           aplay-2051    [001] ....  1845.023217: snd_soc_dapm_path: *I2S1 XBAR-Capture <- (direct) <- I2S1 XBAR-TX
           aplay-2051    [001] ....  1845.023218: snd_soc_dapm_path: *tegra-dlink-64-playback <- (direct) <- I2S1 XBAR-Capture
           aplay-2051    [001] ....  1845.023219: snd_soc_dapm_path: *I2S1 CIF-Playback <- (direct) <- tegra-dlink-64-playback
           aplay-2051    [001] ....  1845.023220: snd_soc_dapm_path: *I2S1 RX <- (direct) <- I2S1 CIF-Playback
           aplay-2051    [001] ....  1845.023221: snd_soc_dapm_path: *I2S1 DAP-Capture <- (direct) <- I2S1 RX
           aplay-2051    [001] ....  1845.023222: snd_soc_dapm_path: *tegra-dlink-76-playback <- (direct) <- I2S1 DAP-Capture
           aplay-2051    [001] ....  1845.023223: snd_soc_dapm_path: *I2S1 Dummy-Playback <- (direct) <- tegra-dlink-76-playback
           aplay-2051    [001] ....  1845.023224: snd_soc_dapm_path: *I2S1 SPK <- (direct) <- I2S1 Dummy-Playback


           aplay-2051    [001] ....  1850.458000: snd_soc_dapm_path: *ADMAIF1 XBAR-Playback <- (direct) <- tegra-dlink-44-playback
           aplay-2051    [001] ....  1850.458001: snd_soc_dapm_path: *ADMAIF1 XBAR-Playback <- (direct) <- ADMAIF1 Playback
           aplay-2051    [001] ....  1850.458003: snd_soc_dapm_path: *ADMAIF1 XBAR-RX <- (direct) <- ADMAIF1 XBAR-Playback
           aplay-2051    [001] ....  1850.458053: snd_soc_dapm_path: *I2S1 Mux <- ADMAIF1 <- ADMAIF1 XBAR-RX
           aplay-2051    [001] ....  1850.458054: snd_soc_dapm_path: *I2S1 XBAR-TX <- (direct) <- I2S1 Mux
           aplay-2051    [001] ....  1850.458055: snd_soc_dapm_path: *I2S1 XBAR-Capture <- (direct) <- I2S1 XBAR-TX
           aplay-2051    [001] ....  1850.458056: snd_soc_dapm_path: *tegra-dlink-64-playback <- (direct) <- I2S1 XBAR-Capture
           aplay-2051    [001] ....  1850.458057: snd_soc_dapm_path: *I2S1 CIF-Playback <- (direct) <- tegra-dlink-64-playback
           aplay-2051    [001] ....  1850.458058: snd_soc_dapm_path: *I2S1 RX <- (direct) <- I2S1 CIF-Playback
           aplay-2051    [001] ....  1850.458059: snd_soc_dapm_path: *I2S1 DAP-Capture <- (direct) <- I2S1 RX
           aplay-2051    [001] ....  1850.458060: snd_soc_dapm_path: *tegra-dlink-76-playback <- (direct) <- I2S1 DAP-Capture
           aplay-2051    [001] ....  1850.458061: snd_soc_dapm_path: *I2S1 Dummy-Playback <- (direct) <- tegra-dlink-76-playback
           aplay-2051    [001] ....  1850.458063: snd_soc_dapm_path: *I2S1 SPK <- (direct) <- I2S1 Dummy-Playback

Sorry for the late response.
Is this still an issue to support? Any result can be shared?

The problem still exists, if you have time, you can research this topic.How to execute the driver code of uda1334 They have the same problem: the codec driver is not executed.

The problem still exists. Can you help me see what else I need to provide for you to troubleshoot?

we got audio working for sgtl codec on Jetson AGX xavier earlier this year.
please see the device tree file attached which worked for us. compare this with your device tree change accordingly and do the changes.

note: you need to enable the coded driver module with “y” or “m” on the defconfig file and flash it so that it is called from the device tree mapping.
tegra194-audio-p2822-0000.txt (16.3 KB)

I tried to add some widgets, but it said that the controls could not be found. Do I need to obtain these controls from the codec vendor?

sudo dmesg |grep ASoC
[sudo] password for zme: 
[   16.633490] tegra-asoc: sound: ASoC: no source widget found for CVB-RT HPO L Playback
[   16.641552] tegra-asoc: sound: ASoC: Failed to add route CVB-RT HPO L Playback -> direct -> CVB-RT Headphone Jack
[   16.652166] tegra-asoc: sound: ASoC: no source widget found for CVB-RT HPO R Playback
[   16.660228] tegra-asoc: sound: ASoC: Failed to add route CVB-RT HPO R Playback -> direct -> CVB-RT Headphone Jack
[   16.670839] tegra-asoc: sound: ASoC: no sink widget found for CVB-RT IN1P
[   16.677818] tegra-asoc: sound: ASoC: Failed to add route CVB-RT Mic Jack -> direct -> CVB-RT IN1P
[   16.686986] tegra-asoc: sound: ASoC: no sink widget found for CVB-RT IN2P
[   16.693967] tegra-asoc: sound: ASoC: Failed to add route CVB-RT Mic Jack -> direct -> CVB-RT IN2P
[   16.705947] tegra-asoc: sound: ASoC: no source widget found for CVB-RT SPO Playback
[   16.716542] tegra-asoc: sound: ASoC: Failed to add route CVB-RT SPO Playback -> direct -> CVB-RT Int Spk
[   16.727007] tegra-asoc: sound: ASoC: no sink widget found for CVB-RT DMIC L1
[   16.734289] tegra-asoc: sound: ASoC: Failed to add route CVB-RT Int Mic -> direct -> CVB-RT DMIC L1
[   16.752674] tegra-asoc: sound: ASoC: no sink widget found for CVB-RT DMIC L2
[   16.765365] tegra-asoc: sound: ASoC: Failed to add route CVB-RT Int Mic -> direct -> CVB-RT DMIC L2
[   16.765395] tegra-asoc: sound: ASoC: no sink widget found for CVB-RT DMIC R1
[   16.779520] tegra-asoc: sound: ASoC: Failed to add route CVB-RT Int Mic -> direct -> CVB-RT DMIC R1
[   16.797971] tegra-asoc: sound: ASoC: no sink widget found for CVB-RT DMIC R2
[   16.811373] tegra-asoc: sound: ASoC: Failed to add route CVB-RT Int Mic -> direct -> CVB-RT DMIC R2

check the data sheet of your audio codec and see, if you have any thing similar entries like them.

If yes then add those names and see… I dont remember adding them from SGTL audio codec datasheet, in our case.

these widgets were already present in the device tree file that we download as part of BSP package.

We did not only customize changes for our audio codec and I2C that was connected.

I think this chip may not need to add these widgets, because I have ported this codec driver on other platforms (rockchip), I just added a simple card and the audio worked fine.

	Awinic-sound {
		compatible = "simple-audio-card";
		simple-audio-card,format = "i2s";
		simple-audio-card,name = "Awinic-codec,Aw88266";
		simple-audio-card,mclk-fs = <256>;

		simple-audio-card,cpu {
			sound-dai = <&i2s0>;
		};
		simple-audio-card,codec {
			sound-dai = <&aw882xx_smartpa_0>;
		};
	}; 

On orin, when I don’t add widgets, the APE sound card is created normally, but when I play music, the codec driver is not called. On the rockchip(another soc we use) platform, when I use aplay to play music, the codec code (the function set in snd_soc_dai_ops) will be called to adjust clk, bit and other information to make PA work. What I am confused about now is how can I adjust or play so that my codec driver can be called when I play?
this is my play cmd

amixer -c APE cset name="I2S2 Mux" ADMAIF2
aplay -D hw:APE,1 <in_wav>

I used uda1334 to simply convert i2s to analog audio signals, but when I ported this codec I encountered this problem

I consulted the codec manufacturer, and the digital amplifier does not need to configure routes and widgets, so now I just need to ensure that the codec code is called when aplay is playing. Can anyone provide a troubleshooting direction? Thank you very much.

you need to enable your codec driver module with “y” or “m” on the defconfig file and flash it so that it is called from the device tree mapping.

I have done this before. What we need to know is that the codec code has been executed during initialization and the initialization is normal, but it is not called when I use the aplay command to play. Therefore, the codec cannot be set correctly for playback.

Already done like this:

obj-y += aw882xx/aw882xx.o \
	aw882xx/aw882xx_monitor.o aw882xx/aw882xx_init.o \
	aw882xx/aw882xx_dsp.o aw882xx/aw882xx_device.o \
	aw882xx/aw882xx_calib.o aw882xx/aw882xx_bin_parse.o \
	aw882xx/aw882xx_spin.o

In the DT that you pasted in comment #1 I see that you have overridden both the cpu DAI and codec DAI under i2s2_to_codec. That is not necessary. Actually it changes the default settings of the cpu DAI. Could you please follow the example in hardware/nvidia/platform/t23x/common/kernel-dts/t234-common-cvb/tegra234-p3711-audio.dtsi and override just the bare minimum what is needed?

This is all the changes in my device tree audio, pinmux has been correctly configured. When I use the play command after this modification, no i2s signal will be generated. If the content inside i2s2_to_codec is deleted, an i2s signal will be generated.
My codec does not need mclk, so I did not add a function similar to tegra_machine_fepi_init in Linux_for_Tegra/sources/kernel/kernel-5.10/sound/soc/tegra/tegra_codecs.c. I wonder if this will affect the codec startup?

--- a/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3767-common-audio.dtsi
+++ b/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3767-common-audio.dtsi
@@ -19,6 +19,14 @@
                adsp@2993000 {
                        status = "okay";
                };
+
+               ahub {
+                       status = "okay";
+                       i2s@2901100 {
+                                       status = "okay";        
+                       };
+               };
+
        };
 
        hda@3510000 {
@@ -26,7 +34,21 @@
                status = "okay";
        };
 
-       hdr40_i2c1: i2c@c250000 { };
+       hdr40_i2c1: i2c@c250000 { 
+               status = "okay";
+
+               aw_smartpa_dai_name: aw882xx_smartpa@34 { /*以 I2C 地址 0x34 为例*/
+                       compatible = "awinic,aw882xx_smartpa";
+                       #sound-dai-cells = <0>; 
+                       reg = <0x34>;
+                       // reset-gpio = <&gpio4 21 0>; /*GPIO4_C5  2*8+5*/  /*aw88230,aw88257,aw88261,aw88265 不能配置*/ 
+                       // irq-gpio = <&gpio0 6 0x0>; /*GPIO0_A6  0*8+6*/
+                       //reset-gpio = <&tegra_main_gpio TEGRA234_MAIN_GPIO(Q, 6) GPIO_ACTIVE_LOW>;
+                       irq-gpio = <&tegra_main_gpio TEGRA234_MAIN_GPIO(H, 0) GPIO_ACTIVE_LOW>;
+                       /*sync-load = <1>;*/ /*固件加载方式,若驱动以 KO 方式编译时,需配置为 1*/
+                       status = "okay";
+               };
+       };
 
        tegra_sound: sound {
                status = "okay";
@@ -183,7 +205,14 @@
        };
 };
 
-hdr40_snd_link_i2s: &i2s2_to_codec { };
+hdr40_snd_link_i2s: &i2s2_to_codec { 
+    link-name = "aw88261-audio-v1";
+
+    codec {
+        sound-dai = <&aw_smartpa_dai_name 0>;
+        prefix = "CVB-RT";
+    };
+};
 
 /* Audio graph related bindings */
 hdr40_snd_i2s_dap_ep: &i2s2_dap_ep { };

We reviewed internally and do not see any issue with the above DT. Are you able to confirm that the codec driver gets probed OK? When starting aplay are the callbacks in the codec driver getting called, or does the kernel throw any error? Please attach kernel log for the error case with the latest DT changes as above.

This is dmesg output:
dmesg.txt (83.3 KB)
when i use aplay, no more dmesg generate.
my cmd:

~$ amixer -c APE cset name="I2S2 Mux" ADMAIF2
~$ aplay -D hw:APE,1 jie_shouxdcq.wav 
Playing WAVE 'jie_shouxdcq.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

No waveform on i2s pin after play.

The codec code has been initialized (starting with awinic in dmesg). After consulting the codec manufacturer, the codec initialization is ok. They think there may be a problem with dai link. Since it is a digital codec, just need to pull up the codec during playback.now aplay cannot make my codec run code.

Is this still an issue to support? Any result can be shared?

In the dmesg I see prints like below:
[ 18.334529] [Awinic][7-0034]aw882xx_set_fmt: fmt=0x4001
[ 18.340009] [Awinic][7-0034]aw882xx_set_fmt: fmt=0x4001

I suppose these are the DAI ops called after start of aplay? Are other ops, like hw_params, getting called? Can you please check if the DAI ops in I2S driver - /kernel/kernel-5.10/sound/soc/tegra/tegra210_i2s.c - are getting called?

After starting aplay, please check the register dump of I2S in /sys/kernel/debug/regmap/, to check if the I2S got enabled. Also the I2S clock rate in /sys/kernel/debug/clk/clk_summary.

This is the operation performed when initializing the codec. No similar log will be generated when using aplay playback.

not called

I’ll check it in a few days.

There is no update from you for a period, assuming this is not an issue anymore.
Hence, we are closing this topic. If need further support, please open a new one.
Thanks

Is this still an issue to support? Any result can be shared?