Open digitalsignalperson opened 1 month ago
Seconded—I can understand not wanting to clutter SDL_AudioSpec
with it, but it would be nice to have real API functions at least. User-configurable audio latency is a legitimate feature and banishing it to SDL_SetHint
(hack) reads odd. I spent a fair chunk of time trying to find this feature at all (edit: it's not in the migration guide, or the wiki pages for SDL_OpenAudioDevice, SDL_OpenAudioDeviceStream, or SDL_AudioSpec).
Relevant past discussion: https://github.com/libsdl-org/SDL/issues/7450#issuecomment-1465289536
I am looking at if it makes sense to make a low latency audio application with SDL's audio backend and notice pipewire's clock.quantum and clock.force-quantum value are ignored by SDL.
GetDefaultSampleFramesFromFreq()
hard codes buffer sizes unless theSDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES
hint is set before initializing.If I do
pw-metadata -n settings 0 clock.quantum 128
, then thetestaudio.c
program shows a 1024 quantum value inpw-top
, unless I useSDL_SetHint(SDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES, "128");
in initialization.I see that SDL_AudioSpec had a
samples
field in SDL2 but was removed. Could it be optional or something?