/dev/dsp busy, weird ESD process using it

Bug #76876 reported by flickerfly
34
Affects Status Importance Assigned to Milestone
Ubuntu
Invalid
Undecided
Unassigned
Nominated for Edgy by Cortland Klein
Nominated for Feisty by Juraj

Bug Description

Previously discussed at http://ubuntuforums.org/showthread.php?t=313755, this bug presents itself to Edgy Eft users, perhaps only ones who upgraded from Dapper.

These commands pretty much tell the story:

$ sudo fuser /dev/dsp
$ sudo lsof /dev/dsp
$ sudo cat /dev/urandom > /dev/dsp
bash: /dev/dsp: Device or resource busy
$

The result is that any program dependent on sound is unable to speak with the sound card. After a period of time it will reset itself and sound is restored until it next freezes up. It affects systems using OSS and ALSA.

If the user logs out and back in, sound is restored for a time.

The only thing I see related to sound in 'ps ax' when the /dev/dsp is busy is a couple esd lines:
$ ps ax|grep esd
 6322 ? Ss 0:00 /bin/sh -c /usr/bin/esd -terminate -nobeeps -as 1 -spawnfd 19
 6323 ? SL 0:06 /usr/bin/esd -terminate -nobeeps -as 1 -spawnfd 19

I'm adding some info from Gutsy:
Using 7.10 gutsy gibbon with newest updates, and i can confirm the same problem.

