Ticket #285 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Pulse ALSA Plugin (libasound2-plugins) and SDL

Reported by: zman0900 Owned by: ossman
Milestone: Component: alsa-plugins-pulse
Keywords: Cc:

Description

I am noticing some strange behavior when I try to play audio from SDL programs through ALSA. I have the ALSA plugins installed for Pulse (libasound2-plugins), and I have configured my /etc/asound.conf file properly to redirect ALSA through Pulse. I have tested this by playing music through Amarok while its output is set to Pulse audio and then playing the test tone from System>Preferences>Sound while it is set to ALSA. This worked, and it also worked reversed with Amarok on ALSA and the other on Pulse.

The problem I am having is when I try to run a game that uses SDL while SDL_AUDIODRIVER=alsa, the sound quickly stops, and the game locks up on exit, forcing me to restart X and kill the game process. The only way I am able to get these games to work properly through Pulse is to use SDL_AUDIODRIVE=dsp and run the game with padsp. It will also work with the esd driver, but this inserts about 1 second of lag (maybe another bug?). I have seen this behavior in several SDL games including but not limited to: Neverputt, Urban Terror, World of Padman.

I have also noticed similar, but less severe behavior in Supertux2, which I believe uses ALSA, but is not an SDL game, so this may be related.

I believe this is a rather important bug to fix because the alsa plugin provides a very useful functionality to Pulse that needs to work as well as possible before Pulse is an attractive option to many.

Change History

follow-up: ↓ 2   Changed 4 years ago by coling

SDL has pulse support in it. use SDL_AUDIODRIVER=pulse. The alsa module in SDL is probably doing odd things.

Lennart recently published some buffering patches on the PA mailing list. I'm not sure if they 100% resolved the latency/drop-out issues as I've not had a chance to fully test as of yet.

in reply to: ↑ 1   Changed 4 years ago by zman0900

Replying to coling:

SDL has pulse support in it. use SDL_AUDIODRIVER=pulse. The alsa module in SDL is probably doing odd things.

I've tried the pulse driver, but it caused stuttery audio and seemed to even cause graphics to skip with the sound. And I am running on a 2Ghz Core Duo with GeForce? Go 7600, so that isn't the problem.

Lennart recently published some buffering patches on the PA mailing list. I'm not sure if they 100% resolved the latency/drop-out issues as I've not had a chance to fully test as of yet.

If you're refering to the patch for the pulse driver in libSDL, I tried that out earler and it seemed to make no difference.

  Changed 4 years ago by lennart

  • status changed from new to closed
  • resolution set to fixed

I posted some patches to the libSDL bz a while back. I think it got merged now, but I don't know. Fedora ships those patches, as do some other distros AFAIK. Please make sure you have those patches applied. They fix all known issues. I am closing this now. Feel free to reopen if you are sure you are running a properly patched version and the problem persists.

Note: See TracTickets for help on using tickets.