The RT5640 audio codec is exhibiting no audio output

I’m currently working on our custom board, using I2S0 and I2C2 to control the ALC5640 audio codec. I’ve modified the device tree based on the framework diagram I prepared, but I’m not getting any audio output. Additionally, when I try to play a sound file, it finishes playback almost instantly — as if it’s not using the correct sample rate or clocking.

When I check the kernel logs using dmesg, it seems that the APE isn’t being loaded properly. However, when I run cat /proc/asound/cards, the APE card does appear in the list.

Below is the framework diagram I’ve put together, along with the relevant device tree changes.

  1. dmesg
test@tac3000pro-ubuntu:/boot/dtb$ sudo dmesg |grep card
[    7.369712]   No soundcards found.
[   15.034012] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=3 as /devices/platform/bus@0/3510000.hda/sound/card0/input2
[   15.035354] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=7 as /devices/platform/bus@0/3510000.hda/sound/card0/input3
[   15.036427] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=8 as /devices/platform/bus@0/3510000.hda/sound/card0/input4
[   15.037536] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=9 as /devices/platform/bus@0/3510000.hda/sound/card0/input5
  1. cat /proc/asound/cards
test@tac3000pro-ubuntu:/boot/dtb$ cat /proc/asound/cards
 0 [HDA            ]: tegra-hda - NVIDIA Jetson Orin NX HDA
                      NVIDIA Jetson Orin NX HDA at 0x3518000 irq 120
 1 [APE            ]: tegra-ape - NVIDIA Jetson Orin NX APE
                      NVIDIA-NVIDIAJetsonOrinNXEngineeringReferenceDeveloperKitSuper-NotSpecified-Jet

  1. framework diagram

  2. device tree
    kernel_tegra234-p3768-0000+p3767-0000-nv-super.txt (316.7 KB)
    Could anyone help me identify what might be missing or incorrect in the device tree configuration? Any suggestions would be greatly appreciated.

dt.log (314.7 KB)
settings.txt (324.7 KB)
kernel.log (70.1 KB)

Hi Yihang,

  • Please confirm if I2S2 pinmux settings are done. If it’s already taken care, share the output of
    • $ cat /sys/kernel/debug/pinctrl/<addr>.pinmux/pinconf-groups > ~/pinmux_<addr>
      
  • What is the output device, HP/LOUT ?

Currently, we are using the HP output, but the LOUT will also need to be supported in the future
pinmux_2430000.txt (7.9 KB)

  • Logs doesn’t seem correct. Could you please re-share ‘pinconf-groups’ sysfs logs.

  • DT update is required, add the routing and widget properties in sound node and link-name in I2S2 dai-link as mentioned here Custom audio card.

  • For playback from HP use the route mentioned under heading “For stereo playback to both playback ports“ here Codec playback route. Make sure to use ‘I2S2 Mux’ rather than ‘I2S1 Mux’.

Please note, for LOUT the routing property needs to be updated and also the mixer controls settings.

Thank you for your reply.
I referred to the table below for the configuration. Which log should I use?

I used these settings and changed I2S1 to I2S2, but the result is not satisfactory.
I’m wondering if I need to modify other dai-link entries in the device tree, since the audio plays back extremely fast when I play music.

  • Please provide the output of “$ cat /sys/kernel/debug/pinctrl/2430000\.pinmux/pinconf-groups“.

Did you add properties mentioned above like below in the DT?

sound {
......   
      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";
   };
};
  • If still issue persists, please share the DT logs from the device and mixer controls settings.

Sorry for the late reply.
2430000.pinmux.txt (31.5 KB)
soundDT.txt (1.5 KB)

It’s been a while since the last update, so I’d like to kindly follow up on this thread.

Has there been any progress or feedback regarding this issue? I’m still encountering the problem and would really appreciate any guidance on whether my configuration might be incorrect or if there are known fixes.

Thank you again for your time and support!

Apologies for the delay.

The I2S2 pinmux settings are not properly configured. To resolve this issue, please refer one of the following documentation:

Thank you for your response. After the modification, I can now see APE messages in the dmesg output.I configured it according to this.

but there is still no sound from the headphone. Additionally, when I play an audio file, it finishes playback extremely quickly.But the microphone seems to be working normally.

test@tac3000pro-ubuntu:/$ sudo dmesg |grep sound 
[    6.814043]   No soundcards found.
[   17.176082] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=3 as /devices/platform/bus@0/3510000.hda/sound/card0/input1
[   17.297333] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=7 as /devices/platform/bus@0/3510000.hda/sound/card0/input2
[   17.404594] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=8 as /devices/platform/bus@0/3510000.hda/sound/card0/input3
[   17.490831] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=9 as /devices/platform/bus@0/3510000.hda/sound/card0/input4
[   23.183704] input: NVIDIA Jetson Orin NX APE Headset Jack as /devices/platform/sound/sound/card1/input5

I assume output device is HP only.

Please share the aplay command, dmesg, pinmux and mixer controls dump after playback. For details on how to fetch the loads refer, https://docs.nvidia.com/jetson/archives/r36.4.3/DeveloperGuide/SD/Communications/AudioSetupAndDevelopment.html#get-more-help-on-nvidia-developer-forum.

mixer.txt (241 Bytes)
pinmux_2430000.txt (31.5 KB)
aplay.txt (324.9 KB)
kernel_log.txt (68.8 KB)
Could you please take a look? I’d really appreciate your help.

  • Could you please ‘on’ → ‘CVB-RT HPO MIX DAC1 Switch’ control as well. If still doesn’t help, please share the dapm route, for commands check the link mentioned in previous comment.
  • Also, probe the I2S2 lines on Tegra side using oscilloscope and check the signals.

Thank you for your help! I found that the chip’s interrupt pin had also changed. After updating it and adding the “CVB-RT HPO MIX DAC1 Switch” configuration, it finally worked!

I’d like the audio to work immediately at system startup, without having to manually configure the mixer each time. I’m currently thinking of running a script at boot, but are there any simpler or more standard ways to achieve this?

The original issue has been resolved, please help to open a new topic. Thanks

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