From 6227fed5be1dce37df1f24f08fa68a9a3eb6b39d Mon Sep 17 00:00:00 2001 From: nbsnl <118115392+nbsnl@users.noreply.github.com> Date: Sat, 15 Nov 2025 23:48:28 +0300 Subject: [PATCH] Fix fullscreen startup crash caused by WASAPI audio initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The client was crashing during fullscreen initialization due to a NULL IMMDeviceEnumerator pointer inside miniaudio’s WASAPI backend. Crash location: ma_IMMDeviceEnumerator_GetDefaultAudioEndpoint (inlined in ma_device_init_internal__wasapi) Disassembly showed a null vtable dereference: call qword ptr [rax+20h] On some systems, WASAPI fails to create or retrieve the default audio endpoint (especially in VMs, RDP sessions, missing/disabled audio devices, or timing issues during fullscreen initialization). This results in a NULL COM pointer being used, causing a 0xC0000005 access violation before the game window fully appears. Solution: WASAPI backend has been disabled and the client now falls back to the more stable DirectSound/WinMM audio backends. Applied definitions: #define MA_NO_WASAPI #define MA_ENABLE_DSOUND #define MA_ENABLE_WINMM Results: ✔ Fullscreen crash completely resolved ✔ Audio still works through DirectSound ✔ Improved stability across fullscreen/windowed modes ✔ No functional drawbacks observed --- src/AudioLib/MaSoundInstance.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/AudioLib/MaSoundInstance.h b/src/AudioLib/MaSoundInstance.h index 2196965..7c8e280 100644 --- a/src/AudioLib/MaSoundInstance.h +++ b/src/AudioLib/MaSoundInstance.h @@ -1,4 +1,7 @@ #pragma once +#define MA_NO_WASAPI +#define MA_ENABLE_DSOUND +#define MA_ENABLE_WINMM #include inline constexpr float CS_CLIENT_FPS = 61.0f;