Audio device busy after first use

Bug #36932 reported by LCID Fire
10
Affects Status Importance Assigned to Milestone
alsa-lib (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

When switching to esd (from alsa) in multimedia settings I get some annoying errors.
When I for example watch a dvd and then attemt to watch another one (using totem-xine), the 2nd attemt gives me a "The audio device is busy. Is another application using it?" error message. I cannot resolve this - until I restart. Afterwards it works again. So I'd have to restart the computer every time I want to watch a movie - besides when it gives me this error message in totem - I can't test the default output - esd in the multimedia settings anymore.

Revision history for this message
Francois-Denis Gonthier (fdgonthier) wrote :

You are using Ubuntu desktop or Kubuntu desktop? Do you have artsd running in the background (if you know how to check for that)?

Revision history for this message
LCID Fire (lcid-fire) wrote :

Arts is not installed. I run Ubuntu Breezy.

Revision history for this message
LCID Fire (lcid-fire) wrote :

Oh and another thing. This seems to happen only when the video (dvd) is trying to output at least 5.1 surround sound. When the video is in stereo only it works fine.

Revision history for this message
LCID Fire (lcid-fire) wrote :

So I checked again and although I didn't have the metapackage installed - the libarts was installed (it's a dependency of rosegarden). So I removed the libarts - but I still get the same message.

Revision history for this message
Martin Pitt (pitti) wrote :

This should be much better in Dapper; esd is not used by default any more. However, it seems that totem-xine does not use esd for video playback, right? Can you convince it to use ALSA or esd, instead of e. g. OSS?

Revision history for this message
Martin Pitt (pitti) wrote :

Also, can you please try something:

  esdplay /usr/share/sounds/login.wav &

then wait for about two seconds, and execute it again? Do you hear two sounds on top of each other, or does the second sound wait until the first one is finished? (The latter is next to impossible, but let's check anyway).

Revision history for this message
LCID Fire (lcid-fire) wrote :

Doing the latter I hear nothing (yes, I have the levels on max).
I tried to switch from totem-xine to totem-gstreamer (which is no real alternative because it is far to unperformant) and it gives me a "Failed to play: Could not open resource for writing" error. I assume that gstreamer uses the default output of gnome which is esd - and doing so I can't play anything in totem anymore (regardless of surround or not).

Revision history for this message
LCID Fire (lcid-fire) wrote :

I upgraded to dapper and at least the esdplay test plays the sounds on top of each other. But totem-xine still gives me an error.

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks for checking. So let's test whether dmix works for you:

killall esd
aplay /usr/share/sounds/login.wav &
sleep 1
aplay /usr/share/sounds/login.wav

Does the second aplay call block? i. e. can you hear two sounds on top of each other, just like with esdplay?

esound is deprecated in Dapper, btw, Gnome prefers to use ALSA directly now, if dmix (software mixing) works for your sound card.

Revision history for this message
LCID Fire (lcid-fire) wrote :

I wonder why esound is deprecated - afaik it was halfway new wasn't it?
Testing with aplay the sounds are played serialized - not like esd. Also - if I think of this some more I assume it to be a problem of alsa - because xine didn't use esd in the first place and also in dapper esd is not chosen as the default anymore.

Revision history for this message
LCID Fire (lcid-fire) wrote :

So I tried some things - xine WAS using esd (I noticed because playing a video and killing esd - sound skipped immediately).
So I switched off esd support under sound control (I wonder why there still is esd set to default?) and esd isn't started anymore. BUT the problem still remains...

Revision history for this message
LCID Fire (lcid-fire) wrote :

Also I have a problem that games starting with wine lock up on intro. I assume that this perhaps is also a problem connected to alsa not being able to play multiple streams parallel. Since I assume this to be a well known functionality I kindof wonder what the reason could be. I somewhat assume it's the drivers problem, isn't it?

Revision history for this message
LCID Fire (lcid-fire) wrote :

I have a strange effect - I reenabled esd - and I can play ac3 again (I noticed I have a particular problem playing ac3 streams). Any ideas what's going on

Revision history for this message
LCID Fire (lcid-fire) wrote :

So I tried this serveral times and it seems like esd somehow locks up playing an ac3 stream. One can play any kind of stream afterwards - but no ac3 anymore. When I restart esd it's working again.

Revision history for this message
Martin Pitt (pitti) wrote :

OK, according to your aplay tests, dmix (ALSA mixing) doesn't work for you. Do you have a customized ~/.asoundrc or /etc/asoundrc? What is your soundcard, i. e. can you please give us the output of

  aplay -l

?

BTW, esound is pretty old already. Maybe you mixed it up with polypaudio?

Changed in alsa-lib:
status: Unconfirmed → Needs Info
Revision history for this message
LCID Fire (lcid-fire) wrote :

~/.asoundrc.asoundconf has defaults.pcm.card 0
/etc/asoundrc is not present

aplay -l
gives
**** List of PLAYBACK Hardware Devices ****
card 0: External [SB Live! 24-bit External], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

And best of all since a few weeks sound and video doesn't run on track anymore (tend to be a little async).

Revision history for this message
LCID Fire (lcid-fire) wrote :

Since the output is set to auto in the mms I have some other problems. I no longer have to kill esd to play ac3 (because it isn't used anymore ;)) but watching videos the sound gets async after awhile and like I said before I can only play one sound at a time. The latter seems to be a kernel driver problem - the first - don't know.

Revision history for this message
LCID Fire (lcid-fire) wrote :

Sooo I did some more tryout and restarting esd is needed from time to time. It seems to me that at least totem-xine is using esd when it attemts to play 5.1 audio streams. All other sound seems to use alsa!?
Well nevertheless reading http://gentoo-wiki.com/HOWTO_Install_Creative_Sound_Blaster_Live_24-bit_external_(usb) I setup my alsa for dmix - are there any drawbacks when using this approach???
I mean besides the point that a normal user wouldn't want to mess with this since IMHO multiple streams should work out of the box.
So I'll do some additional tryout with various applications and tell you my results...

Revision history for this message
Daniel T Chen (crimsun) wrote :

ca0106 is already dmixed by default in Dapper. See /usr/share/alsa/cards/CA0106.conf .

Revision history for this message
LCID Fire (lcid-fire) wrote :

Well that's nice for ca0106 which is AFAIR an Audigy. But since I have a Live the ca0106 module isn't loaded and well - I have to do this change manually.

Revision history for this message
Daniel T Chen (crimsun) wrote :

No, you have a usb live, which is not dmixed by default. (I have an M-Audio Transit, also a usb sound device.) Upstream has not enabled dmix for it by default, and it would be unwise to do so this late in the release cycle.

Revision history for this message
LCID Fire (lcid-fire) wrote :

Wellll since we have Dapper out of the way what do you say to enable dmix for usb live? *nag*

Revision history for this message
LCID Fire (lcid-fire) wrote :

In current edgy ac3 the problem seems to be gone. Problem is I have that many problems with playing sound streams in xmms, banshee, ... that I don't know whether it is due to another bug or intentional %-)

Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks for following up, closing the bug.

Changed in alsa-lib:
status: Needs Info → Fix Released
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.