Quick answer: Linux audio lag noticeable in your game? PulseAudio buffers conservatively (100-200ms) for stability. Request smaller latency, or target PipeWire which defaults lower.
Bullet hits look 150ms late on Linux compared to Windows. The mixer is filled with PulseAudio buffer.
Latency Hints via SDL
SDL audio open accepts a desired samples value. Smaller = less latency. 1024 samples at 48kHz ≈ 21ms vs the default 4096 (85ms).
PulseAudio tlength
$ pacmd set-sink-input-volume ...
# or via env: PULSE_LATENCY_MSEC=30Environment variable hint that propagates through SDL. 30ms is aggressive but workable on most hardware.
PipeWire Migration
Modern distros default to PipeWire. It exposes lower latency natively and falls back to PulseAudio compat. Test on PipeWire-first systems to verify behavior.
Buffer Underruns
Lower latency = more underrun risk under CPU contention. Test with simulated load — if your audio drops, raise the buffer slightly.
Verifying
Audio events line up with visual events within 30ms. No pops or dropouts during normal play.
“PulseAudio defaults are safe but laggy. Request lower latency or use PipeWire.”
On Linux launches, test PulseAudio and PipeWire separately — behavior differs more than you’d expect for “the same audio call”.