libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sound stutters on Windows Vista x86

Dasperal opened this issue · comments

In our project inter-doom, we use SDL2_mixer for audio playback, and experience sound stutters on Windows Vista x86.
They are happening for MP3, MOD, FLAC, opus, vorbis. With both official and vcpkg (with external codec libraries) builds of SDL2_mixer.
They happen for SDL2_mixer's timidity midi synth (GUS emulation) and our OPL2/3 midi synths.
MIDI playback using Windows MIDI API works fine.
There are also no sound stutters on Windows XP, Windows 7 and Windows 11.

I think that the problem is somewhere in SDL2_mixer, SDL2 itself or Windows Vista's audio subsystem.

Videos showing normal audio and stutters.
Expected (Win7 x64): https://www.youtube.com/watch?v=Ix6Mwx4Bkss
Actual (Win Vista x86): https://www.youtube.com/watch?v=oMDluIHAqSY

OS: Windows Vista SP2 x86
SDL2 Version: 2.26.5
SDL2_mixer Version: 2.6.3

The stutters were caused by the wasapi audio driver. To fix them, set SDL_HINT_AUDIODRIVER to directsound before audio subsystem of SDL is initialized.