Orin nx, sdk:7.2.1, ubuntu24.04, es8389配置

orin nx, sdk:7.2.1, ubuntu24.01, es8389在i2c总线:gen1_i2c: i2c@3160000上,i2s: tegra_i2s2: i2s@2901100上,i2s2_default的soc_gpio41_ph7等配置确认是OK
dts:
&gen1_i2c {
status = “okay”;
clock-frequency = <100000>;

es8389: es8389@10 {
    compatible = "everest,es8389";
    reg = <0x10>;
    #sound-dai-cells = <0>;
    status = "okay";

    clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>;
    clock-names = "mclk";

    AVDD-supply = <&vdd_3v3_audio>;
    DVDD-supply = <&vdd_1v8_audio>;
    PVDD-supply = <&vdd_1v8_audio>;

    port {
        es8389_ep: endpoint {
            remote-endpoint = <&i2s2_dap>;
            link-name = "es8389-playback";
        };
    };
};

};

&pinmux {
status = “okay”;

i2s2_default: i2s2_default {
    sclk_pin {
        nvidia,pins = "soc_gpio41_ph7";
        nvidia,function = "i2s2";
        nvidia,pull = <TEGRA_PIN_PULL_NONE>;
        nvidia,tristate = <TEGRA_PIN_DISABLE>;
        nvidia,enable-input = <TEGRA_PIN_DISABLE>;
    };
    dout_pin {
        nvidia,pins = "soc_gpio42_pi0";
        nvidia,function = "i2s2";
        nvidia,pull = <TEGRA_PIN_PULL_NONE>;
        nvidia,tristate = <TEGRA_PIN_DISABLE>;
        nvidia,enable-input = <TEGRA_PIN_DISABLE>;
    };
    fs_pin {
        nvidia,pins = "soc_gpio44_pi2";
        nvidia,function = "i2s2";
        nvidia,pull = <TEGRA_PIN_PULL_NONE>;
        nvidia,tristate = <TEGRA_PIN_DISABLE>;
        nvidia,enable-input = <TEGRA_PIN_DISABLE>;
    };
    din_pin {
        nvidia,pins = "soc_gpio43_pi1";
        nvidia,function = "i2s2";
        nvidia,pull = <TEGRA_PIN_PULL_NONE>;
        nvidia,tristate = <TEGRA_PIN_DISABLE>;
        nvidia,enable-input = <TEGRA_PIN_ENABLE>;
    };
    mclk_pin {
        nvidia,pins = "soc_gpio59_pac6";
        nvidia,function = "aud";
        nvidia,pull = <TEGRA_PIN_PULL_NONE>;
        nvidia,tristate = <TEGRA_PIN_DISABLE>;
        nvidia,enable-input = <TEGRA_PIN_DISABLE>;
    };
};

};

&tegra_i2s2 {
status = “okay”;
#sound-dai-cells = <1>;
pinctrl-names = “default”;
pinctrl-0 = <&i2s2_default>;
assigned-clocks = <&bpmp TEGRA234_CLK_I2S2>;
assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
sound-name-prefix = “I2S2”;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = “disabled”;
};

    i2s2_port: port@1 {
        reg = <1>;
        i2s2_dap: endpoint {
            remote-endpoint = <&es8389_ep>;
            bitclock-master;
            frame-master;
        };
    };
};

};

&tegra_sound {
compatible = “nvidia,tegra186-audio-graph-card”;
status = “okay”;
label = “NVIDIA Jetson Orin ES8389”;

clocks = <&bpmp TEGRA234_CLK_PLLA>,
         <&bpmp TEGRA234_CLK_PLLA_OUT0>,
         <&bpmp TEGRA234_CLK_AUD_MCLK>;
clock-names = "pll_a", "plla_out0", "extern1";

assigned-clocks = <&bpmp TEGRA234_CLK_PLLA>,
                  <&bpmp TEGRA234_CLK_PLLA_OUT0>,
                  <&bpmp TEGRA234_CLK_AUD_MCLK>;
assigned-clock-parents = <0>,
                         <&bpmp TEGRA234_CLK_PLLA>,
                         <&bpmp TEGRA234_CLK_PLLA_OUT0>;
assigned-clock-rates = <983040000>,   /* PLLA 精确频率 */
                       <49152000>,    /* PLLA_OUT0 = PLLA / 20 */
                       <12288000>;    /* AUD_MCLK = PLLA_OUT0 / 4 */

nvidia-audio-card,name = "NVIDIA Jetson AGX Orin ES8389";

nvidia-audio-card,widgets =
    "Headphone", "ES8389 Headphone Jack",
    "Speaker", "ES8389 Speaker Jack",
    "Microphone", "ES8389 Mic Jack";

nvidia-audio-card,routing =
"ADMAIF2 XBAR-Playback", "ADMAIF2 Playback",
"ADMAIF2 Capture",       "ADMAIF2 XBAR-Capture",

"I2S2 XBAR-Playback",    "ADMAIF2 XBAR-Playback",
"ADMAIF2 XBAR-Capture",  "I2S2 XBAR-Capture",

"I2S2 RX",               "I2S2 XBAR-Playback",
"I2S2 XBAR-Capture",     "I2S2 TX",

"I2S IN",                "I2S2 DAP-Playback",
"I2S2 DAP-Capture",      "I2S OUT",

"ES8389 Headphone Jack", "HPOL",
"ES8389 Headphone Jack", "HPOR",
"ES8389 Speaker Jack",   "HPOL",
"ES8389 Speaker Jack",   "HPOR",
"ES8389 Mic Jack",       "INPUT1",
"ES8389 Mic Jack",       "INPUT2";

};

