Microsoft's Camera Usbvideo.sys driver

Hi !

I had a couple of questions regarding the Microsoft’s usbvideo.sys driver :

  1. Since, media foundation allows asynchronous readsample calls; Can the Class driver handle multiple outstanding requests ? What I am meaning to understand is if the requests are queued by media foundation and sent serially (/synchronously) to usbvideo.sys, or multiple parallel IRPs are queued for each requests by the class driver

  2. Also, is there any situation in which the usbvideo.sys can issue parallel USB Request Blocks to perhaps improve performance when for example an application requests higher resolution or frame rates ? (I am actually not able to capture parallel Requests within my USB Capture tool )

  • Eli

xxxxx@gmail.com wrote:

  1. Since, media foundation allows asynchronous readsample calls; Can the Class driver handle multiple outstanding requests ? What I am meaning to understand is if the requests are queued by media foundation and sent serially (/synchronously) to usbvideo.sys, or multiple parallel IRPs are queued for each requests by the class driver

Usbvideo.sys, like most video capture drivers, use Kernel Streaming 2
(AVStream). With KS, the driver handles a “stream” of buffers. When
there is data to send, he fetches the leading edge of the buffer stream
and copies into it. Usually, there will be multiple empty buffers in
the stream.

So, the queueing is not happening in Media Foundation. It’s happening
in the driver.

  1. Also, is there any situation in which the usbvideo.sys can issue parallel USB Request Blocks to perhaps improve performance when for example an application requests higher resolution or frame rates ? (I am actually not able to capture parallel Requests within my USB Capture tool )

I suspect you are confused about how USB works. Usbvideo.sys does, in
fact, queue up several URBs at once. With an isochronous pipe, it sends
down 2 requests, so one is active while the next is waiting. Remember
that a USB frame is all scheduled in advance. If you don’t have an
empty buffer waiting when the driver schedules the next frame, then you
miss that frame. Usbvideo.sys is careful to avoid that. The maximum
bandwidth for a USB 2 isochronous endpoint is 24 MB/s, and usbvideo.sys
does that easily.

USB is a serial bus. An endpoint can only fill one request at a time.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.