[AGX ORIN]audio codec RT5640 is not working with rel36.4

Hello, teams.

I use custom carrier board, AGX ORIN rel36.4.
I have a similar issue with the link below.

I’m using ABKO’s SP1 speaker model for audio testing in GUI.

In rel35.5.0, I didn’t modify any DT files related to audio codecs. It worked well and the sound came out of the speaker.
However, In rel36.4, I also didn’t modify any DT files related to the audio codec, but the speaker doesn’t make any sound.

I only deleted the PD controller code from the “tegra234-p3737-0000+p3701-0000.dts” DT file because there is no PD controller on the custom carrier board.
All other DT files are the same as the official BSP source.

Are there any changes related to audio codecs while updating from rel35.5.0 to rel36.4?

** edit
I tried to flash the official rel36.4 BSP to the AGX ORIN developer kit and tested it with the same speaker, but the speaker still doesn’t make any sound.
flash the rel35.5.0 BSP to the AGX ORIN DEVKIT, worked.

Thanks!

Hi kcs,
We are happy to help here to resolve the issue. Before providing any comments. Can you provide more info on the below points.

As you mentioned, have not changed rel35.5.0 DT, I assume the audio output from codec is through Headphone jack. Please provide the below debug logs

  1. cat /proc/asound/cards
  2. cat /sys/kernel/debug/asoc/components
  3. Kernel log

Also, Can you go through the troubleshooting section Audio Setup and Development — NVIDIA Jetson Linux Developer Guide 1 documentation to understand or collect logs as per instruction and attach the log files to understand the actual issue

Hello mkumard
Thank you for your reply!

These are the debug logs.

  1. /proc/asound/cards
    proc_asound_cards.txt (273 Bytes)
  2. /sys/kernel/debug/asoc/components
    asoc_components.txt (527 Bytes)
  3. dmesg log
    dmesg.txt (62.2 KB)

I will proceed with debugging by referring to the guide document you gave.
And I will also share the debugging results.

Hi kcs,
As per the log files, APE card along with codec got registered. I believe we need to now check on couple of things.

  1. Codec I2Sx pinmux info
  2. Codec amixer controls.

Can you confirm, whether your speakers are connected to HP, SPO or LINE pin of codec. Based on this amixer commands for codec might change.

Hello mkumard,
sorry for the late response.

Can you confirm, whether your speakers are connected to HP, SPO or LINE pin of codec.

my speaker is connected to HPO.
The picture below is a circuit diagram of audio codec.

  1. Codec I2Sx pinmux info

is “I2S pinmux info” referring to DT files? Here are the files.
pinmux_dt.zip (9.4 KB)

  1. custom board’s pinmux DT
  2. official rel36.4 BSP that was flash to DEVKIT
  1. Codec amixer controls.

I’m not sure what “amixer control” means.
if “amixer control” can be found by typing a specific command, please tell me what command it is.

Currently, the same symptoms are also occurring in DEVKIT. I hope nvidia team fix it so that it works in DEVKIT.

Thanks.

Hi kcs,
Thanks for your inputs. Just to cross check if data is reaching codec. Attaching the commands required to test RT5640 internal loopback data test.

Can you run the commands in the attached script to pull out the “cap.wav” from target
to analyze if you could hear sine tone from it.

rt5640_Internal_loopback.txt (1.6 KB)

Hello mkumard,

I upload the “input.wav” and “cap.wav” by running the commands in the text file you attached.
script_output.zip (980.3 KB)
I executed the “cap.wav” file, but I didn’t hear anything from the speaker.

And when executing the command of the attached script, most of the error messages the were printed. (picture below)
Except for "amixer -qc 1 cset name=“I2S1 Mux” “ADMAIF1"” and "amixer -qc 1 cset name=“ADMAIF1 Mux” “I2S1"” commands.

Thanks.

Hi kcs,
The captured file is silence. It is expected as the snap shot from your terminal shows codec controls control set errors. Suspecting codec is not binded properly on your board.

Please provide the below logs from target.

  1. Attach the files (DT and driver) if any change done on your side.
  2. Kernel log (dmesg > kernel.txt)
  3. cat /sys/kernel/debug/asoc/components
  4. cat /proc/asound/cards
  5. amixer -c APE controls > controls.txt

Hello mkumard,

Here are the files.

  1. DT (dtc -I fs -O dts /proc/device=tree)
    dt.log (342.8 KB)

  2. Kernel log (dmesg)
    kernel.txt (64.1 KB)

  3. cat /sys/kernel/debug/asoc/components
    components.txt (527 Bytes)

  4. cat /proc/asound/cards
    proc_asound_cards.txt (273 Bytes)

  5. amixer -c APE controls
    controls.txt (62.2 KB)

  6. amixer -c APE contents
    settings.txt (313.7 KB)

  7. cat /sys/kernel/debug/regmap/2901000.i2c/registers
    reg_dump.txt (585 Bytes)

Thanks.

Hi kcs,
I can confirm from the DT log the RT5640 is not binded properly with I2S.

	nvidia-audio-card,dai-link@76 {
		format = "i2s";
		link-type = <0x02>;
		status = "okay";
		phandle = <0x2d0>;

		cpu {
			phandle = <0x2d1>;
			sound-dai = <0x1d2 0x01>;
		};

		codec {
			sound-dai = <0x1d2 0x02>;
		};
	};

Check your DTS file and make changes inline with below snippet.

  		i2c@31e0000 {
				rt5640: audio-codec@1c {
					#sound-dai-cells = <1>;
					status = "okay";
				};
			};

