From 217523d605e92323291ef024107c7e519e16aa22 Mon Sep 17 00:00:00 2001 From: George Tokmaji Date: Sun, 29 Oct 2023 00:22:16 +0200 Subject: [PATCH] C4AudioSystemSdl: Log Mix_QuerySpec's return values to Clonk.log in order to better identify configuration issues --- src/C4AudioSystemSdl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/C4AudioSystemSdl.cpp b/src/C4AudioSystemSdl.cpp index adda43107..9f397a49b 100644 --- a/src/C4AudioSystemSdl.cpp +++ b/src/C4AudioSystemSdl.cpp @@ -163,6 +163,14 @@ C4AudioSystemSdl::C4AudioSystemSdl(const int maxChannels, const bool preferLinea StdSdlSubSystem system{SDL_INIT_AUDIO}; ThrowIfFailed("Mix_OpenAudioDevice", Mix_OpenAudioDevice(Frequency, Format, NumChannels, 1024, nullptr, SDL_AUDIO_ALLOW_ANY_CHANGE & ~SDL_AUDIO_ALLOW_CHANNELS_CHANGE) != 0); + + int frequency; + Uint16 format; + int channels; + Mix_QuerySpec(&frequency, &format, &channels); + + LogSilentF("SDL_mixer device spec: frequency = %d Hz, format = %hu, channels = %d", frequency, format, channels); + Mix_AllocateChannels(maxChannels); Mix_ChannelFinished(ChannelFinished); this->system.emplace(std::move(system));