What is the WDM-KS host API and when to use it
masterThe WDM-KS (Windows Driver Model - Kernel Streaming) host API provides a low-latency audio path by connecting PortAudio directly to the Windows Kernel Streaming API.
Key Characteristics
- Latency: Offers latency comparable to ASIO drivers, avoiding the mixing penalties associated with MME and DirectX.
- Compatibility: Works with any Windows audio hardware available via MME/DirectX without requiring specialized ASIO drivers.
- Exclusivity: Using the KS interface blocks the device from being used by other applications via higher-level APIs (and vice versa). If the system is using a device, the KS API cannot access it.
When to use it
Use WDM-KS only if your application has a strict requirement for very low latency audio (typically <20ms), such as:
- Real-time sound generation based on user input.
- Real-time audio processing of recorded streams.
Best Practice: Microsoft recommends keeping the device open only when your application has focus. In PortAudio, this means only having a stream Open on a WDMKS device while the application is active.