Bug 343911 - SDL and alsa-plugins-pulseaudio do not play along well
Summary: SDL and alsa-plugins-pulseaudio do not play along well
Alias: None
Product: Fedora
Classification: Fedora
Component: alsa-plugins
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
Depends On: 439847
Blocks: F9Blocker 420991
TreeView+ depends on / blocked
Reported: 2007-10-20 16:17 UTC by Julian Sikorski
Modified: 2009-06-27 15:45 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2008-04-07 20:59:30 UTC
Type: ---

Attachments (Terms of Use)

Description Julian Sikorski 2007-10-20 16:17:11 UTC
Description of problem:
During PA testing, I figured out that SDL does not want to work with PA in the
default config. Default SDL_AUDIODRIVER is set to alsa, which basically causes
every single SDL application not to output sound at all, and then lock up
(generally on exit). I tried tremulous, sdlmame and mplayer (the last two can be
found in thirdparty repos).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. yum install tremulous
2. start the game
3. exit
Actual results:
program plays no sound and locks up on exit

Expected results:
sound and no lockup

Additional info:
SDL_AUDIODRIVER=esd helps, so either SDL needs to be patched to default to that,
or the alsa plugin needs to be fixed

Comment 1 Mohd Izhar Firdaus Ismail 2007-10-21 16:33:02 UTC
I'm getting this problem too

rebuilt the rpms using upstream 1.0.15 tarball doesnt give any hope either

Comment 2 Caerie Houchins 2007-10-24 15:30:27 UTC
Confirming the problem still exists as of 10/24/07 rawhide

Comment 3 Warren Togami 2007-10-31 03:28:49 UTC
We added a workaround to SDL_mixer.

[root@newcaprica ~]# cat /etc/profile.d/SDL_pulseaudio_hack.sh
# Temporary hack until SDL directly supports pulseaudio

lennart will eventually implement direct pulseaudio for SDL so we can remove
this hack.  For now, this will make SDL apps work out of the box.  Keeping bug
open, and reassigning to lennart.

Comment 4 Christian Nolte 2007-11-15 12:53:58 UTC
As this bug affects all SDL applications (and as I also had a hard time finding
this out): What is the current state of this? IMHO at least the workaround
should be pushed out into the stable tree until a working solution is available.

Comment 5 Warren Togami 2007-11-15 18:26:25 UTC
This shipped in F8 as SDL_mixer-1.2.8-4.fc8.  Unfortunately, it has the
side-effect of breaking SDL sound if you kill pulseaudio.  We opted for this
because it at least made sound work by default.  Lennart assured us that he
would write a proper fix (SDL direct to pulseaudio support) before F9.  When it
happens, we can issue that as a F8 update and remove this hack.

Comment 6 Julian Sikorski 2007-11-15 18:29:57 UTC
May I ask why the fix is in SDL_mixer, which is not required by many apps, and
not in SDL package itself?

Comment 7 Warren Togami 2007-11-15 18:39:09 UTC
At the time we checks dependencies of a number of SDL using games and found that
SDL_mixer was the most common dependency.  Was this incorrect?  Sigh...

Comment 8 Julian Sikorski 2007-11-15 18:41:56 UTC
I'm not saying it's incorrect. But, SDL is required by every single SDL
application, including the minority of those not requiring the mixer.

Comment 9 Julian Sikorski 2007-11-27 22:40:43 UTC
Seeing that you brought that up on f-d-l, I am asking once again: why SDL_mixer?
If there is at least one app not requiring it, it will stay broken. SDL would be
a much better choice IMO.

Comment 10 Warren Togami 2007-12-13 20:46:54 UTC
Julian, are you going ahead with the updated hack in SDL and removal from
SDL_mixer in F-8? 

Comment 11 Julian Sikorski 2007-12-13 20:51:14 UTC
Is the ACL open? I can do that if you wish.

Comment 12 Callum Lerwick 2007-12-15 00:07:48 UTC
News flash, SDL actually supports native Pulseaudio but we're not building it:

--- SDL.spec    2007-11-06 10:18:15.000000000 -0600
+++ SDL.spec       2007-12-13 17:25:16.000000000 -0600
@@ -19,6 +19,7 @@
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: arts-devel audiofile-devel
 BuildRequires: esound-devel alsa-lib-devel
+BuildRequires: pulseaudio-libs-devel
 BuildRequires: libXext-devel libX11-devel
 BuildRequires: libGL-devel libGLU-devel
 BuildRequires: libXrender-devel libXrandr-devel gettext-devel
@@ -73,6 +74,7 @@
    --enable-dlopen \
    --enable-arts-shared \
    --enable-esd-shared \
+   --enable-pulseaudio-shared \
    --enable-alsa \
 make %{?_smp_mflags}

We really ought to at least build it in, even if its not default, so it can get
some testing. It seems to work fine with OpenAL, but there's a problem with
quake3, it runs its audio engine at 22050khz which doesn't seem to be working
right, it stutters constantly.

Comment 13 Warren Togami 2007-12-15 18:11:57 UTC
> +   --enable-pulseaudio-shared \
If we build it this way, it wont be possible to uninstall pulseaudio anymore?

Comment 14 Callum Lerwick 2007-12-15 20:26:22 UTC
Uhhh. -shared means its supposed to dlopen() it:

  --enable-pulseaudio     use PulseAudio [default=yes]
                          dynamically load PulseAudio support [default=yes]

But it doesn't seem to work:

$ ldd /usr/lib/libSDL-1.2.so.0
        libpulse-simple.so.0 => /usr/lib/libpulse-simple.so.0 (0x00501000)
        libpulse.so.0 => /usr/lib/libpulse.so.0 (0x006bf000)

Still, this should only pull in pulseaudio-libs, and not the entirety of
Pulseaudio, which is not something Fedora has been shy of doing elsewhere.

Comment 15 Warren Togami 2007-12-20 05:48:42 UTC
Please test this and report there.

Comment 16 Fedora Update System 2007-12-21 21:11:18 UTC
SDL_mixer-1.2.8-6.fc8, SDL-1.2.12-4.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Andrew McNabb 2008-01-10 23:09:03 UTC
SDL_pulseaudio_hack.sh incorrectly assumes that PulseAudio is installed.  Every
time I open a shell I get the following error:

/etc/profile.d/SDL_pulseaudio_hack.sh:3: no matches found:

yum provides libasound_module_pcm_pulse.so reports that:
alsa-plugins-pulseaudio.ppc : Alsa to PulseAudio backend

I have SDL-1.2.12-5.fc8 installed but not alsa-plugins-pulseaudio.  As a result,
I get the error message every time a shell starts.

Comment 18 Warren Togami 2008-01-11 02:35:24 UTC
I'm not seeing that error message when testing this.  What is your shell?

Comment 19 Hans de Goede 2008-01-30 11:36:51 UTC
(In reply to comment #17)
> SDL_pulseaudio_hack.sh incorrectly assumes that PulseAudio is installed.  Every
> time I open a shell I get the following error:
> /etc/profile.d/SDL_pulseaudio_hack.sh:3: no matches found:
> /usr/lib*/alsa-lib/libasound_module_pcm_pulse.so

Known problem when using zsh, see bug 426579, which is already fixed btw, a
simple yum update should fix your problem.

Comment 20 Lennart Poettering 2008-04-01 18:39:38 UTC
My patch for this in #439847

Comment 21 Matthias Clasen 2008-04-07 20:59:30 UTC
The patch in 439847 has been pushed into rawhide now. 

Note You need to log in before you can comment on or make changes to this bug.