SDL/src
Clownacy 6efe0e19a7 Fix DirectSound buffer creation failure with >200kHz
Caps the sample rate at 200kHz so that SDL's mixer will downsample any streams which are higher than that.

My Mega Drive emulator outputs at 223721Hz (the sample rate of the PSG chip), and `SDL_OpenAudioDeviceStream` fails due to DirectSound's `CreateSoundBuffer` returning an 'invalid parameter' error code. Lowering the sample rate makes the error go away.

Reported to me by @B3HKO in this issue:
https://github.com/Clownacy/clownmdemu-frontend/issues/60

The 200kHz limit is documented here:
https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ee419022(v=vs.85)

DirectSound's Wikipedia article mentions that problems may occur with sample rates above 192kHz, but no source is provided, so I am unsure whether to take it seriously.
2026-03-25 13:23:24 -07:00
..
atomic Fix compiler warning in MSVC ARM64 builds 2026-01-19 10:16:35 -08:00
audio Fix DirectSound buffer creation failure with >200kHz 2026-03-25 13:23:24 -07:00
camera camera: Fix crash when setting frame rate and improve FPS precision 2026-03-02 11:59:17 -08:00
core render: Add Suspend/Resume calls for GDK support 2026-03-07 11:19:09 -05:00
cpuinfo Updated copyright for 2026 2026-01-01 09:40:08 -08:00
dialog make sure #endif comment matches the macro name 2026-02-28 08:43:42 -08:00
dynapi dynapi: Minor cleanups to library loading code. 2026-03-18 14:50:58 -04:00
events make sure #endif comment matches the macro name 2026-02-24 09:48:57 -08:00
filesystem emscripten: Add support for automounting persistent storage before SDL_main. 2026-03-25 14:16:07 -04:00
gpu GPU: Refcount Vulkan allocations to fix transfer corruption on defrag (#15127) 2026-03-10 13:33:07 -07:00
haptic Fix potential memory leak in SDL_HIDAPI_HapticOpenFromJoystick() on error 2026-03-01 11:35:58 -08:00
hidapi Added support for the Flydigi Vader 5 Pro in Xbox 360 mode 2026-02-24 10:18:17 -08:00
io io: With stdio, only forbid opening directories as files. 2026-03-12 12:41:34 -04:00
joystick Minor cleanup 2026-03-17 09:49:15 -07:00
libm CodeSpell 2026-02-07 18:14:00 +03:00
loadso Updated copyright for 2026 2026-01-01 09:40:08 -08:00
locale emscripten: Move some EM_ASM blocks to MAIN_THREAD_EM_ASM. 2026-02-20 10:27:44 -05:00
main emscripten: Add support for automounting persistent storage before SDL_main. 2026-03-25 14:16:07 -04:00
misc Add and use libusb_set_auto_detach_kernel_driver for the Switch 2 driver 2026-02-05 14:58:15 -08:00
power More prefer SDL_zero*() 2026-01-23 16:02:16 -08:00
process Updated copyright for 2026 2026-01-01 09:40:08 -08:00
render render: Skip UV check when software-rendering untextured quads 2026-03-25 07:24:55 -07:00
sensor make sure #endif comment matches the macro name 2026-02-24 09:48:57 -08:00
stdlib Fix strpbrk() discarded const qualifier 2026-03-10 14:25:28 -07:00
storage Updated copyright for 2026 2026-01-01 09:40:08 -08:00
test test_common: Changed a bunch of strcmp ifs to else ifs. 2026-02-04 14:27:41 -05:00
thread SDL_systhread.c: Remove SIGCHLD from blocked signal mask. 2026-03-18 13:10:03 -07:00
time include: Added \threadsafety notes to about 60 more functions. 2026-02-18 19:49:59 -05:00
timer Use Uint64 instead for tick_numerators in USE_128BIT_MATH 2026-02-25 20:18:51 -08:00
tray Fix warning: strict prototypes (#14992) 2026-02-07 07:38:59 -08:00
video video: add more direct mjpeg to yuv conversions 2026-03-24 08:59:50 -07:00
SDL.c Deprecate SDL_INIT_EVERYTHING from SDL2 2026-03-03 14:00:40 -05:00
SDL_assert.c make sure #endif comment matches the macro name 2026-02-24 09:48:57 -08:00
SDL_assert_c.h Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_error.c Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_error_c.h Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_guid.c Prefer SDL_zero()/SDL_zerop() 2026-01-23 11:23:27 -08:00
SDL_hashtable.c Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_hashtable.h Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_hints.c Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_hints_c.h Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_internal.h Loading PNG files are part of the core SDL library 2026-03-01 11:42:28 -08:00
SDL_list.c Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_list.h Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_log.c Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_log_c.h Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_properties.c Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_properties_c.h Updated copyright for 2026 2026-01-01 09:40:08 -08:00
SDL_utils.c emscripten: drag-and-drop fixes. 2026-02-09 21:39:02 -05:00
SDL_utils_c.h emscripten: drag-and-drop fixes. 2026-02-09 21:39:02 -05:00