&{/bus@0/aconnect@2900000} {
status = “okay”;
};

&tegra_ahub {
status = “okay”;
};

&admaif2_port {
status = “okay”;
};

&i2s2_port {
status = “okay”;
};

&agic {
status = “okay”;
power-domains = <&bpmp TEGRA234_POWER_DOMAIN_AUD>;
};

&adma {
status = “okay”;
};

&tegra_admaif {
status = “okay”;
};
声卡没出来:
root@wel-tegra:/home/wel# cat /proc/asound/cards
0 [HDA ]: tegra-hda - NVIDIA Jetson Orin NX HDA
NVIDIA Jetson Orin NX HDA at 0x3518000 irq 208
root@wel-tegra:/home/wel# dmesg | grep -i “ASoC\|es8389\|i2s2\|audio-graph\|2901100”
[ 0.025901] /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100: Fixed dependency cycle(s) with /bus@0/i2c@3160000/es8389@10
[ 0.026147] /bus@0/i2c@3160000/es8389@10: Fixed dependency cycle(s) with /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100
[ 0.026930] /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100: Fixed dependency cycle(s) with /bus@0/i2c@3160000/es8389@10
[ 0.027702] /bus@0/i2c@3160000/es8389@10: Fixed dependency cycle(s) with /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100
[ 4.558511] /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100: Fixed dependency cycle(s) with /bus@0/i2c@3160000/es8389@10
[ 4.568409] /bus@0/i2c@3160000/es8389@10: Fixed dependency cycle(s) with /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100
[ 10.465343] Enter into es8389_i2c_probe
[ 10.466665] es8389 0-0010: es8389_i2c_probe() chip id 0x83 89
[ 10.466722] Enter into es8389_i2c_probe-----4
[ 10.466729] Exit es8389_i2c_probe
[ 10.650219] /bus@0/aconnect@2900000/ahub@2900800: Fixed dependency cycle(s) with /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100
[ 11.162880] /bus@0/aconnect@2900000/ahub@2900800: Fixed dependency cycle(s) with /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100
[ 11.507574] Enter into es8389_probe()
[ 11.532974] es8389_set_dai_sysclk: clk_id=0, freq=49151953
[ 11.532989] es8389 0-0010: ASoC: error at snd_soc_dai_set_sysclk on ES8389 HiFi: -22
[ 11.534133] es8389 0-0010: simple-card: set_sysclk error
[ 11.536460] es8389-playback: ASoC: error at snd_soc_link_init on es8389-playback: -22
[ 11.539316] Enter into es8389_remove()
[ 12.094095] tegra-audio-graph-card sound: error -EINVAL: parse error
[ 12.095121] tegra-audio-graph-card: probe of sound failed with error -22
dts 如何修改

pinmux/I2C are probably fine. The broken piece is the 7.x graph-card migration: wrong property names plus ES8389 receiving 49.152 MHz sysclk. Fix ES8389 MCLK to 12.288 MHz and use label/
widgets/routing + proper graph endpoints.

For reference: codec integration and refer sound node definition .

dts调整如下:
&gen1_i2c {
status = “okay”;
clock-frequency = <100000>;

es8389: es8389@10 {
    compatible = "everest,es8389";
    reg = <0x10>;
    #sound-dai-cells = <0>;
    status = "okay";

    clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>;
    clock-names = "mclk";

    AVDD-supply = <&vdd_3v3_audio>;
    DVDD-supply = <&vdd_1v8_audio>;
    PVDD-supply = <&vdd_1v8_audio>;

    port {
        es8389_ep: endpoint {
            remote-endpoint = <&i2s2_dap>;
            link-name = "es8389-playback";
        };
    };
};

};
&tegra_i2s2 {
status = “okay”;
#sound-dai-cells = <1>;
pinctrl-names = “default”;
pinctrl-0 = <&i2s2_default>;
assigned-clocks = <&bpmp TEGRA234_CLK_I2S2>;
assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
sound-name-prefix = “I2S2”;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = “disabled”;
};

    i2s2_port: port@1 {
        reg = <1>;
        i2s2_dap: endpoint {
            remote-endpoint = <&es8389_ep>;
            bitclock-master;
            frame-master;
        };
    };
};

};

