[wdmaudiodev] Re: Real Time Processing

  • From: Waldemar Haszlakiewicz <waldemar.haszlakiewicz@xxxxxxxx>
  • To: Pieterjan Demarcke <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Sat, 5 Mar 2005 11:23:47 +0100

If you want you can add your code even to the interrupt routine.
With that you can get latency down to less than 1ms, but take notice that this 
is against
the WinXP driver good behavior, as interrupt routine should be a s fast as it 
can get, so that
you don't stall the other parts of the system. Like some device needs a fast 
response from the
system just to fix some flag or something. So if you'll do a lot of processing 
in the interrupt
routine the system can start "hiccuping".

Ok now if I remember you previous mail you are doing just some really simple 
calculations right?
So if the machine isn't an old one there should be no worry.

Now all you need is a direct access to cards buffers, set the cards interrupt 
to something like
32samples (or less) and do your simple calculations.
Now the only problem is that communication with the card is much, much slower 
than speeds of the
CPUs. So the other way (and from the eyes of Microsoft the right way) around 
would be to do all
your stuff in DPC which as you said. The latency of 32samples can be easily 
achieved so....

Now you have 2 options:
- interrupt way -> can get really small latencies, but it's not in the way a
good driver should behave
- DPC way -> latency would be a little higher than with interrupt way, but 
still much smaller than
if you would send the data to user level and what is most important the driver 
will not offend any
"good driver laws"


PD> Thank you for all the inputs, I will consider them. Also there's one
PD> thing that seemed to be an option, but I don't know if it's possible:
PD> could I write a customDPC that processes each sample and writes it
PD> immediatly back to the line-out AND to a dedicated buffer (so i can
PD> acess the value from an user interface)? I'm not good aware of the
PD> possibilities of a DPC, but it seems to me that it stands the closest
PD> to the hardware. But maybe this isn't correct. Anyway thank you for
PD> all the idea's, you all helped me a lot already.

PD> Pieterjan
PD> ******************

PD> WDMAUDIODEV addresses:
PD> Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
PD> Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
PD> Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
PD> Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

PD> http://www.wdmaudiodev.de/


WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx


Other related posts: