I2S and RT5640 usage on AGX Orin

Hello,
I am trying to use the 40 pin header to set up an I2S device utilizing the rt5640 codec as per the example given in the audio setup documentation (enable i2s node, configured sound node using “NVIDIA Jetson AGX Orin APE” as reference, and configured the i2s/codec DAI link) but I am unable to record audio using aplay (error arecord: pcm_read:2178: read error: Input/output error) when trying to play back audio I also noticed that the duration of playback is much faster than expected (finishes in seconds instead of minutes).

I can see the card being recognized by the correct name from /proc/asound/cards, see no errors through dmesg, and both the codec and i2s2 appear to be registered based on /sys/kernel/debug/asoc/components.

For the pinmux/gpio changes I am using the python tool to generate a dtbo then applying it to my dtb. However, I am seeing no output out of the clock signal or DOUT.

Please lets me know if there is any more information or logs that would be helpful in diagnosing this issue. Any guidance would be greatly appreciated!

Hi M.Sam

Which JetPack release are you using? If possible use the latest release, JetPack 6.0

The details of the issue are missing in your report.
Please follow trouble shooting guide, Audio Setup and Development — NVIDIA Jetson Linux Developer Guide 1 documentation and share all the relevant logs. It helps to understand the problem better.

AGX Orin has onboard RT5640 codec and you can make similar changes for the one you are interfacing on 40-pin header.

Jetpack version: 5.1.2 - r35.4 BSP

Here are the logs:
reg_dump.txt (671 Bytes)
dtc_result.txt (550.8 KB)
dmesg.txt (68.6 KB)
amixer.txt (331.4 KB)

additionally, output of some of the troubleshooting steps:

Mic usage example from this section [link](https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/SD/Communications/AudioSetupAndDevelopment.html#microphone-capture)

orin@tegra-ubuntu:~$ arecord -Dhw:SAI,0 -c 2 -r 48000 -f S16_LE -d 15
Recording WAVE ‘stdin’ : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
RIFF$�+WAVEfmt ���data�+arecord: pcm_read:2178: read error: Input/output error

cat /sys/kernel/debug/tracing/trace_pipe | grep *
arecord-3675 [002] … 4073.677209: snd_soc_dapm_path: *ADMAIF1 XBAR-Capture → (direct) → tegra-dlink-20-capture
arecord-3675 [002] … 4073.677213: snd_soc_dapm_path: *ADMAIF1 XBAR-Capture → (direct) → ADMAIF1 Capture
arecord-3684 [005] … 4225.484970: snd_soc_dapm_path: *ADMAIF1 XBAR-Capture → (direct) → tegra-dlink-20-capture
arecord-3684 [005] … 4225.484974: snd_soc_dapm_path: *ADMAIF1 XBAR-Capture → (direct) → ADMAIF1 Capture

Hi M.Sam

Presently the DT settings look incorrect.

AGX Orin has onboard audio codec RT5640. You are trying to interface one more such codec over 40-pin interface. However your DT configuration does not show two separate device nodes for RT5640. You need to add one more such device under the respective i2c node on 40-pin header and then use it for the I2S over 40-pin header.
You can follow the same procedure as it is done for onboard RT5640 codec. Just use different prefix name for 40-pin codec along with the respective I2C and I2S interfaces.

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