WASAPI excluive mode?

I’m wondering if there’s plans for exclusive mode in WASAPIAudioIODeviceType (don’t know if DirectSound has this implemented either) ?
In WASAPIAudioIODeviceType::createDevice it is set explicitly to false, but does the implementation work for exclusive mode ?


It’d be easy enough to enable, I just never added it because it’d involve adding some mechanism for telling the AudioDevice that you’d like to use that mode, and extra UI in the device selector component, etc.

TBH I’d be sceptical about how useful it would be anyway… Is it really so much better than non-exclusive mode that it’s worth the hassle of the device failing to open if any other app is using it?

1 Like

Well if I need a specific samplerate, bit depth etc. and be able to set it from the application then, yes.

Would be nice to see exclusive mode fully supported.
Latency can go low in exclusive mode. In shared mode its fixed around 10ms.

I thought ASIO was the standard, by far and large, for professional / pro-sumer audio devices. Is this not the case? Who sells hardware with WASAPI driver but no ASIO? And there’ always ASIO4ALL, which works great.

WASAPI is the main native Windows API on Vista and Win7. If you have an audio driver for Windows, you can use WASAPI. ASIO is good, but requires you to have a special driver, unless you have ASIO4ALL, but then again you might aswell use WASAPI instead of ASIO.

I’m sorry but whenever I think of WASAPI I can’t help but be reminded of this video:

[quote=“TheVinn”]I’m sorry but whenever I think of WASAPI I can’t help but be reminded of this video:

:lol: :lol: :lol:

Well my FireFace 400 has both WASAPI and ASIO drivers and when I use the WASAPI driver, I can never get latency as low as I could using the ASIO driver.

Interesting. How low a latency can you get with ASIO vs. WASAPI ?

Interesting. How low a latency can you get with ASIO vs. WASAPI ?[/quote]

ASIO: 48 samples
WASAPI: 144 samples

[quote=“TheVinn”]ASIO: 48 samples
WASAPI: 144 samples[/quote]

Not bad. Since both drivers must speak “FireWire”, the ASIO one must be better implemented than the Microsoft WDM audio driver, or the driver stack of WDM is what imposes the overhead. The 48 samples must be at max 44100 Hz, since Vista/Win7 are the first Windows OSs that can deliver a stable 1ms thread scheduling, which is a limit imposed on both WDM and ASIO.

1 Like

I think the advantage of WASAPI exclusive over ASIO is that all sound cards, especially the built-in ones that come with computers these days, support WASAPI (on Windows 7 of course). Most consumers don’t have ASIO-compatible sound cards, and most of them aren’t going to install ASIO4ALL. So if you’re developing low-latency audio software for average consumers, which I am, WASAPI exclusive is a good compromise, even though the latency is a tad higher than ASIO (as TheVinn said, it’s usually around ~1ms for ASIO, and ~3ms for WASAPI exclusive).

Anyway I’m putting my vote in for WASAPI exclusive support. I saw the const bool in WASAPIAudioIODeviceType::createDevice, but when I set it to true, it didn’t work (it couldn’t auto-determine the proper WAVEFORMATEX).

Or you can use Portaudio instead which has WASAPI exclusive mode implemented, or go directly with the WDM KS of portaudio (Win7 support not yet in PA trunk) which can allow < 5 ms natively on Windows (depending of course on the hardware).