[wdmaudiodev] Re: AVStream minidriver Capture stream fails WASAPI Exclusive-mode Stream

  • From: Matthew van Eerde <Matthew.van.Eerde@xxxxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Tue, 27 May 2014 23:11:34 +0000

It is an error (due to container size ambiguity) to specify wFormatTag = 
WAVE_FORMAT_PCM with wBitsPerSample = 24. Try:

Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE
Format.wBitsPerSample = 24
Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
SubFormat = KSDATAFORMAT_SUBTYPE_PCM
Samples.wValidBitsPerSample = 24
dwChannelMask = KSAUDIO_SPEAKER_STEREO

This doesn't explain your current predicament, though.

After streaming once in shared mode, what is PKEY_AudioEngine_DeviceFormat? You 
can query that by running this tool: 
http://blogs.msdn.com/b/matthew_van_eerde/archive/2011/06/13/how-to-enumerate-audio-endpoint-immdevice-properties-on-your-system.aspx

How (if at all) does this value differ from the format you're trying to use in 
exclusive mode?

When you do the IAudioClient::IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, 
...) call which fails, do you see any property requests in your driver?

Of particular interest are KSPROPERTY_PIN_DATAINTERSECTION, which calls into 
your IMiniport::DataRangeIntersection method, KSPROPERTY_PIN_PROPOSEDATAFORMAT, 
and KSPROPERTY_PIN_PROPOSEDATAFORMAT2.

Other related posts: