This file is not readable. Can you please attach the correct file?
You are playing 48kHz/2-channel/16-bit audio stream. The expected MCLK clock is 12.288 MHz. As per your previous update, this clock was correct (~12.3 MHz). Can you confirm this again? Note that you need to probe the clocks after your run the speaker-test.
1, Why are there so many sound cards here, can they all work? Can I remove other ADMAIFx and keep only one ADMAIF1? Because es8316 only sees one sound card on other CPUs.
Display after executing “aplay - L” command:
2, After I modify the following files and run the ”sperker-test“ program, The es8616 driver can enter “es8316_pcm_startup” “es8316_pcm_hw_params” and “es8316_mute” functions, but these functions cannot be called before :
The “sources/kernel/nvidia/sound/soc/tegra-alt/utils/tegra_asoc_machine_alt.c” file is modified as follows:
12.3 MHz is expected rate once you start the speaker-test. So from clocking point of view it appears good.
What you see here are the playback or capture HW devices. Multiple devices can be used when there is a requirement of multiple stream playback or capture (For ex: ADMAIF1, ADMAIF2 …). You don’t have to worry about this. Your case may require just one device (ADMAIF1) and you can just use that. You can check following to see number of available sound cards: cat /proc/asound/cards
Also are you checking playback on speaker or headphone? I see es8316 has some switch controls for headphone path. Try turning these switches ON before you start speaker-test.
numid=1143,iface=MIXER,name='x Left Hp mixer LLIN Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=1144,iface=MIXER,name='x Left Hp mixer Left DAC Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=1145,iface=MIXER,name='x Right Hp mixer RLIN Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=1146,iface=MIXER,name='x Right Hp mixer Right DAC Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
Once you start speaker-test, you should see pcm_startup() and hw_param() calls from your codec driver. Keep those debug prints enabled as you have now.
The “tegra_asoc_machine_alt.c” file has been restored without any modification ,And executed the following commands, except that MCLK has 12.3 MHz clock signal, other pins have no signal :
The “tegra194-audio-p3668.dtsi” file is modified as follows:
amixer -c es8316tegra cset name="I2S5 Mux" "ADMAIF1"
amixer -c es8316tegra cset name="x Left Hp mixer LLIN Switch" 1
amixer -c es8316tegra cset name="x Left Hp mixer Left DAC Switch" 1
amixer -c es8316tegra cset name="x Right Hp mixer RLIN Switch" 1
amixer -c es8316tegra cset name="x Right Hp mixer Right DAC Switch" 1
speaker-test -D hw:es8316tegra,0 -c 2 -r 48000 -F S16_LE -t sine -f 500 music.wav
speaker-test 1.1.3
Playback device is hw:es8316tegra,0
Stream parameters are 48000Hz, S16_LE, 2 channels
Sine wave rate is 500.0000Hz
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 8192
Period size range from 32 to 4096
Using max buffer size 8192
Periods = 4
was set period_size = 2048
was set buffer_size = 8192
0 - Front Left
1 - Front Right
Time per period = 0.112104
0 - Front Left
1 - Front Right
Time per period = 0.112295
0 - Front Left
1 - Front Right
Time per period = 0.112333
0 - Front Left
1 - Front Right
Time per period = 0.112348
0 - Front Left
1 - Front Right
Time per period = 0.112328
0 - Front Left
1 - Front Right
Time per period = 0.112309
0 - Front Left
1 - Front Right
Time per period = 0.112339
0 - Front Left
......
The following is the status in contents:
numid=1143,iface=MIXER,name='x Left Hp mixer LLIN Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=1144,iface=MIXER,name='x Left Hp mixer Left DAC Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=1145,iface=MIXER,name='x Right Hp mixer RLIN Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=1146,iface=MIXER,name='x Right Hp mixer Right DAC Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
Can you please confirm if you are testing on heapdhone?
**This points to some DAPM routing problem. This needs to be fixed before you proceed.
I had a look at es8316 codec driver. The “I2S IN” widget seems to use “I2S1 Playback” stream which I don’t find in the codec driver. Can you try if below helps?
diff --git a/es8316.c b/es8316.c
index c00931e…7ad827c 100644
The DAPM trace logs you captured in previous comment is incomplete. Please enable trace events before you start speaker-test. Dump the trace logs once the speaker-test is done.
Also try with following controls only:
numid=1144,iface=MIXER,name='x Left Hp mixer Left DAC Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=1146,iface=MIXER,name='x Right Hp mixer Right DAC Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
Yes the clock frequencies seem to be correct. This confirms pinmux, driver and DT settings are fine.
You have to enable asoc events related to DAPM path. Please refer to section.
I hope you are getting codec pcm_startup() and hw_param() calls now. Can you please confirm?
I don’t know the stream configuration of music.wav and hence won’t be able to comment on this.
Test with below stream (it is 48000 Hz, 2-channel and 16-bit) and you should see the same clock frequencies with what you were getting for speaker-test run earlier.
Yes the music is probably over and the codec driver crashes when it finishes.
You may want to check the codec crash with codec vendor. Also confirm the codec settings with them. I see there is a mute() call from codec. Please make sure that the audio is not really muted. You can also check with increasing playback volume from codec mixer control settings.
From clock, driver and DT setup wise things look good. You are able to get the required clocks and able to get expected driver callbacks. There is data signal on SDO line as well.
Hi
Thank you very much for your support ,the audio problem on NX and TX2 platforms has been solved . es8316 can play music normally on NX and TX2 platforms. But I had a problem on the Jeston Nano platform. There are no signals on MCK, SCK and LRCK pins
Jeston NX platform, the audio is OK:
amixer -c es8316tegra cset name="I2S5 Mux" "ADMAIF1"
amixer -c es8316tegra cset name="x Left Hp mixer Left DAC Switch" 1
amixer -c es8316tegra cset name="x Right Hp mixer Right DAC Switch" 1
aplay -D hw:es8316tegra test.wav
“tegra194-audio-p3668.dtsi” and “tegra194-p3668-common.dtsi”:
That’s cool. Can this post be closed now? Since TX2, NX and Nano all work I am wondering if the subject needs to be updated. It will help someone who might be looking for a solution on particular platform.
You can place the required default settings in 00-tegra.conf file. Some default controls are already present depending on the sound card/platform. Does this not work for you? rootfs/usr/share/alsa/init/postinit/00-tegra.conf
Hi
“00-tegra.conf”, I tried to change it and it didn’t work. What format should this configuration file be? Can you give an example? The following is my command to manually set the audio configuration
You need to update all the “driver” references like above and add specific DAC switch settings similar to already existing controls. Since I2S interface used is different on different Jetson platforms, you can use unique names to differentiate between platforms, so that you can use a common conf file.