WASAPI Exclusive mode


#1

Hi Jules, I'm debugging why the exclusive mode is not working on my machine, and it seems that in WASAPIDeviceBase constructor, IAudioClient::IsFormatSupported always returns AUDCLNT_E_UNSUPPORTED_FORMAT, EVEN for the format returned from IAudioClient::GetMixFormat (?)

I imagine this is the base culprit to why exclusive mode eludes me.

BTW, the Portaudio WASAPI exclusive mode does seem to enumerate all samplerates correctly, I'll take a peek to see how the WAVEFORMATEX looks there, I imagine it's a problem with bits per sample/alignment/etc..

 


#2

I've managed now to initialize my device in exclusive mode with correct format, sample rate and buffersize, and I can select from sample rates, buffer sizes...

But it sounds awful to nothing :(

I've not yet "deciphered" the streaming parts (copyBuffers etc.), so there must be something that gets wrong with respect to actualBufferSize and currentBufferSize.

I suspect that you'd be able, from my changes, make a working implementation quite easily. Sending you the code...

Edit: Problem was that the GetCurrentPadding value is meaningless in exclusive mode, and all that's needed is to wait for the clientEvent signal to pull the buffer. Then it works like a charm, also I fixed so that Initialize is passed a correct period, so that the latency will be truly low.


#3

Ok.. I was just looking at the changes you sent yesterday - could you send me these new changes too?