WASAPI excluive mode ?

For Windows specific issues

WASAPI excluive mode ?

Postby robiwan » Mon Jan 17, 2011 9:13 am

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 ?

TIA
/Rob
User avatar
robiwan
JUCE UberWeenie
 
Posts: 424
Joined: Mon Dec 18, 2006 9:38 pm
Location: Uppsala - Sweden

Re: WASAPI excluive mode ?

Postby jules » Mon Jan 17, 2011 11:37 am

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?
User avatar
jules
Fearless Leader
 
Posts: 17193
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: WASAPI excluive mode ?

Postby robiwan » Mon Jan 17, 2011 1:16 pm

Well if I need a specific samplerate, bit depth etc. and be able to set it from the application then, yes.
User avatar
robiwan
JUCE UberWeenie
 
Posts: 424
Joined: Mon Dec 18, 2006 9:38 pm
Location: Uppsala - Sweden

Re: WASAPI excluive mode ?

Postby OBO » Mon Jan 17, 2011 2:20 pm

Would be nice to see exclusive mode fully supported.
Latency can go low in exclusive mode. In shared mode its fixed around 10ms.
OBO
JUCE Obsessive
 
Posts: 82
Joined: Fri Sep 18, 2009 8:09 pm

Re: WASAPI excluive mode ?

Postby TheVinn » Mon Jan 17, 2011 2:24 pm

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.
Open Source: LayerEffects, VFLib, SimpleDJ, DSP Filters, LuaBridge, JUCE, FreeType, TagLib
"This isn't a big project, it shouldn't take long." - Jules
User avatar
TheVinn
JUCE UberWeenie
 
Posts: 2975
Joined: Sat Aug 29, 2009 11:31 am
Location: Marina del Rey, California

Re: WASAPI excluive mode ?

Postby robiwan » Mon Jan 17, 2011 2:27 pm

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.
User avatar
robiwan
JUCE UberWeenie
 
Posts: 424
Joined: Mon Dec 18, 2006 9:38 pm
Location: Uppsala - Sweden

Re: WASAPI excluive mode ?

Postby TheVinn » Mon Jan 17, 2011 3:43 pm

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

http://www.youtube.com/watch?v=dkHJKakHMpo
Open Source: LayerEffects, VFLib, SimpleDJ, DSP Filters, LuaBridge, JUCE, FreeType, TagLib
"This isn't a big project, it shouldn't take long." - Jules
User avatar
TheVinn
JUCE UberWeenie
 
Posts: 2975
Joined: Sat Aug 29, 2009 11:31 am
Location: Marina del Rey, California

Re: WASAPI excluive mode ?

Postby robiwan » Mon Jan 17, 2011 3:58 pm

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

http://www.youtube.com/watch?v=dkHJKakHMpo

:lol: :lol: :lol:
User avatar
robiwan
JUCE UberWeenie
 
Posts: 424
Joined: Mon Dec 18, 2006 9:38 pm
Location: Uppsala - Sweden

Re: WASAPI excluive mode ?

Postby TheVinn » Thu Jan 27, 2011 4:40 pm

robiwan wrote: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.


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.
Open Source: LayerEffects, VFLib, SimpleDJ, DSP Filters, LuaBridge, JUCE, FreeType, TagLib
"This isn't a big project, it shouldn't take long." - Jules
User avatar
TheVinn
JUCE UberWeenie
 
Posts: 2975
Joined: Sat Aug 29, 2009 11:31 am
Location: Marina del Rey, California

Re: WASAPI excluive mode ?

Postby robiwan » Thu Jan 27, 2011 5:15 pm

TheVinn wrote: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 ?
User avatar
robiwan
JUCE UberWeenie
 
Posts: 424
Joined: Mon Dec 18, 2006 9:38 pm
Location: Uppsala - Sweden

Re: WASAPI excluive mode ?

Postby TheVinn » Thu Jan 27, 2011 5:31 pm

robiwan wrote:
TheVinn wrote: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 ?


ASIO: 48 samples
WASAPI: 144 samples
Open Source: LayerEffects, VFLib, SimpleDJ, DSP Filters, LuaBridge, JUCE, FreeType, TagLib
"This isn't a big project, it shouldn't take long." - Jules
User avatar
TheVinn
JUCE UberWeenie
 
Posts: 2975
Joined: Sat Aug 29, 2009 11:31 am
Location: Marina del Rey, California

Re: WASAPI excluive mode ?

Postby robiwan » Thu Jan 27, 2011 5:42 pm

TheVinn wrote:ASIO: 48 samples
WASAPI: 144 samples


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.
User avatar
robiwan
JUCE UberWeenie
 
Posts: 424
Joined: Mon Dec 18, 2006 9:38 pm
Location: Uppsala - Sweden

Re: WASAPI excluive mode ?

Postby MusicMan3001 » Thu Dec 22, 2011 6:57 am

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).
MusicMan3001
JUCE UberWeenie
 
Posts: 115
Joined: Fri Nov 28, 2008 4:29 am

Re: WASAPI excluive mode ?

Postby robiwan » Thu Dec 22, 2011 8:56 am

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).
User avatar
robiwan
JUCE UberWeenie
 
Posts: 424
Joined: Mon Dec 18, 2006 9:38 pm
Location: Uppsala - Sweden


Return to Windows

Who is online

Users browsing this forum: No registered users and 1 guest