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

  • From: "Mike Kemp" <mjk@xxxxxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Thu, 29 May 2014 08:34:46 +0100

Hi Matthew

Can you just clarify why there is a size ambiguity with the WAVE_FORMAT_PCM?

This is for background interest and I don't have the documentation to hand, but 
I'd appreciate knowing what the issue is for future reference...

Thanks,

Mike
  ----- Original Message ----- 
  From: Matthew van Eerde 
  To: wdmaudiodev@xxxxxxxxxxxxx 
  Sent: Wednesday, May 28, 2014 12:11 AM
  Subject: [wdmaudiodev] Re: AVStream minidriver Capture stream fails WASAPI 
Exclusive-mode Stream


  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: