Audio Subsystem Improvements

Having been a user of SDL2 for about a year now, I have come to really
appreciate its simplicity and powerful feature set. However, there are
some things that limit me in my work which mainly centers around audio.
I have made some sporadic posts to this list regarding these issues, but
figured I would collect them in a single message.

  • Latency

I have planned to write a small mixer on top of SDL’s audio subsystem
for a while. However, since SDL uses API’s like DirectSound and XAudio2
on Windows for example, the latency is bordering on unacceptable for my
needs (sometimes more than 50 milliseconds). I would very much like to
see an implementation of a WDMKS backend for Windows, and preferably
other backends with similar latency characteristics on non-Windows
platforms (5 milliseconds or so). This would enable me to write my mixer
on top, and hopefully achieve a total latency of around 20 milliseconds.
I would be happy to help contribute such an implementation for Windows,
if there is any interest in the community.

  • Better Resamplers

As far as I recall, Ryan mentioned a while back that he wants to revisit
the internal resamplers in SDL at some point. Are there any updates on
these plans? I can resample myself, of course, which is what I am doing
for the time being.

  • Recording

Being able to capture audio would be great. I often have the need to do
that in my work, and for now I have to leave the comfort of SDL and use
other libraries. It would be great to know what the plans are regarding
this feature, and if there is anything I could do to assist in the
development. Full duplex audio I/O would be especially useful.

Thanks for any information on this!

Kind regards,

Philip Bennefall

  • Latency

SDL 2.0.4 will call timeBeginPeriod(1) which should help with Windows
latency. There aren’t current plans to do a WASAPI target (which is the
modern version of WDM/KS), because it needs SDL to provide a resampler
that doesn’t suck as a baseline requirement, and we aren’t there yet. :slight_smile:

  • Better Resamplers

It’s on the TODO list. The resamplers and converters all need a serious
overhaul.

  • Recording

This is also on the TODO list.

Right now we’re just trying to get 2.0.4 shipped (which should be
happening any second now) and then we’ll figure out what we want to do
next. Audio is sort of a high-priority item for me, though, starting
with the resampling code.

–ryan.