Xavier NX I2S audio problem

HI,I use a MAX98357 codec module。It connect to NX J40 pin ,pin 2,9,12,35,40.。But the audio has some nosie.Then I set this,the audio doesn’t output any sound!

echo 49152000 > /sys/kernel/debug/bpmp/debug/clk/plla_out0/rate
echo 245760000 > /sys/kernel/debug/bpmp/debug/clk/pll_a/rate
amixer -c 1 cset name=“I2S5 Mux” “I2S1”
I USE I2S0 to connect with MAX98357,but the “amixer -c 1 cset name=“I2S5 Mux” “I2S1” ”doesn’t has I2S0.
kctii@kctii-desktop:~$ cat /proc/asound/cards
0 [tegrahdagalent1]: tegra-hda-galen - tegra-hda-galen-t194
tegra-hda-galen-t194 at 0x3518000 irq 64
1 [jetsonxaviernxa]: jetson-xaviernx - jetson-xaviernx-ape
jetson-xaviernx-ape
kctii@kctii-desktop:~$ amixer -c jetsonxaviernxa cset name=“I2S5 Mux” “None”
amixer: Cannot find the given element from control hw:1

kctii@kctii-desktop:~$ cat /proc/asound/cards
0 [tegrahdagalent1]: tegra-hda-galen - tegra-hda-galen-t194
tegra-hda-galen-t194 at 0x3518000 irq 64
1 [jetsonxaviernxa]: jetson-xaviernx - jetson-xaviernx-ape
jetson-xaviernx-ape
kctii@kctii-desktop:~$ amixer -c jetsonxaviernxa cset name=“I2S5 Mux” “None”
amixer: Cannot find the given element from control hw:1

kctii@kctii-desktop:~$ mplayer 卫星信号弱,为保证数据有效,请保持当前速度行驶.mp3
MPlayer 1.3.0 (Debian), built with gcc-7 (C) 2000-2016 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing 卫星信号弱,为保证数据有效,请保持当前速度行驶.mp3.
libavformat version 57.83.100 (external)
Audio only file format detected.
Load subtitles in ./

Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 16000 Hz, 2 ch, s16le, 16.0 kbit/3.12% (ratio: 2000->64000)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)

AO: [pulse] 16000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback…
A: 0.4 (00.3) of 6.0 (06.0) 0.1%
Audio device got stuck!
A: 0.4 (00.3) of 6.0 (06.0) 0.1%
Audio device got stuck!
A: 0.4 (00.3) of 6.0 (06.0) 0.1%

Exiting… (End of file)
kctii@kctii-desktop:~$

Hello!

It is not recommended/advised that you directly set the clocks via the sysfs. The Linux audio driver will automatically set the clocks as necessary. Per the audio documentation for Jetson, the I2S interface on the 40-pin header of Jetson Xavier NX is I2S5. The hardeware documentation may refer to this as I2S0, which does confuse matters, but from a software standpoint you need …

amixer -c jetsonxaviernxa cset name=“I2S5 Mux” “ADMAIF1”

Looking at the pins you are using you have …

  1. pin 2 - 5V supply
  2. pin 9 - AUD MCLK
  3. pin 12 - I2S bit clock
  4. pin 35 - I2S frame sync
  5. pin 40 - I2S data output

As far as I can tell, the MAX98357 does not use the AUD MCLK and only the I2S bit clock. So it is not clear how you are using this?

I also don’t see any ground connection and you should ensure that there is a common ground between the Jetson and codec.

Regards,
Jon

As refer to pinout diagram,What I mean Pin9 is GND,not GPIO9。then I connect this to the Max98357 GND pin.
NVIDIA Jetson Xavier NX GPIO Header Pinout - JetsonHacks ,
it (max98357) can output audio with speaker, but has some noise.

Hello!

Yes you are correct, that is indeed ground. From a Jetson perspective, there is not really anything that we can configure to help with any noise. The I2S signals are digital outputs and so if there is a good connection to the codec and the signals look clean then it should be OK. In general it is best to keep any connections between Jetson and the codec short, ensure you have good grounding and that the power supply for the codec meets any guidelines from the manufacturer. Digital power supplies can be noisy and I see that they show some caps on the power supply in the following diagram …

Are you using a board like this …

I see this board also has caps on the supply.

Regards,
Jon

yes, I use max98357 chip,but not from Adafruit。 Caps, you mean capacitors? Now, I use another PCM5102 module ,the sound is clean.

Hello!

Yes I mean capacitors for the supply.

Jon

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