&tegra_sound {
compatible = “nvidia,tegra186-audio-graph-card”;
status = “okay”;
label = “NVIDIA Jetson Orin ES8389”;

clocks = <&bpmp TEGRA234_CLK_PLLA>,
         <&bpmp TEGRA234_CLK_PLLA_OUT0>,
         <&bpmp TEGRA234_CLK_AUD_MCLK>;
clock-names = "pll_a", "plla_out0", "extern1";

assigned-clocks = <&bpmp TEGRA234_CLK_PLLA>,
                  <&bpmp TEGRA234_CLK_PLLA_OUT0>,
                  <&bpmp TEGRA234_CLK_AUD_MCLK>;
assigned-clock-parents = <0>,
                         <&bpmp TEGRA234_CLK_PLLA>,
                         <&bpmp TEGRA234_CLK_PLLA_OUT0>;
assigned-clock-rates = <983040000>,  
                       <49152000>,    
                       <12288000>;    

nvidia-audio-card,name = "NVIDIA Jetson AGX Orin ES8389";

   nvidia-audio-card,widgets =
    "Headphone", "ES8389 Headphone Jack",
    "Speaker", "ES8389 Speaker Jack",
    "Microphone", "ES8389 Mic Jack";

nvidia-audio-card,routing =
    "ADMAIF2 XBAR-Playback", "ADMAIF2 Playback",
    "ADMAIF2 Capture",       "ADMAIF2 XBAR-Capture",

    "I2S2 XBAR-Playback",    "ADMAIF2 XBAR-Playback",
    "ADMAIF2 XBAR-Capture",  "I2S2 XBAR-Capture",

    "I2S2 CIF-Playback",     "I2S2 XBAR-Playback",
    "I2S2 XBAR-Capture",     "I2S2 CIF-Capture",

    "I2S IN",                "I2S2 SPK",
    "I2S2 MIC",              "I2S OUT";

};

es8389.txt (37.4 KB)

声卡能出来,但es8389没有初始化完成,es8389_pcm_hw_params等没调用:
root@wel-tegra:/home/wel# cat /proc/asound/cards
0 [HDA ]: tegra-hda - NVIDIA Jetson Orin NX HDA
NVIDIA Jetson Orin NX HDA at 0x3518000 irq 205
1 [ES8389 ]: tegra-ape - NVIDIA Jetson Orin ES8389
NVIDIA-NVIDIAJetsonOrinNXEngineeringReferenceDeveloperKit-NotSpecified-Jetson
root@wel-tegra:/home/wel# dmesg | grep -i “ASoC|es8389|i2s2|audio-graph|2901100”
[ 4.553495] /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100: Fixed dependency cycle(s) with /bus@0/i2c@3160000/es8389@10
[ 4.562153] /bus@0/i2c@3160000/es8389@10: Fixed dependency cycle(s) with /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100
[ 10.304988] Enter into es8389_i2c_probe
[ 10.305958] es8389 0-0010: es8389_i2c_probe() chip id 0x83 89
[ 10.306021] Enter into es8389_i2c_probe-----4
[ 10.306029] Exit es8389_i2c_probe
[ 10.621309] /bus@0/aconnect@2900000/ahub@2900800: Fixed dependency cycle(s) with /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100
[ 11.196807] /bus@0/aconnect@2900000/ahub@2900800: Fixed dependency cycle(s) with /bus@0/aconnect@2900000/ahub@2900800/i2s@2901100
[ 11.502112] Enter into es8389_probe()
[ 11.525750] es8389_set_dai_sysclk: clk_id=0, freq=12287988, dir=0, old=0
[ 11.525761] Enter into es8389_set_dai_fmt(), fmt=0x4001
[ 11.538914] tegra-audio-graph-card sound: Registered APE graph sound card with DPCM links for AHUB

Property names are not correct, please fix them as mentioned earlier in the comment. It has to like

		label = "NVIDIA Jetson AGX Orin APE";

		widgets = 

		routing = 

Routing shouldn’t have ADMAIF2 and I2S 2 paths, only update below with Tegra I2S being used and codec DAI name. Remaining will be as per the codec route.

			  "CVB-RT AIF1 Playback",	"I2S1 DAP-Playback",
			  "I2S1 DAP-Capture",		"CVB-RT AIF1 Capture",