Reputation: 1
I am trying alsa speaker-test utility after playing a .mp3 file using gst-play-1.0 in my customized Linux Os.but the speaker-test utility is unable to produce the sound over any channel and its producing a following error message given below.
speaker-test -p 1000 -t wav -c 6 -s 6
speaker-test 1.2.1
Playback device is default Stream parameters are 48000Hz, S16_LE, 6 channels WAV file(s) Playback open error: -16,Device or resource busy.
Based on my analysis, I found that the audio card/device "/dev/snd/pcmC0D0p" was used by gst-play-1.0 and its is not released even after gst-play-1.0 command execution.
I could see the result of lsof /dev/snd/* as
root 29u CHR 116,16 0t0 13359 /dev/snd/pcmC0D0p
Is anyone know how to release this resource so that I can use it for speaker-test ?
Upvotes: 0
Views: 3064
Reputation: 412
Your device is busy and your lsof
shows about a process using the device, just that doesn't seems to indicate the exact command where this comes. Probably because of the CoreUtils your custom Linux uses for these tools, in this case lsof
. Otherwise you will have a little more info, some output similar to this one:
$ lsof /dev/video*
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gst-launc 20425 my-user 5u CHR 81,0 0t0 606 /dev/video0
As your lsof
seems to indicate that someone is using that device, let's suppose it is an instance of speaker-test
. So that you can just do a process search and kill that process to free the device; rerun lsof
and see if the device is now available. If it is try again with your sound test!
ps aux | grep speaker
kill -9 <PID for Speaker>
lsof /dev/snd/*
Upvotes: 0