ES8316 audio playback on Jetson Orin NX – no sound, only LRCK waveform

Environment: Jetson Orin NX (8GB). device tree base is tegra234-p3768-0000+p3767-0000 (same 40-pin layout as the standard Jetson Orin NX Developer Kit).

I use tegra234-p3768-0000+p3767-0000-nv.dtb (built from tegra234-p3768-0000+p3767-0000-nv.dts),and ES8316 (Everest Semiconductor), controlled over I2C0, audio over I2S2.(same as the 40-pin).

the problem is: no sound. Scope shows ~311 kHz on LRCK only; BCLK/SDOUT not as expected. “ES8316 Left Headphone Mixer Left DAC” cannot be set via cset name='...' (right side works). Asking for DT/routing and mixer guidance to get playback and waveforms correct.

can anybody help me? Thanks.

my_dts.tar.gz (2.8 KB)

Hello,

Thanks for visiting the NVIDIA Developer Forums.
To ensure better visibility and support, I’ve moved your post to the Jetson category where it’s more appropriate

Cheers,
Tom

Hi liyuan190

Could you mention the Jetpack version used for your testing.

Hi mkumard

My test version is :JetPack 6.2 r36.4.4

thanks.

The aud_mclk has a 12.8M waveform, but when playing, other i2s have no waveform.

my cmd:
stairmed@stairmed-desktop:~$ amixer -c APE cset name=“I2S2 Mux” “ADMAIF1”
numid=1131,iface=MIXER,name=‘I2S2 Mux’
; type=ENUMERATED,access=rw------,values=1,items=81
; Item #0 ‘None’
; Item #1 ‘ADMAIF1’
; Item #2 ‘ADMAIF2’
; Item #3 ‘ADMAIF3’
; Item #4 ‘ADMAIF4’
; Item #5 ‘ADMAIF5’
; Item #6 ‘ADMAIF6’
; Item #7 ‘ADMAIF7’
; Item #8 ‘ADMAIF8’
; Item #9 ‘ADMAIF9’
; Item #10 ‘ADMAIF10’
; Item #11 ‘ADMAIF11’
; Item #12 ‘ADMAIF12’
; Item #13 ‘ADMAIF13’
; Item #14 ‘ADMAIF14’
; Item #15 ‘ADMAIF15’
; Item #16 ‘ADMAIF16’
; Item #17 ‘I2S1’
; Item #18 ‘I2S2’
; Item #19 ‘I2S3’
; Item #20 ‘I2S4’
; Item #21 ‘I2S5’
; Item #22 ‘I2S6’
; Item #23 ‘SFC1’
; Item #24 ‘SFC2’
; Item #25 ‘SFC3’
; Item #26 ‘SFC4’
; Item #27 ‘MIXER1 TX1’
; Item #28 ‘MIXER1 TX2’
; Item #29 ‘MIXER1 TX3’
; Item #30 ‘MIXER1 TX4’
; Item #31 ‘MIXER1 TX5’
; Item #32 ‘AMX1’
; Item #33 ‘AMX2’
; Item #34 ‘AMX3’
; Item #35 ‘AMX4’
; Item #36 ‘ARAD1’
; Item #37 ‘AFC1’
; Item #38 ‘AFC2’
; Item #39 ‘AFC3’
; Item #40 ‘AFC4’
; Item #41 ‘AFC5’
; Item #42 ‘AFC6’
; Item #43 ‘OPE1’
; Item #44 ‘SPKPROT1’
; Item #45 ‘MVC1’
; Item #46 ‘MVC2’
; Item #47 ‘IQC1-1’
; Item #48 ‘IQC1-2’
; Item #49 ‘IQC2-1’
; Item #50 ‘IQC2-2’
; Item #51 ‘DMIC1’
; Item #52 ‘DMIC2’
; Item #53 ‘DMIC3’
; Item #54 ‘DMIC4’
; Item #55 ‘ADX1 TX1’
; Item #56 ‘ADX1 TX2’
; Item #57 ‘ADX1 TX3’
; Item #58 ‘ADX1 TX4’
; Item #59 ‘ADX2 TX1’
; Item #60 ‘ADX2 TX2’
; Item #61 ‘ADX2 TX3’
; Item #62 ‘ADX2 TX4’
; Item #63 ‘ADX3 TX1’
; Item #64 ‘ADX3 TX2’
; Item #65 ‘ADX3 TX3’
; Item #66 ‘ADX3 TX4’
; Item #67 ‘ADX4 TX1’
; Item #68 ‘ADX4 TX2’
; Item #69 ‘ADX4 TX3’
; Item #70 ‘ADX4 TX4’
; Item #71 ‘ADMAIF17’
; Item #72 ‘ADMAIF18’
; Item #73 ‘ADMAIF19’
; Item #74 ‘ADMAIF20’
; Item #75 ‘ASRC1 TX1’
; Item #76 ‘ASRC1 TX2’
; Item #77 ‘ASRC1 TX3’
; Item #78 ‘ASRC1 TX4’
; Item #79 ‘ASRC1 TX5’
; Item #80 ‘ASRC1 TX6’
: values=1
stairmed@stairmed-desktop:~$
stairmed@stairmed-desktop:~$ aplay -D hw:APE,0 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE ‘/usr/share/sounds/alsa/Front_Center.wav’ : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
stairmed@stairmed-desktop:~$
stairmed@stairmed-desktop:~$

