sdl patch for better pulseaudio support

Bug #216397 reported by Pacho Ramos
58
This bug affects 3 people
Affects Status Importance Assigned to Milestone
libsdl1.2 (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

pulseaudio main maintainer made a patch for fixing sdl pulse plugin. Would be nice get it before Hardy final release

Thanks a lot

http://0pointer.de/public/sdl-pulse-rework.patch
http://0pointer.de/blog/projects/pa-plugin-for-sdl.html

Revision history for this message
William Grant (wgrant) wrote :

Those buffer changes definitely make it work a whole lot better, but what's the point of the other changes?

Changed in libsdl1.2:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Pacho Ramos (pacho) wrote :

I am not sure, but maybe their autor will know it better, you can post a comment in http://0pointer.de/blog/projects/pa-plugin-for-sdl.html (If you don't have time I can do that if you prefer)

Thanks

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

Yes, we should get this in before release.

William Grant (wgrant)
Changed in libsdl1.2:
status: Confirmed → New
Revision history for this message
Scott Kitterman (kitterman) wrote :

Ack from motu-release.

Changed in libsdl1.2:
status: New → Confirmed
Revision history for this message
Scott Kitterman (kitterman) wrote :

But it's in Main, so ubuntu-release needs to look at it.

Changed in libsdl1.2:
status: Confirmed → New
Revision history for this message
Pacho Ramos (pacho) wrote :

This causes a lot of problems in sdl based games, for example, I have just installed pingus and I cannot hear music (it is played too low and worse).

Revision history for this message
OliFre (freyermuth) wrote :

Temporary workaround:
Remove "libsdl1.2debian-pulseaudio" and replace with "libsdl1.2debian-all". However, this will bypass PulseAudio. I'm looking forward to a fix!

Revision history for this message
Dan Ziemba (zman0900) wrote :

I downloaded the source and applied the patch to try it out, and it works great. Now all the SDL games I have tried play great through Pulse, no more skipping, jerky audio. The patched deb is in my PPA if you want to try it yourself.

deb http://ppa.launchpad.net/zman0900/ubuntu hardy main
deb-src http://ppa.launchpad.net/zman0900/ubuntu hardy main

Revision history for this message
OliFre (freyermuth) wrote :

Confirmed to work! Thank you very much, now I can play multiple things at the same time again - finally.

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

Luke, can you please take a look at this? Thanks!

Changed in libsdl1.2:
assignee: nobody → themuso
status: New → In Progress
status: In Progress → Triaged
Revision history for this message
Luke Yelavich (themuso) wrote :

Once the useless indent changes are removed from the patch, the code that is actually changed makes sense in terms of improved functionality. With ubuntu-release's blessing, I'll prepare an SRUp upload for this package. I will do some local testing in the meantime to see if performance is in fact improved.

Revision history for this message
Luke Yelavich (themuso) wrote :

Pacho, this issue is not related to the music not fully playing in pingus. Planetpenguin-racer has the same problem. It is something to do with MIDI music playback and SDL.

Revision history for this message
Luke Yelavich (themuso) wrote :

Before I go ahead and get things ready for an SRU, does anybody know of an SDL based application that has very bad sound when using the original pulseaudio SDL package from hardy? I've found one or two where one can hear pops and clicks, but something a bit noticable for testing purposes would be preferable, thanks.

Revision history for this message
Dan Ziemba (zman0900) wrote :

A few I've noticed have been Urban Terror, World of Padman, Neverputt, and Frozen Bubble. They all seem fine for me now after applying the patch.

Revision history for this message
Manuel Schmid (fliegenderfrosch) wrote :

I got pretty bad sound quality with frozen-bubble and libsdl1.2debian-pulseaudio. The packages from the PPA mentioned above fixed the problem for me.

Revision history for this message
Jeremy Visser (jeremy-visser) wrote :

OpenArena and X-Moto give bad sound for me here when running through PulseAudio.

I'm currently compiling with the patch to see if it fixes it.

Revision history for this message
Jeremy Visser (jeremy-visser) wrote :

Whoa, what a difference! As-is, the patch makes the sound much, _much_ clearer.

Revision history for this message
Pacho Ramos (pacho) wrote :

Other option could be check fedora's src.rpm, seems that they are using esd-emulation because:

# Temporary hack: Use pulseaudio via esd so SDL apps don't lock up when they
# attempt to use ALSA via pulseaudio. This will be removed when...
# 1) SDL's pulseaudio support is working natively without problems
# 2) it conditionally switches to pulseaudio or ALSA automatically

ftp://ftp.free.fr/pub/Distributions_Linux/Fedora/development/source/SRPMS/SDL-1.2.13-4.fc10.src.rpm

But they are also applying attached patch

This should be fixed at least for 8.04.1 :-/

Thanks a lot

Revision history for this message
Brice Terzaghi (terzag) wrote :

I've recently encountered problems with PulseAudio in SDL apps. My current setting is to install libsdl-all and setting SDL_AUDIODRIVER depending on the application I want to launch (thus, I have to launch them manually or create scripts, as with libsdl-all ALSA supercedes ESD/PulseAudio and it makes applications crash).
For the apps I've checked :
- ScummVM needs SDL_AUDIODRIVER set to "pulse" (no sound with "esd")
- Warsow needs "esd" (laggy sound with "pulse")
- a Wolfenstein Enemy Territory executable patched to use SDL needs "esd" too (same laggy sound problem than Warsow)
- I'm not sure it uses SDL, but the PCSX Playstation emulator randomly outputs sound, whichever SDL_AUDIODRIVER setting I use (if it's not SDL, then it seems to have problems with PulseAudio).

Revision history for this message
Steve Langasek (vorlon) wrote :

Since this appears to be a request for an SRU, subscribing the Ubuntu SRU team instead of ubuntu-release.

Luke, is this already fixed in intrepid?

Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 216397] Re: sdl patch for better pulseaudio support

Yes, this is fixed in intrepid. I'll prepare an SRU for this shortly.

Revision history for this message
Jordan Erickson (lns) wrote :

This could possibly affect LTSP users via https://bugs.launchpad.net/ubuntu/+source/tuxpaint/+bug/269082 - I'm not marking as a duplicate, but it sounds like it could be one.

Revision history for this message
Jordan Erickson (lns) wrote :

Nope - scratch that last comment. Doesn't help with that bug.

Revision history for this message
Luke Yelavich (themuso) wrote :

Fixed in Jaunty if not intrepid as well

Changed in libsdl1.2:
status: Triaged → Fix Released
Revision history for this message
Simon Chemouil (simon-chemouil) wrote :

I am using Jaunty (fully updated) and I still have the problem of "scratchy" sound when playing SDL games with libsdl1.2debian-pulseaudio (even with the patch, I built it and checked the patch was applied). libsdl1.2debian-esd is laggy, and when using libsdl1.2debian-alsa since I updated to Jaunty, the sound thread ends up being deadlocked because the device becomes busy randomly...

Revision history for this message
Geoffrey Pursell (geoffp) wrote :

I've still got this, too. I still have unacceptably choppy sound on 9.04 as of this moment. I am trying to get sound out of mess & mame by setting $SDL_AUDIODRIVER=pulse.

Setting to oss and using padsp in front produces silence, and setting to esd produces serious latency.

Changed in libsdl1.2 (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Geoffrey Pursell (geoffp) wrote :

A half-workaround is to stick this at the bottom of my .profile:

export SDL_AUDIODRIVER="alsa"
export AUDIODEV=plug:pulse

But that come at too high a cost; doing that pegs one of my cores at 100% and the other at 40%.

Revision history for this message
Luke Yelavich (themuso) wrote :

Have you amde sure you have libsdl1.2debian-pulseaudio installed?

Revision history for this message
Geoffrey Pursell (geoffp) wrote :

I had libsdl1.2debian-pulseaudio installed at first, and presently libsdl1.2debian-all, for testing purposes.

Revision history for this message
Geoffrey Pursell (geoffp) wrote :

The only workaround that works for me in all cases is to use:

export SDL_AUDIODRIVER="alsa"
export AUDIODEV=hw:0

and then launch every SDL app that needs sound with pasuspender. Ack.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Is that still an issue? Luke are you still working on it?

Luke Yelavich (themuso)
Changed in libsdl1.2 (Ubuntu):
assignee: Luke Yelavich (themuso) → nobody
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.