Wasapi exclusive streaming


  • Hello,

    I'm trying to implement audio streaming using the new Wasapi API.
    I've managed to make shared mode for recording and playback work but I'm stuck with getting exclusive mode work (AUDCLNT_SHAREMODE_EXCLUSIVE flag).
    Everything seems to work (i.e. all the calls to IAudioClient etc. return success) but after I call IAudioClient::Start() it seems that the actual streaming never begins, and the callback events are never set.
    A similar problem happens when capturing in shared mode, the callback event is never set, but I get around that by polling GetCurrentPadding() to see if there's data ready. This doesn't work in exclusive mode because GetCurrentPadding() always reports 0 for capture and on rendering no sample gets 'consumed' by the driver (i.e. the padding count increases as I send a new buffer but it never decreases as frames are streamed by the driver).

    Any help would be greatly appreciated.


    Flavio Antonioli.
    Thursday, January 04, 2007 11:37 AM

All replies

  • Qiao Flavio,

    Did you find solutions?  I had same problem.  Please share info.


    Wednesday, February 28, 2007 12:29 AM
  • also see:

    at the bottom. It says that the current driver may not support exclusive_mode yet.  Don't know when the Vista upgrade is available.

    Wednesday, February 28, 2007 12:40 AM
  • All audio drivers support Exclusive mode, it's an aspect of the audio engine, not the driver.


    Thursday, March 01, 2007 7:37 PM
  • Thanks Larry.

    But even I use control panel to set my special device to be exclusive mode, the data send done to device still be DSP(ed).  Any solution?  Any small tool allow me to send my own data to my device without any processing? I tried many tools include cooledit. Could you help?

    Thursday, March 01, 2007 11:50 PM
  • Exclusive mode isn't an attribute of an audio device, instead it's a description of how an application interacts with the audio solution.

    So you can't "set a device to be exclusive mode", all you can do is to decide if you want an application to be able to USE your device in exclusive mode.


    Friday, March 02, 2007 12:12 AM
  • Thanks Larry,

    Simple question is how can I send audio data from a opened file to my device (an USB audio device) without been processed?  I had some info coded in the audio data for some special purpose. My device works on XP etc. But for Vista, I found that the data is be processed.

    Friday, March 02, 2007 5:59 PM
  • Flap, are you running on x86 or x64?  If you're running on x64, are you compiling for x86?
    Friday, March 02, 2007 6:25 PM
  • That's exactly what I was doing, comipiling for x86 but running on x64 OS. I later discovered that exclusive playback seems to work in x64 Vista only for x64 native processes. Is that by design or is it a bug?

    I'm also still having problems with Wasapi capture + event notification. It seems to work without event notification, but when I select the event notification flag the event is never raised. Event notification works ok on playback.


    Saturday, March 03, 2007 2:36 PM
  • Flavio

    How do you set up your event when you call CreateEvent()? Is it auto or manual reset? The MSDN documentation does not discuss this issue at all.

    I've not yet got my Vista system running so cannot actually try this out myself.

    Please let me know if this makes a difference.

    Jerry (jerry @ novadsp dot com)

    Tuesday, March 06, 2007 4:53 PM
  • I'd be interested to know if anyone has discovered a solution to the capture event problem.  I'm seeing the same issue with either manual or auto-reset events. Will someone from MS please comment on this?  It's obviously either broken or has a non-obvious solution.  Thanks.


    Friday, November 02, 2007 5:03 PM
  • Event-driven exclusive-mode capture across a WOW64 boundary is broken in Vista RTM.  The fix should be in SP1.
    Wednesday, November 07, 2007 4:50 PM
  • Thanks for the reply, Matthew, but I'm runing the 32-bit flavor of Vista.  Am I incorrect in assuming that I'm not using WOW64?

    Wednesday, November 07, 2007 4:55 PM
  •  Snortblt wrote:

    Thanks for the reply, Matthew, but I'm runing the 32-bit flavor of Vista.  Am I incorrect in assuming that I'm not using WOW64?

    Yes... I think I was conflating two issues.

    Exclusive mode event-driven render across WOW64 is broken in Vista RTM.
    All event-driven capture is broken in Vista RTM.
    Tuesday, November 13, 2007 6:47 PM
  • Matthew

    This is an interesting assertion. Is your conclusion based on first-hand experience or is it a fault acknowledged by Microsoft in Vista RTM? Please understand that I'm not dissing you, I just need to know that trying to get event based capture to work on existing Vista builds is futile :-)


    Tuesday, November 13, 2007 7:16 PM
  • Thanks Matthew.  I second Jerry's question.
    Tuesday, November 13, 2007 10:41 PM
  • OK, here's the scoop (note to self: research first, then post.)

    On Vista RTM...

    Exclusive mode render from an x86 app on Vista x64 to a non-WaveRT device is broken in Vista RTM.

    Shared mode is OK; native x64 and native x86 are OK; HD Audio devices are OK.

    Also on Vista RTM...

    Event-driven capture doesn't work.  Period.  (The "data ready" event is never set.)

    Both are (should be) fixed in Vista SP1.

    I am a Software Development Engineer in Test for the Windows Sound Team, so you may consider this official Microsoft acknowledgement.
    Wednesday, November 14, 2007 5:07 PM
  • "Official"-er acknowledgement of the event-driven capture issue is here:

    The initial release of Windows Vista supports event-driven buffering (that is, the use of the AUDCLNT_STREAMFLAGS_EVENTCALLBACK flag) for rendering streams only.
    Wednesday, November 14, 2007 5:15 PM
  • Thanks for the detailed info. That explains a lot. I appreciate you passing that on.  I guess I'll wait for SP1, and let the keyboard-induced bruises on my head heal until then.

    Wednesday, November 14, 2007 5:16 PM
  • Hi Matthew

    Thanks, that is very useful information - I will postpone my fretting until SP1.

    Wednesday, November 14, 2007 5:30 PM
  • Is there someone who can tell me which is the update who fixes wasapi or update package who include the fix without SP1 ? I dont want to install SP1 ! Someone from the administrators ?
    Tuesday, March 03, 2009 4:27 PM