I2S0 Audio Playback Not Working

I’m encountering an issue with I2S0 audio playback on my board. After enabling the I2S interface in the pinmux with the following configuration:

soc_gpio41_ph7 {
    nvidia,pins = "soc_gpio41_ph7";
    nvidia,function = "i2s2";
    nvidia,pull = <TEGRA_PIN_PULL_NONE>;
    nvidia,tristate = <TEGRA_PIN_DISABLE>;
    nvidia,enable-input = <TEGRA_PIN_ENABLE>;
    nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};

soc_gpio42_pi0 {
    nvidia,pins = "soc_gpio42_pi0";
    nvidia,function = "i2s2";
    nvidia,pull = <TEGRA_PIN_PULL_NONE>;
    nvidia,tristate = <TEGRA_PIN_DISABLE>;
    nvidia,enable-input = <TEGRA_PIN_DISABLE>;
    nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};

soc_gpio43_pi1 {
    nvidia,pins = "soc_gpio43_pi1";
    nvidia,function = "i2s2";
    nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
    nvidia,tristate = <TEGRA_PIN_ENABLE>;
    nvidia,enable-input = <TEGRA_PIN_ENABLE>;
    nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};

soc_gpio44_pi2 {
    nvidia,pins = "soc_gpio44_pi2";
    nvidia,function = "i2s2";
    nvidia,pull = <TEGRA_PIN_PULL_NONE>;
    nvidia,tristate = <TEGRA_PIN_DISABLE>;
    nvidia,enable-input = <TEGRA_PIN_ENABLE>;
    nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};

I attempted to play audio using the following commands:

amixer -c APE cset name="I2S2 Mux" "MVC1" -q
amixer -c APE sset 'MVC1 Mux' 'ADMAIF1' -q
amixer -c APE cset name="MVC1 Volume" 12000 -q
aplay -D hw:APE,0 audio.wav

Unfortunately, the I2S0 audio playback does not produce any sound, and there are no dmesg log messages to indicate a problem.

Hi,

  • Are you using Jetson IO tool for pinmux settings?
    Please share the output of
    cat /sys/kernel/debug/pinctrl/2430000.pinmux/pinconf-groups
  • Also, please try I2S to ADMAIF loopback path for audio playback to check I2S configuration is correct or not.
    If doesn’t work, please share the hw_params during playback alongwith clock summary. Also probe the signals.
    cat /proc/asound/card1/<pcm_device>/sub0/hw_params
    cat /sys/kernel/debug/clk/clk_summary

Hi Sheetal,

Here is the pinconf file [pinconf|attachment] upload://2D2uJZgIl78Kb25KnWQBTlsm7U4) (39.3 KB)
I’ve changed the pinmux file dtsi using the pinmux xlsm file. I’m not using the jetson-io script for this process. I’d appreciate some guidance on how to set up an I2S to ADMAIF loopback. My current setup involves playback with MVC1 and ADMAIF1.

Upon executing sudo cat /sys/kernel/debug/clk/clk_summary,, while running the playback, I receive the following output:

i2s2_sync_input      0 0 0 0 0 0 0 50000
i2s2_sync_clk        0 0 0 0 0 0 0 50000
i2s2                 0 0 0 1411199 1411200 0 0 50000

Additionally, the result of cat /proc/asound/card1/pcm0c/sub0/hw_params is closed. How can I determine the correct pcm_device number for this configuration?

What happens when you run aplay command, it exits immediately or it runs and no data or data present but no sound?
Also, please share the aplay command along with console output if any.

Somehow can’t see the attachment. Please share again.

Here,
card1 → 1 is the sound card id. It should be APE sound card id. You can check it using command cat /proc/asound/cards.
pcm0c-> c is for capture and p is for playback. If it is ADMAIF1 then id will be 0. For playback you should check pcm0p.

You can get the details below:
Audio Setup and Development — Jetson Linux Developer Guide documentation (nvidia.com)

Here is the pinconf file
pinconf (39.3 KB)

I have configured the Loopback using I2S2 with ADMAIF as follows:

amixer -c APE cset name="I2S2 Mux" "ADMAIF1" -q
amixer -c APE cset name="ADMAIF1 Mux" "I2S2" -q
amixer -c APE cset name="I2S2 Loopback" "on" -q

Then, I checked the hw_params during playback, and here is the output:

cat /proc/asound/card1/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 2048
buffer_size: 8192

While playing, the output of clk_summary is as follows:

cat /sys/kernel/debug/clk/clk_summary | grep i2s2
i2s2_sync_input 0 0 0 0 0 0 0 50000
i2s2_sync_clk 0 0 0 0 0 0 0 50000
i2s2 1 1 0 1411199 1411200 0 0 50000

Finally, the output of the aplay command is:

aplay -D hw:APE,0 audio.wav
Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

What is the observation with the above usecase. Able to get the audio?

No, I’m not able to get the audio

Hi,

It should be TEGRA_PIN_PULL_DOWN for all i2s2 pins settings. I would suggest to use Jetson IO tool for pinmux settings.
Steps you can find here:
Audio Setup and Development — Jetson Linux Developer Guide documentation (nvidia.com)

If still it doesn’t help,
please help me with below information:

  • What is happening when you are running aplay command. Does it exit immediately or it runs? How are you confirming no data. Is there any peripheral (like speaker) connected and expecting the output from it?
  • Do you need external connection to i2s interface based on codec or just plain I2S?
  • When you had tried loopback path. Please do arecord also alongwith aplay to capture the data and share that. Also, probe the I2S lines to check and share your observation. Audio Setup and Development — Jetson Linux Developer Guide documentation (nvidia.com)
  • Also share the dmesg logs.

Solves the problem, Thanks.

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