Audio codec es8316 driver

Hi chao.zhang,

Below error occurs when there are other aplay instances using same channel(ADMAIF1) running in the background. Killing all aplay instances (using ADMAIF1) before initiating a new one should help

  aplay: main:788: audio open error: Device or resource busy                    

Thanks

Thank you for your reply.
It is most likely that pulseaudio is using the device.When I execute the following command, the system does not have the above error message

sudo apt remove pulseaudio

https://forums.developer.nvidia.com/t/first-time-audio-record-show-device-or-resource-busy/118098
But when I uninstalled PulseAudio, I couldn’t hear the audio on the Internet connection,So I can’t uninstall PulseAudio,Is there any other way?

n@n-desktop:~$ ps aux | grep pulseaudio
gdm       6868  3.2  0.2 1212468 17148 ?       Ssl  10:40   0:01 /usr/bin/pulseaudio --daemonize=no
n         7476  0.0  0.0   7420   656 pts/0    S+   10:41   0:00 grep --color=auto pulseaudio

Hi chao.zhang,

In total there are 16 ADMAIFs. You can choose some ADMAIF other than ADMAIF1 if you are seeing the issue persistently

Thanks

Thank you for your reply.
Select ADMAIF2 or ADMAIF3, etc., and I will not hear the audio posted on the Internet, and neither will the speaker-test.My application scenario requires the Internet, So ADMAIF1 had to be used.Do you have any good suggestions?

Hi chao.zhang,

I presumed that the usecases were independent and hence the suggestion

Can you elaborate more on your usecase?

Thanks

After the system is started, when you run the command to play or record an audio file for the first time, the system prompts Device or Resource busy
2022-07-26_190551
aplay.log (46.6 KB)

  amixer -c jetsonxaviernxa cset name="I2S5 Mux" "ADMAIF1"
  amixer -c jetsonxaviernxa cset name="x Left DAC Switch" 1
  amixer -c jetsonxaviernxa cset name="x Right DAC Switch" 1
  aplay -D hw:1,0 test.wav

If you run aplay -d hw:1,0 test.wav for the second time, there is no Device or resource busy prompt, And in ADMAIF1, the audio and video on the Internet page are normal.

n@n-desktop:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: tegrahdaxnx [tegra-hda-xnx], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: tegrahdaxnx [tegra-hda-xnx], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: tegrahdaxnx [tegra-hda-xnx], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: tegrahdaxnx [tegra-hda-xnx], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 0: ADMAIF1 CIF ADMAIF1-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 1: ADMAIF2 CIF ADMAIF2-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 2: ADMAIF3 CIF ADMAIF3-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 3: ADMAIF4 CIF ADMAIF4-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 4: ADMAIF5 CIF ADMAIF5-4 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 5: ADMAIF6 CIF ADMAIF6-5 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 6: ADMAIF7 CIF ADMAIF7-6 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 7: ADMAIF8 CIF ADMAIF8-7 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 8: ADMAIF9 CIF ADMAIF9-8 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 9: ADMAIF10 CIF ADMAIF10-9 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 10: ADMAIF11 CIF ADMAIF11-10 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 11: ADMAIF12 CIF ADMAIF12-11 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 12: ADMAIF13 CIF ADMAIF13-12 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 13: ADMAIF14 CIF ADMAIF14-13 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 14: ADMAIF15 CIF ADMAIF15-14 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 15: ADMAIF16 CIF ADMAIF16-15 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 16: ADMAIF17 CIF ADMAIF17-16 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 17: ADMAIF18 CIF ADMAIF18-17 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 18: ADMAIF19 CIF ADMAIF19-18 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: jetsonxaviernxa [jetson-xaviernx-ape], device 19: ADMAIF20 CIF ADMAIF20-19 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

When I used other ADMAIF except ADMAIF1, after the system started, I used the following command for the first time, but the system did not have Device or Resource busy prompt

  amixer -c jetsonxaviernxa cset name="I2S5 Mux" "ADMAIF2"
  amixer -c jetsonxaviernxa cset name="x Left DAC Switch" 1
  amixer -c jetsonxaviernxa cset name="x Right DAC Switch" 1
  aplay -D hw:1,1 test.wav

But I can’t hear the audio and video on the Internet page, I don’t know if you understand what I’m saying.

Hi chao.zhang,

I see that you are seeing issue only once and using alternate ADMAIF is causing audio on internet to halt. Is it mandatory for you to use aplay?(Note that codec related amixer setting (ones with prefix x) will need to be done still) Will command line playback via pacmd as mentioned in First time audio record show Device or resource busy - #5 by jonathanh not work for you in place of aplay?

Thanks

Sorry for the late reply.
Yes, Consumers need to use the aplay command to play audio files.
What still needs to be done with codec-dependent mixer Settings (prefixed with X)?

Hi chao.zhang,

Can you share the o/p of below command before the first playback

 cat /proc/asound/card1/pcm0c/sub0/status

There can be few workarounds. Like using another ADMAIF for first aplay (ex: ADMAIF3) and restoring the setting like below after first aplay is done so that internet playback works fine

amixer -c jetsonxaviernxa cset name="I2S5 Mux" "ADMAIF1"

Is this suitable for you as we are trying to resolve the contention between pulseaudio and aplay

Thanks

Hello, this problem has been solved.
I turn on the command “#load-module module-alsa-source device=hw:1,0” in /etc/pulse/default.pa, and there is no prompt “device or resource busy”. The conflict between pulse audio and APlay is resolved.

I also found a problem with the earphones hearing noise at the beginning and end of the audio playback. It’s not clear what caused it.Do you have any good suggestions?

Here are the beginning and end waveforms of the audio analog signal measured to the Codec_OUT pin.

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