We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4922

Summary: WASAPI: allow bigger buffer size
Product: SDL Reporter: Vitaly Novichkov <admin>
Component: audioAssignee: Ryan C. Gordon <icculus>
Status: WAITING --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 Keywords: target-2.0.16
Version: HG 2.1   
Hardware: All   
OS: Windows (All)   

Description Vitaly Novichkov 2019-12-31 17:05:33 UTC
Hello!
I need to stream a sound generated by the cycle-accurate chip emulator. It works fine on Linux and macOS and works with DirectSound and WinMM on Windows. However, on WASAPI it makes a very choppy result (chip emulator can't race with the shorter latency, it needs a bit bigger latency (at least 512 bytes)). WASAPI enforces to use a shorter latency than needed (approximately ~135).

Is here is possible to make some sort of software middle buffer to deal with heavy audio sources?

I don't know, should this patch help me or not https://bugzilla.libsdl.org/show_bug.cgi?id=4592, or it's totally unrelated thing.
Comment 1 Ryan C. Gordon 2020-03-24 20:17:00 UTC
We definitely _can_ buffer audio, and code exists to do this in SDL's audio loop, but I'm not sure if we force the sample size on WASAPI. I'll check.

--ryan.
Comment 2 Ryan C. Gordon 2020-04-07 18:49:08 UTC
Before we worry about buffering more, when you get a moment, can you see if the patch we just submitted from Bug #4592 makes this any better for you?

--ryan.