Arecord: main:834: audio open error: Device or resource busy

Environment: Jetson Thor DevKit + Jetpack7.1>

nvidia@localhost:~$ arecord test.mp3
arecord: main:834: audio open error: Device or resource busy

nvidia@localhost:~$ sudo fuser /dev/snd/*
/dev/snd/controlC0: 8231
/dev/snd/controlC1: 8231
/dev/snd/pcmC1D0c: 8230m
/dev/snd/pcmC1D0p: 8230m

nvidia@localhost:~$ sudo lsof /dev/snd/*
lsof: WARNING: can’t stat() fuse.gvfsd-fuse file system /run/user/2002/gvfs
Output information may be incomplete.
lsof: WARNING: can’t stat() fuse.portal file system /run/user/2002/doc
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
pipewire 8230 nvidia mem CHR 116,8 882 /dev/snd/pcmC1D0c
pipewire 8230 nvidia mem CHR 116,7 881 /dev/snd/pcmC1D0p
pipewire 8230 nvidia 67u CHR 116,7 0t0 881 /dev/snd/pcmC1D0p
pipewire 8230 nvidia 71u CHR 116,8 0t0 882 /dev/snd/pcmC1D0c
wireplumb 8231 nvidia 37u CHR 116,6 0t0 638 /dev/snd/controlC0
wireplumb 8231 nvidia 38u CHR 116,74 0t0 946 /dev/snd/controlC1

but after kill pipwier(8230), it will restart again.

Hi,

If you are trying on commandline arecord on default device, the error seeing on your end would be bcaz pipewire would be opening the same device and kept it open. Make sure you don’t try to re-open the device which is under usage.

then how to open the device which is not under usage to record the audio?

Are you interested in using arecord commandline tool for your testing, not via GUI?. If so, we could share some steps to avoid opening from GUI during boot.

sudo apt install gnome-sound-recorder

It works well now. Thanks a lot.

but if you are opening the “Sound” GUI Dialog, arecord command still can not work.

sudo lsof /dev/snd/*

it will show “Sound” will call pipewire.
pipewire take control or using the /dev/snd/pcmC1D0c and /dev/snd/pcmC1D0p

but gnome-sound-recorder still works well.

Yes, there is a alsa conf file which sets default pcm devices as C1D0c as default capture, thats the reason pipewire opens it when using GUI. Good to hear capture work with gnome sound recorder