From: Harold Johanssen on
All of a sudden, my applications complain the the sound device is
busy. This is what I get when trying to run, for example, mplayer:

[AO OSS] audio_setup: Can't open audio device /dev/dsp: Device or
resource busy
alsa-lib: pcm_hw.c:1242:(snd_pcm_hw_open) open /dev/snd/pcmC0D0p failed:
Device or resource busy
alsa-lib: pcm_dmix.c:864:(snd_pcm_dmix_open) unable to open slave
alsa-init: playback open error: Device or resource busy

How can I find out who is monopolizing that device? A look into
the output from ps awux does not provide much info, in that I have
nothing but the applications I usually run.

From: J G Miller on
On Fri, 26 Feb 2010 16:07:49 +0000, Harold Johanssen asked:

> How can I find out who is monopolizing that device?

fuser /dev/<device_name>

man fuser for further information

For example

fuser /dev/snd/*

/dev/snd/controlC0: 31840

then

ps -adef | egrep 31840

miller 31840 1 0 Feb31 ? 00:00:09 /usr/bin/pulseaudio --
start --log-target=syslog
miller 31843 31840 0 Feb31 ? 00:00:00 /usr/lib/pulseaudio/pulse/
gconf-helper



From: Robert Heller on
At Fri, 26 Feb 2010 16:07:49 +0000 (UTC) Harold Johanssen <noemail(a)please.net> wrote:

>
> All of a sudden, my applications complain the the sound device is
> busy. This is what I get when trying to run, for example, mplayer:
>
> [AO OSS] audio_setup: Can't open audio device /dev/dsp: Device or
> resource busy
> alsa-lib: pcm_hw.c:1242:(snd_pcm_hw_open) open /dev/snd/pcmC0D0p failed:
> Device or resource busy
> alsa-lib: pcm_dmix.c:864:(snd_pcm_dmix_open) unable to open slave
> alsa-init: playback open error: Device or resource busy
>
> How can I find out who is monopolizing that device? A look into
> the output from ps awux does not provide much info, in that I have
> nothing but the applications I usually run.

Firefox? W/Flash? I've noticed that the flash-plugin will grab
*exclusive* access to the sound device (even when there is no sound
associated with the flash object(s)).

>
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Download the Model Railroad System
http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows
heller(a)deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/

From: Greg Russell on
In news:hm8rkl$4v3$1(a)news.albasani.net,
Harold Johanssen <noemail(a)please.net> typed:

> [AO OSS] audio_setup: Can't open audio device /dev/dsp: Device or
> resource busy
> alsa-lib: pcm_hw.c:1242:(snd_pcm_hw_open) open /dev/snd/pcmC0D0p
> failed: Device or resource busy
> alsa-lib: pcm_dmix.c:864:(snd_pcm_dmix_open) unable to open slave
> alsa-init: playback open error: Device or resource busy
>
> How can I find out who is monopolizing that device? ...

/usr/sbin/lsof /dev/dsp

works nicely.




From: James Moe on
On 02/26/2010 09:07 AM, Harold Johanssen wrote:
> All of a sudden, my applications complain the the sound device is
> busy. This is what I get when trying to run, for example, mplayer:
>
> [AO OSS] audio_setup: Can't open audio device /dev/dsp: Device or
> resource busy
>
> How can I find out who is monopolizing that device? A look into
> the output from ps awux does not provide much info, in that I have
> nothing but the applications I usually run.
>
For mplayer the only certain solution I have found is to install the
ALSA-dev package(s) and rebuild mplayer. This way mplayer falls back to
accessing sound directly through ALSA as a fallback.
I have had a lot of problems with sound in linux (opensuse v11.1 and
11.2). I've enabled/disable Pulseaudio, made ALSA the preferred sound
device, etc. Ultimately I have ended with Pulseaudio enabled and set as
the preferred sound device.