mackron / miniaudio

Audio playback and capture library written in C, in a single source file.
https://miniaud.io
Other
4.07k stars 361 forks source link

simple_duplex example + Windows + DSOUND backend + ma_performance_profile_low_latency causes audio to sound broken up #429

Closed Keithcat1 closed 2 years ago

Keithcat1 commented 2 years ago

Sounds as well as can be expected with ma_performance_profile_conservative though. MA_DEBUG_OUTPUT: DEBUG: Loading library: ole32.dll DEBUG: Loading symbol: CoInitializeEx DEBUG: Loading symbol: CoUninitialize DEBUG: Loading symbol: CoCreateInstance DEBUG: Loading symbol: CoTaskMemFree DEBUG: Loading symbol: PropVariantClear DEBUG: Loading symbol: StringFromGUID2 DEBUG: Loading library: user32.dll DEBUG: Loading symbol: GetForegroundWindow DEBUG: Loading symbol: GetDesktopWindow DEBUG: Loading library: advapi32.dll DEBUG: Loading symbol: RegOpenKeyExA DEBUG: Loading symbol: RegCloseKey DEBUG: Loading symbol: RegQueryValueExA DEBUG: Failed to initialize WASAPI backend. DEBUG: Loading library: ole32.dll DEBUG: Loading symbol: CoInitializeEx DEBUG: Loading symbol: CoUninitialize DEBUG: Loading symbol: CoCreateInstance DEBUG: Loading symbol: CoTaskMemFree DEBUG: Loading symbol: PropVariantClear DEBUG: Loading symbol: StringFromGUID2 DEBUG: Loading library: user32.dll DEBUG: Loading symbol: GetForegroundWindow DEBUG: Loading symbol: GetDesktopWindow DEBUG: Loading library: advapi32.dll DEBUG: Loading symbol: RegOpenKeyExA DEBUG: Loading symbol: RegCloseKey DEBUG: Loading symbol: RegQueryValueExA DEBUG: Attempting to initialize DirectSound backend... DEBUG: Loading library: dsound.dll DEBUG: Loading symbol: DirectSoundCreate DEBUG: Loading symbol: DirectSoundEnumerateA DEBUG: Loading symbol: DirectSoundCaptureCreate DEBUG: Loading symbol: DirectSoundCaptureEnumerateA DEBUG: System Architecture: DEBUG: Endian: LE DEBUG: SSE2: YES DEBUG: AVX2: NO DEBUG: NEON: NO INFO: [DirectSound] INFO: Default Capture Device (Capture) INFO: Format: 16-bit Signed Integer -> 16-bit Signed Integer INFO: Channels: 2 -> 2 INFO: Sample Rate: 48000 -> 44100 INFO: Buffer Size: 9603 (2880) INFO: Conversion: INFO: Pre Format Conversion: NO INFO: Post Format Conversion: NO INFO: Channel Routing: NO INFO: Resampling: YES INFO: Passthrough: NO INFO: Default Playback Device (Playback) INFO: Format: 16-bit Signed Integer -> 16-bit Signed Integer INFO: Channels: 2 -> 2 INFO: Sample Rate: 44100 -> 44100 INFO: Buffer Size: 8823 (2646) INFO: Conversion: INFO: Pre Format Conversion: NO INFO: Post Format Conversion: NO INFO: Channel Routing: NO INFO: Resampling: NO INFO: Passthrough: YES Press Enter to quit...

mackron commented 2 years ago

Thanks for the report. I was able to replicate this. I'm surprised this happened because I could have sworn I tested this with the default buffer size when I first developed it. In any case, I've just increased the minimum buffer size from 20ms to 30ms which I'm fine with doing since DirectSound is only a secondary backend. Are you able to give that a try before I release this? It's in the dev branch.

mackron commented 2 years ago

I've released this change.