Endoscope-3 Button Support

Questions on installation, device drivers and video application.
Post Reply
StewD
Posts: 10
Joined: Mon Jul 13, 2015 2:31 pm

Endoscope-3 Button Support

Post by StewD » Thu Jan 19, 2017 9:07 am

The Endoscope-1 (E1) and Endoscope-2 (E2) both have snapshot buttons on the handle. Button events are sent a Monitor.exe app or the video display app (Endoscope.exe), and the response is (for the user) immediate.

The E1 and E2 use custom drivers from PixArt Taiwan. The Endoscope-3 (E3) uses the generic Windows usbvideo.sys driver.

The E3 button is supportable (we tried this during app development) when the video display app is running with complex Windows libraries called DirectShow (DS). One DS function group supports a button event that allows a frame to be grabbed and displayed. For various reasons, partly the E3 hardware and partly the way the DS libraries work, this was unacceptably slow. The video stream has to be stopped, and the capture mode started before the frame can be grabbed. Then the stream has to be restarted. For the user, this means around 3-4 seconds after the button click before anything obvious happens.

Hence at present, we use a different DS function group to capture a video frame almost instantly, via a mouse click or keyboard hot-key.

We have examined the USB data packets with a suitable utility and its clear that a button event (a.k.a. USB interrupt) passes four bytes of data to the driver. What we need to do is catch those four bytes, and JUST those four bytes, and then send a message to MonitorE3.exe or Endoscope.exe without involving the DS libraries.

So how and when can this be done?
The solution is to create what's called a Lower Filter driver that sits "under" usbvideo.sys" and

a) passes all USB data packets through to Windows; and

b) watches for a button event, and when it occurs, notify another app, here MonitorE3.exe or Endoscope.exe.

Creating drivers is a non-trivial exercise: a huge amount of knowledge has to be understood before even a simple working driver can be created. Surprisingly, we have not found any code samples for this sort of driver.

Please be patient: we will solve this.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest