[wdmaudiodev] Re: (No Thread-Topic: [wdmaudiodev]

  • From: Tim Roberts <timr@xxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Sun, 3 Jul 2016 18:51:24 -0700

On Jul 3, 2016, at 5:52 PM, 若水 <shlikewater@xxxxxxxxx> wrote:


Hello, I am studying avstream audio driver development. About pin 
_KSPIN_DESCRIPTOR_EX, I have some questions.
1 If I only develop a common audio driver, no other effect function, for mic 
function, do I need just ONE capture pin?

Correct.


2 How to set Flags in pin descriptor? When I start a recorder application, I 
want to get the data at Pin::DispatchProcess function. But I don't know how 
to set the flags.

Well, for a microphone, you don't get data in the Process function, you get 
empty buffers.  It's up to you to put data in them.  Sometimes that's done in 
Process, sometimes that's done in a separate routine triggered by hardware 
activity.

Look over the individual flags and see what you think.  You often want to know 
every time a new empty buffer arrives, so 
KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL is often useful.  If your 
hardware will be doing DMA transfers, you may want KSPIN_GENERATE_MAPPINGS.  
Beyond that, you may not need any others.


3 How to set KSALLOCATOR_FRAMING_EX in _KSPIN_DESCRIPTOR_EX? If my mic 
hardware is 2channels, 16bits, 48000samples, and I use 
DECLARE_SIMPLE_FRAMING_EX to realize KSALLOCATOR_FRAMING_EX, how to set the 
Frams, MiniFrameSize and MaxFrameSize?

If you don't care about buffer sizing or locations, then set that member to 
NULL.  In that case, the graph will decide the buffering based on other 
requirements.
— 
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

Other related posts:

  • » [wdmaudiodev] Re: (No Thread-Topic: [wdmaudiodev] - Tim Roberts