Hello,
My speaker doesn’t work. I have followed the link below for reference.
But my audio still doesn’t work.
Here is my pin configuration
141 (soc_gpio41_ph7):
pull=0
tristate=0
enable-input=1
open-drain=1
io-reset=1
rcv-sel=1
io-hv=1
schmitt=1
pull-down-strength=31
pull-up-strength=31
drive-type=0
gpio-mode=1
function=i2s2
142 (soc_gpio42_pi0):
pull=0
tristate=0
enable-input=0
open-drain=1
io-reset=1
rcv-sel=1
io-hv=1
schmitt=0
pull-down-strength=31
pull-up-strength=31
drive-type=0
gpio-mode=0
function=i2s2
143 (soc_gpio43_pi1):
pull=1
tristate=1
enable-input=1
open-drain=1
io-reset=1
rcv-sel=1
io-hv=1
schmitt=1
pull-down-strength=31
pull-up-strength=31
drive-type=0
gpio-mode=1
function=i2s2
144 (soc_gpio44_pi2):
pull=0
tristate=0
enable-input=1
open-drain=1
io-reset=1
rcv-sel=1
io-hv=1
schmitt=1
pull-down-strength=31
pull-up-strength=31
drive-type=0
gpio-mode=0
function=i2s2
161 (soc_gpio59_pac6):
pull=2
tristate=0
enable-input=0
open-drain=0
io-reset=0
rcv-sel=0
io-hv=0
schmitt=0
pull-down-strength=31
pull-up-strength=31
drive-type=0
gpio-mode=1
function=aud
Also. here is my dts which is disassembleb from tegra234-p3768-0000+p3767-0003-nv.dtb
f.txt (321.2 KB)
Do I miss something or make wrong steps to cause my audio doesn’t work? Please help me. Thank you so much.
My OS version is r36.4.0
Did you check probing the various I2S related signals and clock?
are they working fine.
Did you configure the amixer controls correctly before playing the audio wav file?
Hello,
I’m not able to play any audio files. Because my APE card is gone.
I followed the article to add nvidia-audio-card,dai-link@77 under sound { }, then the APE card is gone. If I remove this, the APE card will be back.
nvidia-audio-card,dai-link@77{
link-name = "rt5640-playback";
codec {
sound-dai = <&rt5640 0>;
prefix = "CVB-RT";
};
};
I don’t get the same result by following the article’s suggestion…
By the way, I’m working on my board. Not the Orin Nano developer kit.
I noticed that I didn’t give #sound-dai-cells = <1> in rt5640: audio-codec@1c { }.
After giving a sound-dai-cells, the APE is showing up.
1 Like
rituc
April 1, 2025, 6:16am
7
Hi @ruei_chang ,
Thank you for confirming the successful registration of the APE card.
If you experience any further issues, please let us know.
I take the command below to test my speaker.
speaker-test -D hw:“APE”,0 -r 48000 -c 2 -F S16_LE -t sine -f 1000
I can see the speaker-test is running. But the speaker still doesn’t work. I checked the signal. I2S2 didn’t output.
Here is my dts content, do I need to modify anything I2S2 output?
i2s@2901100 {
status = "okay";
ports {
port@1 {
endpoint {
dai-format = "i2s";
remote-endpoint = <&rt5640_ep>;
};
};
};
};
rt5640: audio-codec@1c {
compatible = "realtek,rt5640";
#sound-dai-cells = <1>;
reg = <0x1c>;
interrupt-parent = <&gpio_aon>;
interrupts = <TEGRA234_AON_GPIO(CC, 3) GPIO_ACTIVE_HIGH>;
clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>;
clock-frequency = <11289600>;
clock-names = "mclk";
realtek,dmic1-data-pin = <RT5640_DMIC1_DATA_PIN_NONE>;
realtek,dmic2-data-pin = <RT5640_DMIC2_DATA_PIN_NONE>;
realtek,jack-detect-source = <RT5640_JD_SRC_HDA_HEADER>;
sound-name-prefix = "CVB-RT";
port {
rt5640_ep: endpoint {
remote-endpoint = <&i2s2_dap>;
mclk-fs = <256>;
link-name = "rt5640-playback";
};
};
};
sound {
status = "okay";
//ruei add for i2s2, refer from tegra234-soc-audio-dai-links.dtsi
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,dai-link@77 {
link-name = "rt5640-playback";
codec {
sound-dai = <&rt5640 0>;
prefix = "CVB-RT";
};
};
};
By the way, Can you teach me how to implement correct configurations of nvidia-audio-card,widgets, nvidia-audio-card,routing?
I have Qualcomm and Mediatek porting experience. In my understanding, there should be a block diagram of Audio path for reference to design the audio routing. Does Orin Nano have the same things?
I saw there is a Audio Setup and Development, but I still don’t understand why the configuration of widgets and routing like this
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 HPO L Playback",
"CVB-RT Headphone Jack", "CVB-RT HPO R Playback",
"CVB-RT IN1P", "CVB-RT Mic Jack",
"CVB-RT IN2P", "CVB-RT Mic Jack",
"CVB-RT Int Spk", "CVB-RT SPO Playback",
"CVB-RT DMIC L1", "CVB-RT Int Mic",
"CVB-RT DMIC L2", "CVB-RT Int Mic",
"CVB-RT DMIC R1", "CVB-RT Int Mic",
"CVB-RT DMIC R2", "CVB-RT Int Mic";
Hello,
I have tried several way to set configuration of APE. But there is no sound at all. I checked the I2S2 signal, it still doesn’t output anything. BTW, The AUD_MCLK is working.
amixer -qc “APE” cset name=“I2S2 Mux” “ADMAIF1”
amixer -qc “APE” cset name=“CVB-RT DAC MIXL INF1 Switch” “on”
amixer -qc “APE” cset name=“CVB-RT DAC MIXR INF1 Switch” “on”
amixer -qc “APE” cset name=“CVB-RT Stereo DAC MIXL DAC L1 Switch” “on”
amixer -qc “APE” cset name=“CVB-RT Stereo DAC MIXR DAC R1 Switch” “on”
amixer -qc “APE” cset name=“CVB-RT LOUT MIX DAC L1 Switch” “on”
amixer -qc “APE” cset name=“CVB-RT LOUT MIX DAC R1 Switch” “on”
amixer -qc “APE” cset name=“CVB-RT DAC1 Playback Volume” “175,175”
amixer -qc “APE” cset name=“CVB-RT OUT Playback Switch” “on”
amixer -qc “APE” cset name=“CVB-RT OUT Playback Volume” “31”
Actually, I don’t know why I need to set these variables above. Is there a complete explanation for it?
root@tegra-ubuntu:/home/ubuntu# aplay -D hw:“APE”,0 example.wav
Playing WAVE ‘example.wav’ : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
[ 97.863083] rt5640 0-001c: Unsupported clock setting 44100 for DAI 0
[ 97.863096] rt5640 0-001c: ASoC: error at snd_soc_dai_hw_params on rt5640-aif1: -22
[ 97.863102] tegra-asoc: sound: ASoC: PRE_PMU: rt5640-playback-playback event failed: -22
Do I have wrong configuration of nvidia-audio-card,dai-link@77?
Hello,
I tried another suggestion to set APE
amixer -c APE cset name=“I2S2 Mux” “ADMAIF2”
amixer -c APE cset name=“ADMAIF2 Mux” “I2S2”
amixer -c APE cset name=“CVB-RT Speaker Playback Volume” 30
amixer -c APE cset name=“CVB-RT HP Playback Volume” 30
amixer -c APE cset name=“CVB-RT Stereo DAC MIXR DAC R1 Switch” “on”
amixer -c APE cset name=“CVB-RT Stereo DAC MIXL DAC L1 Switch” “on”
amixer -c APE cset name=“CVB-RT HP R Playback Switch” “on”
And aplay -D hw:“APE”,0 example.wav doesn’t show error message. I2S2 is still no signal.
I found another article.
Hi lcc0610,
Can you give a try by setting below commands before starting the playback.
#For speaker playback
amixer -c 1 cset name="x Stereo DAC MIXL DAC L1 Switch" "1"
amixer -c 1 cset name="x Stereo DAC MIXR DAC R1 Switch" "1"
amixer -c 1 cset name="x Speaker L Playback Switch" "1"
amixer -c 1 cset name="x Speaker R Playback Switch" "1"
amixer -c 1 cset name="x SPOL MIX SPKVOL L Switch" "1"
amixer -c 1 cset name="x SPOR MIX SPKVOL R Switch" "1"
amixe…
And I executed the commands below. But i2s2 has signal output. But the voice is incorrect. The speaker only comes out sharp sound and noise…I think I need to check the amixer commands until I fix it.
#For speaker playback
amixer -c 1 cset name="x Stereo DAC MIXL DAC L1 Switch" "1"
amixer -c 1 cset name="x Stereo DAC MIXR DAC R1 Switch" "1"
amixer -c 1 cset name="x Speaker L Playback Switch" "1"
amixer -c 1 cset name="x Speaker R Playback Switch" "1"
amixer -c 1 cset name="x SPOL MIX SPKVOL L Switch" "1"
amixer -c 1 cset name="x SPOR MIX SPKVOL R Switch" "1"
amixer -c 1 cset name="x SPOL MIX DAC L1 Switch" "1"
amixer -c 1 cset name="x SPOR MIX DAC R1 Switch" "1"
amixer -c 1 cset name="x Speaker Playback Volume" "0x20"
rituc
April 2, 2025, 10:11am
13
Can you please confirm whether the pinmux settings have been configured correctly? Also, kindly attach the complete device tree (DT). You can refer to NVIDIA’s Audio Setup and Development Guide to share the pinmux and DT logs.
To add RT5640 support, please refer to the sound node mentioned here: Audio Setup and Development — NVIDIA Jetson Linux Developer Guide . For example, the following property is missing in the DT:
sound {
nvidia-audio-card,mclk-fs = <256>;
…
};
If the issue still persists, could you check whether 48kHz is functioning correctly by modifying the assigned clock rate to 12.288 MHz?
Thank you so much. After giving the nvidia-audio-card,mclk-fs
, my speaker can play sound output. Here is my disassembled dtb file
f.txt (321.2 KB) for anyone who needs to refer.
And I tested those commands below, the speaker and headphone are working fine.
enable headphone
amixer -c 1 cset name=“CVB-RT Stereo DAC MIXL DAC L1 Switch” “1”
amixer -c 1 cset name=“CVB-RT Stereo DAC MIXR DAC R1 Switch” “1”
amixer -c 1 cset name=“CVB-RT HPO MIX HPVOL Switch” “1”
amixer -c 1 cset name=“CVB-RT HP L Playback Switch” “1”
amixer -c 1 cset name=“CVB-RT HP R Playback Switch” “1”
amixer -c 1 cset name=“CVB-RT HPO MIX DAC1 Switch” “1”
amixer -c 1 cset name=“CVB-RT HP Playback Volume” “10”
disable headphone
amixer -c 1 cset name=“CVB-RT Stereo DAC MIXL DAC L1 Switch” “0”
amixer -c 1 cset name=“CVB-RT Stereo DAC MIXR DAC R1 Switch” “0”
amixer -c 1 cset name=“CVB-RT HPO MIX HPVOL Switch” “0”
amixer -c 1 cset name=“CVB-RT HP L Playback Switch” “0”
amixer -c 1 cset name=“CVB-RT HP R Playback Switch” “0”
amixer -c 1 cset name=“CVB-RT HPO MIX DAC1 Switch” “0”
amixer -c 1 cset name=“CVB-RT HP Playback Volume” “10”
enable I2S to speaker
amixer -c 1 cset name=“CVB-RT Stereo DAC MIXL DAC L1 Switch” “1”
amixer -c 1 cset name=“CVB-RT Stereo DAC MIXR DAC R1 Switch” “1”
amixer -c 1 cset name=“CVB-RT Speaker L Playback Switch” “1”
amixer -c 1 cset name=“CVB-RT Speaker R Playback Switch” “1”
amixer -c 1 cset name=“CVB-RT SPOL MIX SPKVOL L Switch” “1”
amixer -c 1 cset name=“CVB-RT SPOR MIX SPKVOL R Switch” “1”
amixer -c 1 cset name=“CVB-RT SPOL MIX DAC L1 Switch” “1”
amixer -c 1 cset name=“CVB-RT SPOR MIX DAC R1 Switch” “1”
amixer -c 1 cset name=“CVB-RT Speaker Playback Volume” “20”
disable I2S to speaker
amixer -c 1 cset name=“CVB-RT Stereo DAC MIXL DAC L1 Switch” “0”
amixer -c 1 cset name=“CVB-RT Stereo DAC MIXR DAC R1 Switch” “0”
amixer -c 1 cset name=“CVB-RT Speaker L Playback Switch” “0”
amixer -c 1 cset name=“CVB-RT Speaker R Playback Switch” “0”
amixer -c 1 cset name=“CVB-RT SPOL MIX SPKVOL L Switch” “0”
amixer -c 1 cset name=“CVB-RT SPOR MIX SPKVOL R Switch” “0”
amixer -c 1 cset name=“CVB-RT SPOL MIX DAC L1 Switch” “0”
amixer -c 1 cset name=“CVB-RT SPOR MIX DAC R1 Switch” “0”
amixer -c 1 cset name=“CVB-RT Speaker Playback Volume” “20”
I have one final question: how can I implement these amixer
parameters as default in my OS? Having to run these commands before playing audio to my speaker or headphones is frustrating. Is there a configuration file to set up the mixer path, similar to other platforms?
rituc
April 7, 2025, 7:12am
15
hi @ruei_chang
You can update the /usr/share/alsa/init/postinit/02-tegra-rt5640.conf
as per your use case requirement for Nano platform.
Thank you for this information. After modifying the file and reflashing the OS, I can see that 02-tegra-rt5640.conf
reflects my modifications
However, the output of amixer is still incorrect, looks like that 02-tegra-rt5640.conf is not being loaded.
Did I do something wrong?
P.S. Two pictures above are same machine.
rituc
April 7, 2025, 1:49pm
17
Could you please verify whether the platform has picked up the changes by checking if the following line is present?
CARDINFO{name}=="NVIDIA Jetson Orin Nano APE", GOTO="Tegra RT5640 CVB Init"
"
Thank you so much. This is helpful.
My card info is NVIDIA Jetson Orin NX APE
So I changed
CARDINFO{name}==“NVIDIA Jetson Orin NX APE”, RESULT=“true”, EXIT=“return”
to
CARDINFO{name}==“NVIDIA Jetson Orin NX APE”, GOTO=“Tegra RT5640 CVB Init”
system
Closed
April 22, 2025, 1:24am
19
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.