We got unexpected pop sound with the audio codec we added on agx Xavier.
The audio codec is MAX98357 and is connected to I2S1.
The pop sound shows as the start and the stop of every audio playback.
From the signal we measured, LRCLK and BCLK are almost enabled as the same time. (see below.) However, MAX98357’s requirement is LRCLK must start at least 1/2 BCLK after BCLK starts.
SD_MODE is set to high still as BCLK and LRCLK are set to be stopped. However, MAX98357’s requirement is if BCLK and LRCLK need to be stopped, SD_MODE must first be set to 0V.
Is there a way to adjust the I2S1 LRCLK enabled timing and SD_MODE(I2S1_SDIN) on agx?
Thank you for your support.
Sorry for not adding information clearly.
MAX98357 is connected to I2S1.
BCLK — I2S1_CLK
SD_MODE — I2S1_SDOUT
DIN — I2S1_SDIN
LRCLK — I2S1_LRCLK
MAX98357 is a Class D audio Amp and does not require any s/w.
I suggest to get in touch with Maxim regarding the same.
In your earlier comment, I think you meant I2S1_SDIN (not I2S1_SDOUT) for SD_MODE .
On AGX Xavier dev kit, I2S1 connects to Realtek Codec on the baseboard. Looks like you are using AGX Xavier Module with a custom baseboard.
Since in your design, I2S1_SDIN requires toggling as GPIO (via MAX98357 ASoC driver), it requires some changes in default pinmux as well for I2S1_SDIN. Kindly refer to Developer Guide to make default pinmux changes to use I2S1_SDIN as GPIO.
Please use below GPIO in MAX98357 device node:
“sdmode-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(S, 2) 0>;”
You are right.
I2S1_SDIN is for SD_MODE .
Sorry for my typo.
Actually, Maxim gave the update of “MAX98357 is a Class D audio Amp and does not require any s/w.”
We will try your suggestion.
Plus, from MAX98357 evb board, the BCLK / LRCLK clock are turned on always. It looks no idle mode even no playback /recoding.
Is there a way to set agx ASoC core not into idle mode? how?
Will this help to avoid pop sound?
Using ASoC driver for handling sdmode signal is the best and cleaner solution. Please get in touch with Maxim and share references to the driver and DT bindings so that they respond in the correct context.
Regarding keeping BCLK/LRCLK always on : These clocks are generated by I2S controller when controller is enabled. Also these clocks are a function of Audio sampling rate etc… So not sure how MAX98357 behaves if rates are change runtime (based on usecase e.g. 8Kz to 48Khz etc…). There are many unknows since we haven’t used this Amp or the EVM at our end.
Kindly give us couple of days, we could possibly share few things for you to tryout but all that would be hacky.
Indeed, from your above experiments looks like the gap between BCLK and LRCLK seems to be causing noise and dapm_pop_time is actually adding more delay for LRCLK.
I still believe if ASoC code driver is used to handle sdmode_gpios and sdmode_delay, it could solve the issue. However, we are checking if it’s possible to keep these clocks always “ON” without major code changes.
I shall update as soon as we have something ready for you to try.
Above commands are just to set default PLL rates (these rates could get overridden based on usecase). Important command that enables SCK and LRCLK on I2S1 is below:
amixer -c 1 cset name=“I2S5 Mux” “I2S1”
This basically sets up I2S1 (capture) → I2S5 (playback) path within audio subsystem. It ensures that all clocks going out of the I2S1 controller are enabled even when your usecase (playback over I2S1) is not running. You could use any free I2S instance inplace of I2S5 as per your HW design.
Thank you so much for your clear information.
By the way, is there a way to revise back to default?
The rate value will change back to default value after restart.
But amixer setting seems remained to the changed state.
And amixer -c 1 cset name=“I2S1 Mux” “I2S1” did not change back, either.
And amixer -c 1 cget does not get the current control content.
Is there a way to get the current amixer setting?
Hi, I encounter same problem in Xavier NX.
$ 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 3.0 (03.0) 0.1%
Audio device got stuck!
A: 0.4 (00.3) of 3.0 (03.0) 0.1%
And I use this command,
amixer -c 1 cset name=“I2S5 Mux” “I2S1”
the NX doesn’t output audio again.How to fix it? Thanks in advance.