Did you set the pinmux of I2S2?. Could you refer the similar query @ Orin NX es8316 audio playback not work - Jetson Systems / Jetson Orin NX - NVIDIA Developer Forums

Also could you play wavefile with format 48KHz, 2channel, 16 bps.

Pinmux is consistent with the result in the link
I tried to play the audio and found errors in the dmesg. At present, I don’t know whether these errors mean that there is a problem with the configuration in that place.

Could you try the below command and provide the kernel log if still issue exists. From the log seems like hw_params issue.

speaker-test -D hw:1,0 -r 48000 -c 2 -F S16_LE -t sine -f 1000

Does this seem like a problem with the FE to i2s channel? I’m trying to configure this channel, but it seems to have no effect,

I tried to test the i2s with this command, and found that the waveform is as above, and the sck has a 1.53MHZ square wave. During this period, the LRCK maintains a high level, and other waveforms do not exist. Is this normal? Now I play the sound with this effect,
I feel that the function will be available soon, but there may be some problems with the configuration.

LRCK should show 48KHz which is the wave format. Is codec is slave or master

Could you provide the connection mapping on 40 pin header for I2S from your end.

This is my i2s connection diagram.

I also have a question. Now I see that after modifying a CONFIG_TEGRA_DPCM macro in the code, I couldn’t find where it is configured in the code. I tried to skip this macro in the code, assuming it has a default definition. After compiling and flashing, I found that the current SCK always has a waveform at 1.53MHz, LRCK always has a square wave at 24.33kHz, but SDOUT still has no waveform during playback.

Hi,

The connections on your side looks fine. You don’t need to do CONFIG_TEGRA_DPCM macro change. As per the speaker-test command I have provided previously, the SCLK at 1.53MHz is right value. But LRCK looks odd which should be set at 48KHz which is the sampling rate we are playing on codec.

Just to understand the issue better in isolated condition. Is it possible to revert all the changes you made for codec (back to bsp image) and probe the I2S SCLK, LRCK, DOUT after running below commands

amixer -c APE cset name=“I2S2 Mux” “ADMAIF1”

speaker-test -D hw:1,0 -r 48000 -c 2 -F S16_LE -t sine -f 1000

Also dump clock summary with command

sudo cat /sys/kernel/debug/clk/clk_summary > clk_summary.txt

clk_summary.txt (42.0 KB)

Hi:
The above is the measured waveform, including the captured log, after executing the command speaker test - D hw: 1,0- r 48000- c 2- F S16_LE - t sine - f 1000. It can be seen that the sdk is 1.53MHZ and the LRCK is 245KHZ. It seems that there is still a problem. At present, there is no idea about this place.
At the same time, I see that it is mentioned on the official website that “Update the Machine Driver to Support a Custom Audio Card” is required. Do I need to do this step additionally

Yes, similar query was tracked under R36.4.4 audio driver error - Jetson Systems / Jetson Orin Nano - NVIDIA Developer Forums you can refer the suggestion on changes for machine driver. Also could you check if any errors in kernel log during playback

amixer -c 1 cset name=‘I2S2 Mux’ ‘ADMAIF1’

aplay -D plughw:1,0 l1.WAV

Thank you. I modified my machine driver by referring to the above link, and then I used the above two commands to play an audio. In the dmesg, you can see that there is a driver code that calls my es8316. c, as shown in the above picture, other errors do not appear.
Before modifying the machine driver, my es8316. c was not called during the aplay, which is valid.
At present, there is no SDOUT waveform. I’m not sure if it is not configured well in any place.

es8316.txt (5.2 KB)

tegra_codecs.txt (2.4 KB)

Hi mkumard:

Referring to the content in the link and the error report of the driver, I tried to modify the above two places. Now when I play, SDOUT waveforms can appear, as shown in the above figure, there are still two problems:

  1. The frequency of lrck is still 24KHZ, which seems wrong
  2. There is no sound when playing. Maybe the lrck frequency is wrong, which leads to the failure of codec recognition?

Good to hear we are able to make progress on this.

Could you provide the dump of clock summary during the active playback session with

sudo cat /sys/kernel/debug/clk/clk_summary > clk.txt

Also what is the audio file format (like Fs, ch, bps) used for playback.

stairmed@stairmed-desktop:~$ soxi l1.WAV

Input File : ‘l1.WAV’
Channels : 2
Sample Rate : 48000
Precision : 16-bit
Duration : 00:00:01.00 = 48128 samples ~ 75.2 CDDA sectors
File Size : 193k
Bit Rate : 1.54M
Sample Encoding: 16-bit Signed Integer PCM

clk_aplay.txt (42.0 KB)

The above is the audio format I played and the clk information I captured during playing,