[wdmaudiodev] My question about GetPosition(WaveCyclic).

  • From: Jun Jiang <jun.jiang77@xxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Sun, 27 Nov 2011 08:43:25 +0000




Hi Experts, When I ran the test of Glitch for my microphone device, the test 
failed sometimes.When I checked the timestamp files, there were errors on time 
stamp for my microphone device. The function in my driver will affect the time 
stamp is GetPosition(WaveCyclic). There should be error in it. Currently in 
GetPosition(WaveCyclic), the latest position in cyclic buffer(Interrupt will 
update this position in my driver.) was returned. I know that according to WDK 
help, GetPosition(WaveCyclic) need to return the current position in ADC for 
capture device. If I return this value, CopyFrom was called to copy data, but 
there were no more data because the next interrupt was not comming. For this 
case, the total number copied by CopyFrom is larger than one frame size 
returned in SetNotificationFreq.  I dumped debugging messages of GetPosition 
and CopyFrom. I found some information about GetPosition and CopyFrom and my 
guess:1) Notify() will cause PortCls call GetPosition. And I call
  Notify() when interrupt comes. So there are new data ready. The position that 
returned is ahead of previous. So CopyFrom will be called.2) If GetPosition to 
return a new position ahead of previous(this GetPosition is called between 2 
interrupts and not triggerred by Notify. And It seems that there is a timer in 
PortCls to call it. I just guess from the debugging message. How about it?), 
CopyFrom will be called to copy data sa possible.  But before setting the state 
to KSSTATE_RUN, Windows has called SetNotificationFreq to get the frame size. I 
really do not understand why more data(more than the frame size) will be copied 
if GetPosition. Could somebody explain how PortCls decide when to call 
GetPosition and CopyFrom?  Thank you very much.   Many thanks,Audleyswood       
                                   

Other related posts:

  • » [wdmaudiodev] My question about GetPosition(WaveCyclic). - Jun Jiang