[wdmaudiodev] Re: Simple loopback audio driver
- From: Tim Roberts <timr@xxxxxxxxx>
- To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
- Date: Mon, 7 Mar 2016 11:53:59 -0800
Олег Герасимчук wrote:
Thanks Tim, I thought about it. I am new in driver development.
And what synchronization technique I must use? CopyFrom and CopyTo may
call in any IRQL.
In a virtual driver, that's clearly not the case. There is no hardware,
so there aren't any interrupts. Thus, you can never be called higher
than DISPATCH_LEVEL. You should be able to use a KSPIN_LOCK.
Your current code has a couple of extra copies that can be eliminated.
You always copy any leftover data back to the beginning of the buffer.
It would take a little more code, but you can eliminate that extra copy
by making this a circular buffer, where the data wraps around the end.
Although you should probably make the code work before you worry about
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
URL to WDMAUDIODEV page:
Other related posts: