Ticket #296 (new defect)

Opened 4 years ago

Last modified 3 years ago

ETQW sound lags when using pulseaudio via alsa-pulseaudio

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

Description

ETQW is the only application I'm having this issue with at the moment. What happens is that sound will lag 2-3 seconds after an action in the game. This doesn't happen when running directly via alsa. I also seemingly can't use padsp and set the game to OSS to get it to work, this may be similar to the issues with enemy territory or quake3 that the wiki refers to.

One other report of this issue can be found below, and they seem to be running 64 bit as well so it may be something that only affects 64 bit users. Ex: http://ubuntuforums.org/archive/index.php/t-711274.html

In any case, I'm not sure if this might be a specific problem with 64 bit running 32 bit alsa applications using the alsa-pulseaudio plugin, or if it's more general than that. I will try unreal tournament 2004 later for comparison since it would have the same issue if that's the reason for it. I will post back if it does.

Change History

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

I also have this issue. 64bit Hardy.

Issues goes away if you dont have your .asoundrc use these settings: pcm.!default { type pulse } ctl.!default { type pulse }

This removes the pulseaudio from touching the audio.

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

followup: I'm also seeing this in the ETQW console

idAudioHardwareALSA::Write: 832 frames overflowed and dropped

TTimo, ID Software employee / head of the Linux port had the following to say:

"lying on the frequency then some alsa drivers do that you ask them a freq they say yes give you something slightly different so the buffer starts filling up"

  Changed 3 years ago by lethalwp

I would like to confirm this problem & solution: i'm now on a fedora 11 (rawhide), fully updated;

All quake/enemyterritory/... games have laggy sound by approx 0.2 or 0.3 seconds

Having added the http://nullkey.ath.cx/~stuff/et-sdl-sound/ to make the sound work; it works perfectly when the .asoundrc previously explained is added.

if i change the sound to esd instead of alsa; the lag reappears

  Changed 3 years ago by coling

Interestingly, SDL has direct pulse support fro some time.

Perhaps things will work nicely with:

export SDL_AUDIODRIVER="pulse"

in the overall env setup?

  Changed 3 years ago by lethalwp

Thank you for the suggestion, Just tested it, it works correctly too:

you need a quakelike game, SDL lib addon from http://nullkey.ath.cx/~stuff/et-sdl-sound/; patch the files to change the "alsa" to "pulse"

And it works as good as alsa with the .asoundrc; so it's even a "cleaner" setup.

Just hope that punkbuster won't reject me because of a patched library :)

  Changed 3 years ago by codethief

  • cc codethief@… added

I'm experiencing the same issues and, unfortunately, none of the proposed solutions works. My setup: In my et-sdl-sound file I declared "alsa" as audio driver because it wouldn't find "pulse", "pulseaudio", "libpulse" or anything else but "alsa". That's why I forward all audio signals coming to ALSA to PulseAudio via my .asoundrc:

pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}

I understand that this forwarding is likely to be exactly the reason for the sound lags I experience in Wolfenstein: Enemy Territory but it doesn't work any other way.

Does anyone have a idea?

  Changed 3 years ago by codethief

  • cc codethief@… removed

I was about to try to use ALSA and PulseAudio in parallel when I read that the PulseAudio support in SDL had nothing to do with PulseAudio itself but rather only with SDL. So, when I did "aptitude seach sdl" to check whether I had the newest version installed, it showed me

p   libsdl1.2debian-pulseaudio  - Simple DirectMedia Layer (with X11 and PulseAudio options)

Installed it, changed the value of SDL_AUDIODRIVER from "alsa" to "pulse" in the et-sdl-sound file, worked!

Of course, this doesn't touch the bug at all but it's still a nice work-around if you're trying to get sound in your games working (where latency probably affects you most).

Note: See TracTickets for help on using tickets.