Jetson Orin Nano and max98357 over I2S manifests cracking sounds when playing

Hi,
I’ve successfully connected a max98357 DAC over I2S to Orin Nano over (J12) 40pin connector.
Everything works as expected with one exception, a cracking sound that is manifesting some time when playing music. Any idea how to identify the root cause and address it?

Thanks!

Please refer to Audio Setup and Development — NVIDIA Jetson Linux Developer Guide to see if can help.

Also, does the cracking sound happens at start of the playback or in between the playback.

@mkumard is happening at start and also during the playback.

Is it possible to probe the I2S signals and check if there are any corruption during the cracking sound. If not, then we might need to check the configs on MAX98357 DAC.

I’ve tried to apply an overlay to configure I2S for Max98357a and try to fix the cracking sound. However, now I’m not able to get any sound from the APE card. Also, I’ve noted that when selecting I2S card as output(Instead of HDMI) the video is playing at very fast speed. I suspect there is something wrong with the clocks configuration.
I’ve attached the overlay configuration file and the output of cat /sys/kernel/debug/clk/clk_summary
config.txt (4.5 KB)
output.txt (2.6 KB)

Any suggestion about the potential root cause?
Thanks!

Hi,

This could be due to not having right alsa conf changes to set right controls for I2S playback on userspace application.

Can you confirm if audio on I2S working fine with commandline controls?.

amixer -c APE cset name=“I2S2 Mux” “ADMAIF1”
amixer -c APE cset name=“ADMAIF1 Mux” “I2S2”
speaker-test -D hw:“APE”,0 -r 48000 -c 2 -F S16_LE -t sine -f 1000 -l 10

When I try amixer -c APE cset name=“I2S2 Mux” “ADMAIF1”
I get the following error:
amixer: Cannot find the given element from control sysdefault:1
Attached the asound.conf
asound.txt (840 Bytes)

Can you attach the dump of

#aplay -l
#amixer -c APE controls

Please check below output files.
output2.txt (60.0 KB)
output1.txt (3.1 KB)

amixer: Cannot find the given element from control sysdefault:1

I could see APE card registered. If you copied the command from forum query directly, sometimes the double quotes are not taken properly. Please manually type the controls suggested and give a try. We should not hit any error for below commands

amixer -c APE cset name=“I2S2 Mux” “ADMAIF1”
amixer -c APE cset name=“ADMAIF1 Mux” “I2S2”
speaker-test -D hw:“APE”,0 -r 48000 -c 2 -F S16_LE -t sine -f 1000 -l 10

You were right. It seems that copy/paste introduces some invisible characters. Hereafter the output. However, I cannot hear anything as output.
speaker-test -D hw:“APE”,1 -r 48000 -c 2 -F S16_LE -t sine -f 1000 -l 10

speaker-test 1.2.6

Playback device is hw:APE,1
Stream parameters are 48000Hz, S16_LE, 2 channels
Sine wave rate is 1000.0000Hz
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 512 to 8192
Period size range from 256 to 1024
Using max buffer size 8192
Periods = 4
was set period_size = 1024
was set buffer_size = 8192
0 - Front Left
1 - Front Right

Hi,
Now the playback is running fine. We should expect I2S2 signals out of 40 Pin header.

What is the difference in code compared to your first comment that cracking sound is heard.

Could you confirm I2S signals are coming out of header pins?

Just a small change in the overlay file. I’m trying to enable soc_gpio41_pg6 as output and high at boot.
Here attached for your reference:
overlay_new.txt (4.5 KB)

Can you cross check on the codec side, Atleast, on codec driver side don’t see any mixer control support. So when I2S signal comes out codec should playback.

Please refer Audio Setup and Development — Jetson Linux Developer Guide documentation