From 7515f05d80a0c8a8cf64d94834972c24d4c1765f Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 23 Oct 2025 15:53:50 +0100 Subject: [PATCH] dont force directsound for sdl versions from 2.26.5 on windows directsound is deprecated since 13 years! superseeded by wasapi 2.26.5 sdl brought some major improvements to resampling which fixes the issues this aimed to work around, but instead this workaround caused a plethora of issues, like breaking loops in some cases or the votescreen music --- src/sdl/mixer_sound.c | 3 ++- src/sdl/sdl_sound.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 59cffed4a..96402c96f 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -169,9 +169,10 @@ void I_StartupSound(void) if (sound_started) return; -#ifdef _WIN32 +#if defined(_WIN32) && !SDL_VERSION_ATLEAST(2,26,5) // Force DirectSound instead of WASAPI // SDL 2.0.6+ defaults to the latter and it screws up our sound effects + // SDL 2.26.5 brought imrovements to resampling so this just screws up other stuff now SDL_setenv("SDL_AUDIODRIVER", "directsound", 1); #endif diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index c986b9b54..280b8f0d0 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -1073,9 +1073,10 @@ void I_StartupSound(void) // Configure sound device CONS_Printf("I_StartupSound:\n"); -#ifdef _WIN32 +#if defined(_WIN32) && !SDL_VERSION_ATLEAST(2,26,5) // Force DirectSound instead of WASAPI // SDL 2.0.6+ defaults to the latter and it screws up our sound effects + // SDL 2.26.5 brought imrovements to resampling so this just screws up other stuff now SDL_setenv("SDL_AUDIODRIVER", "directsound", 1); #endif