Install alsa, pyaudio in a docker container on Jetson AGX Xavier

Hello,
I installed pyaudio and trying to record from data using scarlet 18i8 audio card device but it is showing me this error.

Basically I got this when I am trying to initialize the pyaudio object with pyaudio.PyAudio()

ALSA lib confmisc.c:767:(parse_card) cannot find card β€˜0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM sysdefault
ALSA lib confmisc.c:767:(parse_card) cannot find card β€˜0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM sysdefault
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:767:(parse_card) cannot find card β€˜0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:767:(parse_card) cannot find card β€˜0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:767:(parse_card) cannot find card β€˜0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM dmix

I realized there is no alsa library in my docker container on Jetson, but when I tried to install it using apt-get install alsa, it is showing alsa-basic is already installed

when I triedf to install alsa-lib, it is giving me the below message.
( Could not find a version that satisfies the requirement alsa (from versions: ) No matching distribution found for alsa)

Can you help me how to install the alsa-package @nvok @AastaLLL @JerryChang @ShaneCCC

Thank you
Sanketh

Hello,

I found this site (AlsaProject) nut not sure how to install these after downloading, can someone please explain?

@user38008
Have a check if below topic help on you.

Hello @ShaneCCC I am already following the same way but the error I got is little bit different if you check. I think I have to install alsa-lib and other alsa packages if I am not wrong.

If you can shoe me a way to install those packages on Jetson then it would be great.

Thanks

Hi @user38008, are you launching the container with --device /dev/snd --device /dev/bus/usb ?

BTW here is how I install ALSA / PyAudio in container: https://github.com/dusty-nv/jetson-voice/blob/1938da6661e33b2e56846d8df9cce83c9353b233/Dockerfile.aarch64#L212

Hi @dusty_nv

No I am not launching the container that way you mentioned above. I have built an image from dusty_nv/jetson-containers with TF2.5 Torch1.9 and numba, llvm etc. after building the image, I created a container from it and then started the container with command (docker start container_name).

And I installed pyaudio with the following steps in the container bash just like how it is mentioned in the repo.

apt-get update &&
apt-get install -y --no-install-recommends
alsa-base
libasound2-dev
alsa-utils
portaudio19-dev
libsndfile1
unzip
&& rm -rf /var/lib/apt/lists/*
&& apt-get clean

pip3 install soundfile pyaudio wave

After installing pyaudio I tried to initiate the pyaudio object with pyaudio.PyAudio() but it still gave the same error that I pasted in the beginning of the post.

I don’t know what is going wrong, after looking at the error (Install alsa, pyaudio in a docker container on Jetson AGX Xavier) I thought it is because of alsa-lib and then I am trying to install it but not able to do it so. Can you help on how to proceed?

Can you explain me about the launching the way you mentioned above. I didn’t understood.

Thanks

When you do docker run (or equivalent) can you try adding the --device /dev/snd --device /dev/bus/usb flags?

2 Likes

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