It’s been a while since this question was asked, but… I will try it anyway.
Why are you using trailing edge stream pointer? It’s possible that you are doing what you want to
be doing, but I am guessing that you might be misunderstanding the purpose of leading and trailing
edge stream pointer.
In one of hardware designs that I happened to have a pleasure working on the FIFO was so small
that it couldn’t hold any meaningfully sized data. However it was possible to feed it a number of
buffers so it would switch to the next one when it finished working on the current one. For that
we had to use the trailing edge to have our hardware buffer and work one more than one buffer at a
time.
Even with that design we would still have to work with leading edge mostly and release it first.
If I understand you correctly you are releasing trailing edge stream pointer, which is not
something that downstream clients would expect you to do.
You are handing them a buffer out-of-order. Most of the time that will keep on waiting for the
first buffer (leading edge) unless leading edge=trailing edge, which means you have only 1 buffer
queue.
Also playing with allocator properties may not buy you anything because in many cases those
represent only preferences and will be overwritten or ignored by downstream client.
– Max.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-262702-
xxxxx@lists.osr.com] On Behalf Of Michael Jones
Sent: Friday, September 15, 2006 10:06 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] AVStream driver buffering
I’ve done a variety of kernel-mode drivers over the years, but this is
my first AVStream driver. I’ve created a driver based on the “avshws”
sample in the DDK. It’s for a simple video capture card which does not
support DMA.
In my Process routine, I simply advance the leading edge stream pointer
in my Process routine. In my DPC for ISR (triggered when data is
available), I get the trailing edge stream pointer, copy the data from
the hardware into the buffer, and advance the trailing edge pointer.
However, what I see occasionally is a NULL return from
KsPinGetTrailingEdgeStreamPointer. It appears that I’m only ever
getting one buffer to fill; sometimes Process is called too late (i.e.
after my hardware interrupt and the call to the DPC).
I’ve tried playing with the KSALLOCATOR_FRAMING_EX values, to no avail.
I guess I expected that I would get a queue of buffers (i.e. at least
2), and that I could fill them directly as data arrived from the hardware.
Can someone point me in the right direction here? I’d really like to
avoid buffering the data internally, since an extra copy would be
undesirable.
Thanks in advance,
– mkj
//
// Michael K. Jones
// Stone Hill Consulting, LLC
// http://www.stonehill.com
//_______________________________________________
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer