Is Wasapi low latency?

What is WASAPI?
The Windows Audio Session API (WASAPI) is an audio API introduced by Microsoft in Windows Vista. It enables applications to interact with a device’s audio hardware directly, providing low latency and high fidelity audio (Microsoft, 2022). WASAPI provides two main modes:
Exclusive Mode: Gives the application exclusive access to the audio device. This avoids mixing with other audio streams and provides the lowest possible latency.
Shared Mode: Allows multiple applications to access the audio device concurrently. This introduces some latency but avoids interrupting other audio streams.
Some key capabilities offered by WASAPI include (The Well-Tempered Computer, n.d.):
- Bit-perfect audio output unaffected by Windows system effects
- Supports up to 32-bit/192 kHz high fidelity playback
- Provides lowest latency audio through exclusive mode
- Allows applications finer control over audio data flow
Overall, WASAPI gives developers low-level access to audio hardware for pro audio and music creation applications requiring high fidelity, low latency performance.
Latency in Audio
Audio latency refers to the time delay between an audio signal being generated and that signal being audible. As mentioned earlier, roundtrip latency is the amount of time it takes for a signal (such as a guitar solo) to get from the analog input on an audio interface, through the computer, and back out to the speakers or headphones. Latency becomes a problem when it’s high enough to become noticeable. This can make it difficult for musicians to play in time and get in the groove when monitoring their performance.
In general, a latency time of around 10ms or less will not affect the recording process. Above 10ms, the delay starts to become noticeable and can make performing more difficult. The higher the latency, the harder it is for musicians to stay in rhythm. High latency can essentially make software monitoring unusable for live playing. This is why lowering latency is crucial for audio interfaces and computer setups used for recording.
WASAPI Exclusive Mode
WASAPI has an exclusive mode that allows applications to bypass the Windows audio stack and talk directly to the audio driver. This reduces latency by removing the extra processing introduced by the Windows audio components like resampling and effects. According to Microsoft, “Applications that require low latency can use WASAPI exclusive mode to achieve sub-10 millisecond round-trip latency on machines with high performance sound cards” 1.
In exclusive mode, WASAPI connects directly to the audio hardware, taking exclusive control of it. The application can then send and receive audio data directly without going through any Windows audio processing. This eliminates any latency added by the Windows audio stack. The drawback is that it prevents other applications from accessing the audio hardware while in this mode.
Overall, WASAPI exclusive mode provides a way to achieve minimal latency by bypassing the Windows audio system entirely and connecting directly to the audio driver. This makes it well-suited for professional audio applications like DAWs that require very low latency.
Latency Benchmarks
Several tests have compared the latency of WASAPI versus DirectSound on Windows. According to Direct Sound Vs WASAPI—Which Is Best For Beginners?, WASAPI generally has lower latency than DirectSound in tests. One test on an Intel i7 system with an Audient EVO 4 audio interface showed WASAPI with a roundtrip latency of 4.3 ms versus 11.1 ms for DirectSound.
Another test by When to use what – ASIO/DirectSound/WASAPI using a Focusrite Scarlett 2i2 on Windows 10 showed WASAPI with a latency around 2-3 ms versus around 13 ms for DirectSound. The lower latency makes WASAPI better suited for applications requiring real-time audio like recording and virtual instruments.
Overall, benchmarks demonstrate WASAPI’s exclusive mode provides lower latency compared to DirectSound on Windows, which can be advantageous for certain audio applications. But DirectSound may still be sufficient for playback in media players and games.
Real-World Performance
When it comes to real-world latency performance for music production, user reports indicate that WASAPI can provide low latency that’s usable for most music applications. However, latency can vary depending on the audio interface, drivers, buffer size settings, and system configuration.
According to user testing on the r/audioengineering subreddit, WASAPI Exclusive Mode latency can get as low as 3-5ms with optimized drivers and interface, which is suitable for typical music production needs. This level of latency allows virtual instruments and MIDI controllers to feel responsive when monitoring live. One user was able to achieve 4.6ms latency using WASAPI compared to 11ms on ASIO.
However, for more demanding real-time applications like virtual reality or live electronic music performance, some users recommend combining WASAPI with ASIO drivers for the lowest possible latency. Overall, WASAPI delivers usable low latency for common music production scenarios on Windows 10 and 11, but performance can vary across systems.
Compatibility
WASAPI is supported on Windows Vista and later. It was first introduced with Windows Vista and is available on all newer Windows versions including Windows 7, Windows 8, Windows 10, and Windows 11.
According to Microsoft’s documentation, “The WASAPI interface is available beginning with Windows Vista and also on Windows Server 2008 and later.” (About WASAPI).
While WASAPI can work with most audio devices and programs on Windows, compatibility can vary depending on the specific hardware and software configurations. Some older programs may not support WASAPI fully. USB audio devices generally work well with WASAPI if the drivers are up-to-date.
Limitations
WASAPI does have some limitations in terms of driver, hardware, and platform dependencies:
It requires specific audio drivers that support the WASAPI interface. Not all devices, especially older ones, will have WASAPI-compatible drivers. According to The Well-Tempered Computer, “The audio drivers must be written to support WASAPI.”
WASAPI is designed for Windows Vista and later. It will not work on earlier Windows versions. Even on supported Windows platforms, some audio devices may not work properly with WASAPI if they lack updated drivers.
There are also limitations in terms of audio formats and sample rates. According to Audacity forums, “The limitation is that the WASAPI loopback audio comes into Audacity at 44100 Hz.” So WASAPI seems to prioritize 16-bit 44.1kHz audio.
Overall, WASAPI requires hardware, drivers, and platforms designed for its capabilities. Older systems may have compatibility issues. Certain sample rates and formats are also prioritized over others.
Recommendations
WASAPI with exclusive mode enabled is recommended for latency-sensitive audio applications that need optimized performance, such as digital audio workstations (DAWs), DJ software, virtual instruments, and gaming[1](https://www.reddit.com/r/headphones/comments/u8jq7p/what_is_asio_and_wasapi_and_do_i_need_them/). Exclusive mode bypasses the Windows audio engine and provides direct access to the audio interface, reducing latency and improving timing precision. This makes WASAPI well-suited for recording, mixing, and live monitoring where lag can disrupt the workflow. For playback of music or videos, shared mode is usually sufficient since latency is less noticeable.
Enable exclusive mode in your audio application’s settings if available. Some programs like REAPER and Voicemeeter offer WASAPI but don’t enable exclusive mode by default. Check your audio interface control panel as well. Benchmark the latency difference between shared and exclusive mode to determine if exclusive provides meaningful improvement.
Using WASAPI does require compatible hardware and software. WASAPI may not work properly on older operating systems. Verify compatibility before implementing for critical audio tasks. Overall, WASAPI exclusive mode is recommended for pro audio users on Windows seeking the lowest possible latency.
Alternatives to WASAPI
While WASAPI is a common audio API on Windows, there are some alternatives that provide their own benefits:
ASIO (Audio Stream Input/Output) is a low-latency audio API that was developed by Steinberg. It provides lower latency than WASAPI and is commonly used for audio interfaces and software like digital audio workstations. However, it requires specific ASIO drivers and lacks compatibility with many consumer sound cards. Some people argue ASIO provides better sound quality than other APIs.
DirectSound is a legacy audio API that has been largely replaced by WASAPI in recent Windows versions. It operates at a higher latency but has wider hardware compatibility. For basic audio playback, DirectSound can provide similar performance to WASAPI.
AudioGraph is a newer API introduced in Windows 10 for universal audio development. It provides lower latency performance closer to ASIO but requires custom drivers. AudioGraph is intended to eventually supersede WASAPI but currently lacks widespread adoption.
Overall, while alternatives like ASIO and DirectSound have advantages in specific use cases, WASAPI provides a good balance of latency, compatibility and audio quality for most consumer audio playback needs.
Conclusion:
In summary, WASAPI’s exclusive mode can achieve very low audio latency on Windows operating systems. Benchmarks show latency in the range of 3-6 ms can be attained, which is adequate for professional audio applications. However, real-world performance depends on audio interface, drivers, and system capabilities. WASAPI exclusive mode is only supported on Vista and later Windows versions. The exclusivity prevents simultaneous audio from other apps. For most users, WASAPI shared mode provides sufficient performance without these limitations. But for professional audio production, WASAPI exclusive mode delivers the low latency needed.