Under sound { } add below entry

  		nvidia-audio-card,dai-link@76 {
				link-name = "rt5640-playback";
				codec {
					sound-dai = <&rt5640 0>;
					prefix = "CVB-RT";
				};
			};

If you fix this, you should be able to see amixer -c APE controls showing “CVB-RT” named controls targeting codec.

Hello, mkumard

  1. If the RT5640 is binded properly with I2S, does this mean that the DT should be configured as follows?
codec {  
    phandle = <0x2d0>;  # bind properly?
    sound-dai = <0x1d2 0x02>;  
}; 
  1. The code you mentioned already exists in the “nv-public/overlay/tegra234-p3737-0000+p3701-0000-dynamic.dts” DT file. Should it be added to another DT file as well?

** In “nv-public/nv-soc/tegra234-soc-audio-dai-links.dtsi” file, the code has “DUMMY” specified. Is this normal? From what I understand, “DUMMY” has a meaning similar to “DISABLE.”

codec {
		sound-dai = <&tegra_i2s1 I2S_DUMMY>;
};

Thanks.

Hi kcs,
Yes, “nv-public/overlay/tegra234-p3737-0000+p3701-0000-dynamic.dts” has this change. Seems this override is not applied as your control dump log doesn’t have any codec related controls. Can you cross or you can directly use the audio related change in this DT in main dts file.

Hello mkumard,

Following your guidance, I directly added audio related change to the dts file(nv-public/nv-platform/tegra234-p3737-0000+p3701-xxxx-nv-common.dtsi).


As a result, when I run the command amixer -c APE control, I can see a control named “CVB-RT.”

However, when testing the speaker using the command speaker-test -c 2, it behaves abnormally.
The speaker test repeat every 10 seconds normally, but after adding code directly to the tegra234-p3737-0000+p3701-xxxx-nv-common.dtsi, the test repeats every 0.2 seconds, and no noise is heard from the speakers.

Here are the logs files.

  1. DT
    dt.log (343.0 KB)
  2. Kernel log (dmesg)
    kernel.txt (60.6 KB)
  3. /sys/kernel/debug/asoc/components
    components.txt (527 Bytes)
  4. /proc/asound/cards
    cards.txt (296 Bytes)
  5. amixer -c APE controls
    controls.txt (69.4 KB)
  6. amixer -c APE contents
    settings.txt (331.4 KB)
  7. /sys/kernel/debug/regmap/2901000.i2c/registers
    reg_dump.txt (585 Bytes)

It seems like progress is being made step by step.
Thank you for continued support.

Hi kcs,
This seems DAPM path is not set properly. I believe it should be set by default by alsa conf. Just for your offline try give a try with below commands.

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 HPO MIX DAC1 Switch” “on”
amixer -qc APE cset name=“CVB-RT HP L Playback Switch” “on”
amixer -qc APE cset name=“CVB-RT HP R Playback Switch” “on”
amixer -qc APE cset name=“CVB-RT HP Playback Volume” “31,31”
amixer -qc APE cset name=“CVB-RT DAC1 Playback Volume” “100,100”

amixer -qc APE cset name=“CVB-RT RECMIXL BST1 Switch” “on”
amixer -qc APE cset name=“CVB-RT RECMIXR BST1 Switch” “on”
amixer -qc APE cset name=“CVB-RT RECMIXL OUT MIXL Switch” “on”
amixer -qc APE cset name=“CVB-RT RECMIXR OUT MIXR Switch” “on”
amixer -qc APE cset name=“CVB-RT OUT MIXL DAC L1 Switch” “on”
amixer -qc APE cset name=“CVB-RT OUT MIXR DAC R1 Switch” “on”
amixer -qc APE cset name=“CVB-RT Stereo ADC1 Mux” “ADC”
amixer -qc APE cset name=“CVB-RT Stereo ADC MIXL ADC1 Switch” “on”
amixer -qc APE cset name=“CVB-RT Stereo ADC MIXR ADC1 Switch” “on”
amixer -c APE cset name=“CVB-RT ADC Boost Gain” 2
amixer -c APE cset name=“CVB-RT IN1 Boost” 2
amixer -c APE cset name=“CVB-RT IN2 Boost” 2
amixer -qc 1 cset name=“I2S1 Mux” “ADMAIF1”
amixer -qc 1 cset name=“ADMAIF1 Mux” “I2S1”

speaker-test -D hw:“APE”,0 -r 48000 -c 2 -F S16_LE -t sine -f 1000
commands.txt (1.4 KB)

Seems some formatting issue with double quote, so attaching same commands in txt

Hello, mkumard

I typed the commands in the attached commands.txt file.
I confirmed that no error messages appear, unlike before.
However, even after entering all the commands, sound still does not come out of my speaker.
Just to verify, I tested with a properly functioning rel35.5.0 of the AGX Orin module, and the speaker produced sound without any issues.


I searched information about “DAPM path” and “alsa conf” in the forum, but I couldn’t find a suitable answer. Where can I find the files or code to modify the “DAPM path”?
Also, where can I find the configuration file named “alsa conf”?

Thanks.

Hi kcs,
Can you make sure your DT sound node uses the below routing and widget entries as this is not shown in your dt log

			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";

Hello mkumard,

After adding the “widget” and “routing” entries in sound node of the main dts file, the speaker is now producing sound correctly even in the rel36 version!

Thanks to your support, I was able to resolve the issue.
I really appreciate your kind and detailed assistance.

Hi kcs,
It’s a great news to hear from you and welcome always. Good luck!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.