Trying to capture images from a webcam 200ms after a shutter is opened. Getting big problems due to propogation delays in the video drivers and partial images being captured. There is little control over the webcam via the DirectShow interface. The whole thing is wrapped up in a user-friendly black box.
Decided to go the ambitious route: write own driver. This way I can avoid any propogation delays, auto-exposure control, maybe stop it trying to stream video and just capture still images. To this end I am struggling with libusb-win32, a library which should allow me to write a USB driver in user space (i.e. not a device driver). Unfortunately it is steadfastly refusing to allow me to send any vendor messages to the device without giving me a CRC error. The USB initialises ok, I can select interfaces etc. I am using SweexCam which can capture images from a SN9C102 webcam chip but was written for linux. Comparing this with Sucr, a native libusb-win32 utility, I don't see what I am doing wrong.
I am using libusb-win32 as a device driver rather than as a filter driver. From what I can gather (there being no documentation other than a mailing list) the filter driver hooks into the existing device driver chain and allows you to inject your own traffic. With the device driver you take full control. I would prefer to use the filter driver and that do the initialisation but it dies early on in the initialisation sequence, when selecting an alternate interface. Also, whenever I uninstall the Filter Driver it takes out the USB Hub driver on my PC which is a little bit worrying (I have to uninstall and reinstall the Hub to get USB going again).
I got a good trace of the USB activity from the real driver using USB Sniffer and I feel there is a good chance I can get this going if only libusb-win32 will start playing ball. Unfortunately, USB Sniffer is refusing to log the activity of the driver I am writing, which would have been a useful debugging facility.
I may have to write my own code to initialise the CCD on the webcam. The webcam main chip appears to talk to this via an I2C bus. USB Sniffer gave me a good trace of the initialisation sequence so I am not too worried about this. That's the next problem.
Update: Tried latest development snapshot of libusb-win32 (20041118) and got past these problems in the release version (0.1.8.0: which is nine months old). Apparently this version also supports Isochronous transfers, which I may need.