However, did the following right after a clean install, dist-upgrade and login (to be sure there's no weird processes blocking /dev/dsp):

$ cat /dev/urandom > /dev/dsp
bash: /dev/dsp: Device or resource busy
$ ps ax | grep esd
15858 ? SL 0:00 /usr/bin/esd -nobeeps
$ kill 15858
$ cat /dev/urandom > /dev/dsp
[add some white noise here] - ctrl+c
$

So should be an ESD problem, not FF or Java or something.
And the "ESD problem" is caused by ubuntu running ESD on the background with the option -nobeeps.
Killing the ESD process frees the sound card and vóila, sounds working again!

Don't know really which package this affects, hopefully someone will take a look at this.

Revision history for this message
cfi (cfi) wrote :

Can confirm. For me it happens on Dapper, upgraded from an initial install of Breezy. Haven't tried Edgy and won't in the near future.
Relogin of user solved the problem. Today (22Dec06) is the first time this ocurred.
Have only one real soundcard (chipset on Nvidia based motherboard), but also one TV card (Pinnacle 300i) that identifies itself as soundcard (saa7134)

Revision history for this message
flickerfly (josiah-ritchie) wrote :

Thanks for the confirm cfi. I have an Intel based chipset.

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ICH6 [Intel ICH6], device 0: Intel ICH [Intel ICH6]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: ICH6 [Intel ICH6], device 4: Intel ICH - IEC958 [Intel ICH6 - IEC958]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Revision history for this message
Paulo Miguel Marques (nightwish) wrote :

google brought me here, but it may or may not be related. I found that it was not dsp that was occupied, but that firefox (very likely the flash plugin) was blocking /dev/sound/pcm[something].

Revision history for this message
bcdeck (bcdeck) wrote :

I'm running Edgy (clean install on a reformatted drive) on an nforce2 chipset. I get a similar issue -- audio apps produce no sound on an intermittent basis, and they give no error messages.

The app gui indicates the app is playing the media or stream happily. If I go to the sound prefs tab and try to test a sound, I get this error message:

audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! gconfaudiosink: Resource busy or not available.

Revision history for this message
mars (venkatr2004) wrote :

I have a similar issue.

However there is a difference of ALSA behaviour between the super user ( the account created during installation) and a subsequent one.

As the first user,

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SI7012 [SiS SI7012], device 0: Intel ICH [SiS SI7012]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

As a subsequent user,

$ aplay -l
aplay: device_list:222: no soundcards found...

Infact during the same X login as the second user, I sudo to the first user account and can play the sound. Looks like some ALSA configuration issue.

There is no difference in "lspci -vv" between the two accounts.

Revision history for this message
Motin (motin) wrote :

Same experience as Paolo: Google brought me here via Ubuntu forums.

Had firefox running with a youtube movie on pause. Shutdown the youtube site and then the device was not busy any more.

Can the OP confirm that FF was not running at the time of finding the bug? Then I can file a new bug - one for the fact that none of the commands used by OP doesn't list Firefox / Flash as the application hogging /dev/dsp...

Revision history for this message
flickerfly (josiah-ritchie) wrote :

It is entirely possible that I was using YouTube or GoogleVideo in coorespondence. I know that it happened at least once when that was the case. It may coorespond. I'll try to replicate it.

Revision history for this message
bcdeck (bcdeck) wrote :

OK, I've found a bit more out. I get the above error when I'm running a Java-based game called Lux (http://sillysoft.net/lux/). With Lux running, I get the previously mentioned error message. Without, sound plays fine. Also, Firefox does not cause me an issue.

Revision history for this message
Cortland Klein (me-pixelcort) wrote :

I'm getting a similar issue on my Apple 12" PowerBook G4 rev.A. My profile URL is http://hwdb.ubuntu.com/?xml=b3248bb23e46628798fb6a167e0e7390 ; not sure if that helps or not.

Revision history for this message
flickerfly (josiah-ritchie) wrote :

I'm still having this problem on Edgy. I have an update though. I'm working some more on digging up dirt.

I've tried killing off certain things that are suggested to be related and then run 'ps ax|grep esd' and I'm finding that I don't have any esd related things in the list so that would seem to be unrelated.

I went for nearly a month without a problem, but it has re-cropped up. Might be some change of my own habits, but I'm not sure.

Revision history for this message
flickerfly (josiah-ritchie) wrote : related to firefox

After posting that last note, I closed Firefox just to see and my ability to play audio was restored. It is definitely related to firefox or one of it's plugins like flash as mentioned above by Motin.

Revision history for this message
Georges (georgeskesseler) wrote : Re: /dev/dsp busy, but no program using it

it is flash related and has been also on all previous versions of linux, indifferent of distribution.
It may work better with the latest flash plugin (version 9) but I still suspect the java plugin to also mess around with sound in the same way.

But the real bug is: how do we find out which program is responsible of blocking /dev/dsp. For the moment I just do a random kill here and there until I get my sound back.

Georges

Revision history for this message
Ben Collins (ben-collins) wrote : Re: [Bug 76876] Re: /dev/dsp busy, but no program using it

On Sun, 2007-03-18 at 21:53 +0000, Georges wrote:

> But the real bug is: how do we find out which program is responsible of
> blocking /dev/dsp. For the moment I just do a random kill here and there
> until I get my sound back.

sudo lsof | grep /dev/dsp

--
Ubuntu: http://www.ubuntu.com/
Linux1394: http://www.linux1394.org/

Revision history for this message
mattsteven (matthew-matts) wrote : Re: /dev/dsp busy, but no program using it

Another program that will mysteriously hog alsa is the softmodem sl-modem-daemon.

I believe the hardware is capable of running both the modem and the sound card at once but the software is not.

Revision history for this message
molcrin (col-ogwencomputers) wrote :

I'm not an Ubuntu user, I use Sidux and came accross this page by accident, but as they are both Debian and the symptoms are the same this might work for a temporary fix:

sudo lsof | grep /dev/snd

This should just list artsd. Kill it and run your sound app straight after.

Once your program has exited artsd is restarted and your program won't have sound again.

I know this isn't the answer but, if it does on Ubuntu what it does for my Sidux then, maybe somebody with a bit more knowledge can do something with it.

Revision history for this message
Cortland Klein (me-pixelcort) wrote :

7.04 no longer has this issue on Apple PowerBook G4 12" 1.5 GHz

Revision history for this message
Georges (georgeskesseler) wrote :

upgrading to the latest flash plugin solved most of the issues, so it was the plugin's fault.
I still see problems when I have sound in java applets. So that's another plugin needing an update on it's sound management.

Revision history for this message
Ron Hoogwater (ronhoogwater) wrote :

I have the same problem, but found that firefox and openoffice use /dev/dsp exclusively sometimes. Could it be related to java?

Easy way to check which program is using /dev/dsp:

$ fuser /dev/dsp

Then find the PID with top.

Revision history for this message
Juraj (ojura) wrote :

Yes, this can be SO annoying! Fuser displays nothing, yet /dev/dsp is busy.

I'm running feisty and am still experiencing this sometimes.

Revision history for this message
Juraj (ojura) wrote :

Just to mention, my original distro was dapper. I've upgraded it to edgy and now to feisty. Bug is still present.

Revision history for this message
Ron Hoogwater (ronhoogwater) wrote :

Juraj: did you use sudo? When you did, your problem is a different one from mine and some others in this discussion.

For me, it is clear my /dev/dsp is used by firefox and openoffice, and the question is why these programs use /dev/dsp exclusively. Maybe it should be reported as a bug in these programs?

But if it is, everyone should have this error, doesn't it?

Revision history for this message
Juraj (ojura) wrote :

It made no difference whether I used sudo or not. This bug is called "/dev/dsp busy, but no program using it"

Exclusive usage of /dev/dsp IS NOT a bug. It's a hardware limitation of your sound card, which doesn't support hardware mixing. The Open Sound System (OSS) architecture does NOT support software mixing - therefore, you can't have two or more OSS apps at the same time if your sound card doesn't support hardware mixing. You can recognize OSS by use of /dev/dsp as the audio device.

The solutions are few. You can buy a better sound card; you can configure these programs to use Advanced Linux Sound Architecture (ALSA) which supports software mixing; or, you can use the alsa-oss (aoss) wrapper to run OSS programs through ALSA.

This what you experience is NOT a bug. It's a limitation of OSS.

A bug is when /dev/dsp is busy when no programs are using it.

Revision history for this message
Ron Hoogwater (ronhoogwater) wrote :

True, the title should be clear enough.

But there are 2 discussions going on here; for example bcdeck, flickerfly and Georges seem to have the same problem as me.

By the way, I think it IS a bug. In a distribution, sound should be working, no matter which program I use. That's what you and George said: these programs need an update on its sound management.
It would be a bad idea to buy a new sound-card, alsa works fine; as you said too.

Anyway, this discussion shouldn't be hold here, since this is another bug, probably of these programs self.

Revision history for this message
Juraj (ojura) wrote :

Well, if it is a bug, it's been unresolved a long time, and everybody who tried juggling with games knows about such trouble with OSS.

Your solution is to kill processes which haven't ended properly. Or run them with aoss :-)

Revision history for this message
joudy (joudy) wrote :

Hi, I had the same problem with this error message Device or resource busy. Command lsof /dev/dsp or /dev/audio gave me no output. But lsof | grep /dev/snd/ showed me some process using files in this directory which is used by ALSA. Killing these process solved my problem.

However it is still interesting why some programs can made ALSA busy.

Dundee

Revision history for this message
F7205 2610539 54B8BD49D49D (krugerk) wrote :

I had something similar until I stumbled across this bug, the top of which there is mention of esd.

$ ps ax|grep esd
 8774 ? S 0:00 /usr/NX/bin/nxesd -tcp -nobeeps -port 6000 -bind 127.0.0.1
 9482 pts/1 R+ 0:00 grep esd

And sure enough, in my case nxesd (of the Nomachine program) was occupying the sound.
(I had the 'enable multimedia support' enabled for nx client connections to foreign servers.)

Revision history for this message
Andrew Canis (andrewcanis) wrote :

I ran:
$ sudo lsof |grep /dev/snd/
Turned out gnumeric was using:
/dev/snd/timer
/dev/snd/pcmC0D0p
/dev/snd/controlC0
After killing it my sound came right back. Hope this helps.

Revision history for this message
asdfghjklasdfghjkl (asdfghjklasdfghjkl-deactivatedaccount-deactivatedaccount) wrote :

Using 7.10 gutsy gibbon with newest updates, and i can confirm the same problem.

However, did the following right after a clean install, dist-upgrade and login (to be sure there's no weird processes blocking /dev/dsp):

$ cat /dev/urandom > /dev/dsp
bash: /dev/dsp: Device or resource busy
$ ps ax | grep esd
15858 ? SL 0:00 /usr/bin/esd -nobeeps
$ kill 15858
$ cat /dev/urandom > /dev/dsp
[add some white noise here] - ctrl+c
$

So should be an ESD problem, not FF or Java or something.
And the "ESD problem" is caused by ubuntu running ESD on the background with the option -nobeeps.
Killing the ESD process frees the sound card and vóila, sounds working again!

Don't know really which package this affects, hopefully someone will take a look at this.

description: updated
Revision history for this message
Ryan Davies (iownsu) wrote :

Im Ubuntu 7.10 Gutsy Gibbon on an HP dv1717tu

My output differs slightly from that of above, however as pulseaudio replaces ESD, in effect it is the same.

when i run:

ryan@RLaptop:~/PH$ sudo lsof |grep /dev/snd/
pulseaudi 5956 ryan mem CHR 116,6 14311 /dev/snd/pcmC0D0c
pulseaudi 5956 ryan mem CHR 116,5 14304 /dev/snd/pcmC0D0p
pulseaudi 5956 ryan 11u CHR 116,7 14348 /dev/snd/controlC0
pulseaudi 5956 ryan 12u CHR 116,5 14304 /dev/snd/pcmC0D0p
pulseaudi 5956 ryan 13u CHR 116,7 14348 /dev/snd/controlC0
pulseaudi 5956 ryan 14u CHR 116,6 14311 /dev/snd/pcmC0D0c
mixer_app 12477 ryan 20u CHR 116,7 14348 /dev/snd/controlC0

then

ryan@RLaptop:~/PH$ sudo kill -9 5956

sound is restored.

Revision history for this message
Ryan Davies (iownsu) wrote :

not for long though ad pulseaudio seems to re-start itself

ryan@RLaptop:~/PH$ sudo lsof |grep /dev/snd/
mixer_app 12477 ryan 20u CHR 116,7 14348 /dev/snd/controlC0
pulseaudi 21027 ryan mem CHR 116,6 14311 /dev/snd/pcmC0D0c
pulseaudi 21027 ryan mem CHR 116,5 14304 /dev/snd/pcmC0D0p
pulseaudi 21027 ryan 19u CHR 116,7 14348 /dev/snd/controlC0
pulseaudi 21027 ryan 20u CHR 116,5 14304 /dev/snd/pcmC0D0p
pulseaudi 21027 ryan 21u CHR 116,7 14348 /dev/snd/controlC0
pulseaudi 21027 ryan 22u CHR 116,6 14311 /dev/snd/pcmC0D0c

Revision history for this message
Oleksij Rempel (olerem) wrote :

Thank you for your comments. This does not appear to be a bug report and
we are closing it. We appreciate the difficulties you are facing, but it
would make more sense to raise your question in the support tracker.
https://answers.launchpad.net/ubuntu

Revision history for this message
Oleksij Rempel (olerem) wrote :

/dev/dsp can mix only one stream, if you wont to mix more stream use esd, pulsaudio or alsa ( dmix )

Revision history for this message
Antoine Pairet (b-ly) wrote : pulseaudio produces the same error

I also got this error after installing pulseaudio.
audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! gconfaudiosink: Resource busy or not available.

Killing the pulseaudio process resolved the problem.

ps: I'm Using Ubuntu Gusty Gibbon

Revision history for this message
William Pitcock (nenolod) wrote : Re: [Bug 76876] pulseaudio produces the same error

Hi,

Is GNOME configured to use pulseaudio in this case?

On Mon, 2007-12-24 at 14:21 +0000, b_ly wrote:
> I also got this error after installing pulseaudio.
> audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! gconfaudiosink: Resource busy or not available.
>
> Killing the pulseaudio process resolved the problem.
>
> ps: I'm Using Ubuntu Gusty Gibbon
>

Revision history for this message
Antoine Pairet (b-ly) wrote :

I don't think GNOME was configured to use pulseaudio as far as I didn't configure anything. It's a bit stupid: I installed pulseaudio, then noticed it made sound 'unavailable' for other apps, so I decided to uninstall it.

I apologize if the previous comment wasn't useful. I would be glad to help, feel free to ask me if you would like me to do something.

regards,

Revision history for this message
William Pitcock (nenolod) wrote : Re: [Bug 76876] Re: /dev/dsp busy, weird ESD process using it

Hi,

In the case of switching to pulseaudio, you either need to manually
configure your software to use it, or in the case of Ubuntu, restart,
and it'll make a best-effort attempt to automatically configure your
system to use pulse.

On Mon, 2007-12-24 at 21:28 +0000, b_ly wrote:
> I don't think GNOME was configured to use pulseaudio as far as I didn't
> configure anything. It's a bit stupid: I installed pulseaudio, then
> noticed it made sound 'unavailable' for other apps, so I decided to
> uninstall it.
>
> I apologize if the previous comment wasn't useful. I would be glad to
> help, feel free to ask me if you would like me to do something.
>
> regards,
>

Revision history for this message
Andrew (andrew-andrewonline) wrote :

I can confirm very similar problems...except I'm not using OSS at all, and I still have the same issue with ALSA apps. Used to build my own kernels and found this issue any time OSS emulation was enabled with ALSA....not sure what brainiac decided that OSS emulation should be turned on in the ubuntu kernel but it's obviously causing huge numbers of problems, frequently making the sound system totally unusable, and for no apparent good reason.

Although ALSA apps shouldn't be behaving like I've seen ever...not with my sound hardware, and not with Linux...make me strongly suspect that some Ubuntu developer had the brilliant idea of hacking ALSA, and somehow opened Pandora's box. As of today I'm building a Gentoo kernel for this system and ditching this ridiculous mess that Ubuntu has created....three weeks of trying to fix ALSA so that it does what it was designed to do is just too much for me...someone who have been creating distributions from scratch since 2001.

Revision history for this message
Roland Orre (roland-orre) wrote :

Intrepid 9.04 just upgraded from Hardy Heron 8.04 here. I haven't had sound problems for a long while, apart from a little in the beginning with Hardy Heron, but that improved. For now I don't know what caused the problem, I had tried a little with realplayer11, anyway I got the typical of device /dev/dsp begin busy but no one using it. As in a previous report I did
lsof |grep /dev/snd
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/orre/.gvfs
      Output information may be incomplete.
timidity 7564 root 5u CHR 116,3 13614 /dev/snd/seq
pulseaudi 7720 orre mem CHR 116,5 13981 /dev/snd/pcmC0D0p
pulseaudi 7720 orre 19u CHR 116,7 14039 /dev/snd/controlC0
pulseaudi 7720 orre 25u CHR 116,7 14039 /dev/snd/controlC0
pulseaudi 7720 orre 43u CHR 116,5 13981 /dev/snd/pcmC0D0p
pulseaudi 8130 demo 19u CHR 116,7 14039 /dev/snd/controlC0
pulseaudi 8130 demo 25u CHR 116,7 14039 /dev/snd/controlC0
mixer_app 14720 orre 22u CHR 116,7 14039 /dev/snd/controlC0
ne.exe 26156 orre 9u CHR 116,7 14039 /dev/snd/controlC0

I tried to kill 7564, 8130, 7720 but for 7720 I had to do
kill -9 7720
then I could get the sound working, but then applications like vlc complained that they couldn't contact pulseaudio and /etc/init.d/pulseaudio start
doesn't help. I just started pulseaudio from the command line then and everything seems fine (how to start it right?).
Anyway, the same problem /dev/dsp being busy without lsof finding it seems to be the fundamental story.

Revision history for this message
remort (master-remort) wrote :

i have a twinkle ipphone and oss expect of alsa. my exaile uses OSS (/dev/dsp) and twinkle uses it too (/dev/dsp). when i play smth through an exaile - twinkle cant recieve a message. it screams that /dev/dsp is buisy. so i put a 'killall exaile' script on an incoming call in twinkle, but when incoming call arrived and exaile being killed i cant accept the call about 2-4 seconds waiting. and in this short time period fuser /dev/dsp outputs nothing!
and when exaile killed by the script, i will wait 2-4 secs - then after that i can finaly recieve the call (/dev/dsp gets free). so that is a real bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.