The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
[Workaround] RPI2 sound is crackling and lagging
josephpaul0


Joined: 10 Apr 2016
Posts: 3
Applies to : Raspberry Pi 2 and SDL2
OS : Raspbian Jessie

Problems encountered:
- the sound of your SDL2 game is lagging by half a second over HDMI audio
- the sound in your headset (with a jack) is crackling when plugged into the RPI

Possible cause: your SDL application uses Pulseaudio

Workarounds:
- Compile SDL without pulseaudio support (and ship it with your game):
./configure --disable-esd --enable-alsa --disable-pulseaudio --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl

- Open audio mixer at 48Khz (matching hardware decoder)
Mix_OpenAudio(48000, MIX_DEFAULT_FORMAT, 2, 4096)