Fix: Make WASAPI loopback buffer size adaptive to device capabilities#344
Fix: Make WASAPI loopback buffer size adaptive to device capabilities#344anshul23102 wants to merge 1 commit into
Conversation
The WASAPI loopback buffer was using a fixed size that could be incompatible with high-performance audio devices. This caused audio stuttering and irregular visualization spikes on systems with low-latency hardware. Now the buffer duration is determined dynamically based on the device's minimum supported period, with a minimum floor of 10ms to ensure compatibility across different hardware setups. Fixes SamXop123#331 Signed-off-by: Anshul Jain <aj.ts1758@gmail.com>
|
@anshul23102 is attempting to deploy a commit to the Dot_NotSam's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@SamXop123 /assign /claim I've assigned this issue to myself and claimed it as part of GSSoC 2026. Please apply the This PR addresses the WASAPI loopback buffer size limitation that was causing audio stuttering on high-performance systems by making the buffer duration adaptive to the device's capabilities. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes the WASAPI loopback buffer being hardcoded to a fixed size that's incompatible with high-performance audio devices. The buffer duration is now dynamically determined based on the device's minimum supported period with a 10ms floor.
Changes
WasapiLoopbackCaptureconstructor to query device period capabilities viaGetDevicePeriodMath.Max(minimumPeriod, 10ms)to adapt to hardware capabilitiesAudioClient.Initializeinstead of fixed 0Testing
Verified on high-performance audio interfaces that visualization no longer exhibits stuttering artifacts. The buffer now respects device latency constraints while maintaining compatibility across different hardware setups.
Related
Closes #331