Orin nano jetpack5.1.5 how to es8316

dts使用// SPDX-License-Identifier: GPL-2.0-only /* * Common Audio DT bindings * * Copyright (c) 2022-2024, 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”; }; adsp_audio { status = “disabled”; }; }; ahub { status = “okay”; i2s@2901100 { status = “okay”; nvidia,dai-format = “i2s”; // 明确指定 I2S 格式 nvidia,mode = “master”; // 控制器为主模式,codec 为从模式 }; }; hda@3510000 { nvidia,model = “NVIDIA Jetson Orin NX HDA”; status = “okay”; }; //hdr40_i2c1: i2c@c250000 { }; i2c2_i2c0: i2c@3160000 { es8316_codec: es8316@10 { #sound-dai-cells = <0>; compatible = “everest,es8316”; reg = <0x10>; clocks = <&bpmp_clks TEGRA234_CLK_AUD_MCLK>; clock-names = “mclk”; assigned-clocks = <&bpmp_clks TEGRA234_CLK_AUD_MCLK>; assigned-clock-rates = <12288000>; status = “okay”; }; }; tegra_sound: sound { status = “okay”; compatible = “nvidia,tegra186-ape”; nvidia-audio-card,name = “NVIDIA Jetson Orin NX APE”; 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>; //assigned-clock-rates = <0>, <11289600>; nvidia-audio-card,widgets = “Headphone”, “ES Headphone Jack”, “Microphone”, “ES Mic Jack”, “Speaker”, “ES Int Spk”, “Microphone”, “ES Int Mic”; nvidia-audio-card,routing = “ES Headphone Jack”, “ES HPOL”, “ES Headphone Jack”, “ES HPOR”, “ES MIC1”, “ES Mic Jack”, “ES MIC2”, “ES Mic Jack”, “ES DMIC”, “ES Int Mic”; //nvidia-audio-card,widgets = // “Line”, “ti Line Out”; //nvidia-audio-card,routing = // “ti Line Out”, “ti Playback”, // “ti Playback”, “ti OUT”; nvidia-audio-card,mclk-fs = <256>; }; 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 { }; // add by xiaoz //Specific overrides for I2S2 DAI link */ &i2s2_to_codec { link-name = “es8316-playback”; codec { sound-dai = <&es8316_codec>; prefix = “ES”; }; }; /* Audio graph related bindings */ hdr40_snd_i2s_dap_ep: &i2s2_dap_ep { }; jetson orin nano开发板ubuntu20 jetpack5.1.5 报错[ 71.595048] tegra-xudc 3550000.xudc: failed to get usbphy-0: -517 [ 72.025666] es8316 0-0010: ASoC: error at snd_soc_dai_hw_params on ES8316 HiFi: -22 [ 72.033626] tegra-asoc: sound: ASoC: PRE_PMU: es8316-playback-capture event failed: -22 [ 72.154084] es8316 0-0010: ASoC: error at snd_soc_dai_hw_params on ES8316 HiFi: -22 [ 72.161993] tegra-asoc: sound: ASoC: PRE_PMU: es8316-playback-playback event failed: -22 [ 72.176549] es8316 0-0010: ASoC: error at snd_soc_dai_hw_params on ES8316 HiFi: -22 [ 72.184450] tegra-asoc: sound: ASoC: PRE_PMU: es8316-playback-capture event failed: -22 [ 72.206462] es8316 0-0010: ASoC: error at snd_soc_dai_hw_params on ES8316 HiFi: -22 [ 72.214368] tegra-asoc: sound: ASoC: PRE_PMU: es8316-playback-playback event failed: -22 [ 72.328540] es8316 0-0010: ASoC: error at snd_soc_dai_hw_params on ES8316 HiFi: -22 [ 72.336456] tegra-asoc: sound: ASoC: PRE_PMU: es8316-playback-capture event failed: -22 且只有mclk一直有信号,另外播放的时候i2s0_sclk\i2s0_fs\i2s0_din都没有信号i2s0_dout有信号

Did you had a chance to check the Audio Setup and Development — NVIDIA Jetson Linux Developer Guide 1 documentation for audio related changes to be done on JP5.1.5/35.6.2 ?

Could you please share the changes you made to the DT and any other modifications, and also the dmesg log?
You may refer to Orin NX es8316 audio playback not work for DT changes…

tegra234-mb1-bct-pinmux-p3767-dp-a03.txt (65.8 KB)

tegra234-p3767-common-audio.txt (8.1 KB)

dmesg.txt (71.0 KB)

I mainly modified the pinmux, enabled the aud_mclk and four i2s2 interfaces, and made changes to tegra234-p3767-common-audio.dtsi. I haven’t changed anything else. Thank you for your response.

I compiled es8316 into a ko file, and after executing insmod snd-soc-es8316.ko, an error occurs, but the sound card shows successful registration. During playback, there is a signal on i2s2_dout, but there are no signals on sclk, lrck, and sdi.

May i know why are you fixing the I2S2 format like below? Can you try removing these settings and share the details of the audio file format and tegra & codec mixer controls settings.

			nvidia,mode = "master";     // 控制器为主模式,codec 为从模式
			nvidia,bit-clock = <12288000>; // æ ¹æ®éœ€è¦è°ƒæ•´
			nvidia,frame-rate = <48000>;
			nvidia,data-width = <16>; // 或24, æ ¹æ®éŸ³é¢‘æ ¼å¼

Removing it doesn’t work either; it feels like there are other places where the settings haven’t been enabled. I added part of the configuration for es8316 in sound/soc/tegra/tegra-codecs.c, which resolved the error of loading the driver mentioned above, but sclk and lrck still have no signal. Could you provide a demo that is compatible with 8316?

  1. tegra_codecs.txt (7.9 KB)amixer -c 1 cset name=“I2S2 Mux” “ADMAIF1”
    amixer -c 1 cset name=“ES Left Headphone Mixer Left DAC Switch” 1
    amixer -c 1 cset name=“ES Right Headphone Mixer Right DAC Switch” 1

If no sclk and lrck that means some issue with pinmux configuration. Who is master in the usecase, codec or tegra i2s?

Change the tristate property to disable in the pinmux dt for below nodes to make clock pins bidirectional,

soc_gpio41_ph7 {
                                 ….
                             	nvidia,tristate = <TEGRA_PIN_DISABLE>;
};

soc_gpio44_pi2 {
                                 ….
                             	nvidia,tristate = <TEGRA_PIN_DISABLE>;
};

tegra234-mb1-bct-pinmux-p3767-dp-a03.txt (65.8 KB) It still has no signal even after adjustments pinmux.

Please provide the output of

$  cat /sys/kernel/debug/pinctrl/<addr>.pinmux/pinconf-groups > ~/pinmux_<addr>

Okay, please wait a moment, I am re-flashing the firmware.

pinmux_zdz.txt (41.8 KB)There is a signal on sclk and lrck while playing audio now, but there is no sound from the headphones and speakers.

It seems that the current quantity of i2s_sclk is only around 1.4, which does not meet mclk/4; could this be the reason for no sound output? How can this be corrected?

Hi,

问题已经解决,谢谢