Reputation: 544
Is it possible to have a custom device with multiple sensors including video and audio appear for all intents and purposes as a webcam (using standard Windows video and audio drivers) while allowing access to other simple sensors via COM or some other method?
Or do I have to build a new USB driver to access all this information? I would like to avoid this option as the device is just a prototype and they wish to build a demonstration application to gain funding asap. Finally, where can I learn more about this area? I have seen the book USB Complete mentioned in other answers (unfortunately not much time available).
Background:
I have been given the task of creating an application for a new device. The device has been built by a group of electrical engineers and provided with a demo application that communicates via COM (serial). The problem is the device has video and audio streams which are not able to be streamed fast enough (20fps desired) via serial but the other inputs (buttons and two other streaming sensors) are working.
The engineers want me to provide them with a 'protocol' to build the device to for the next version. I am a software engineer without much hardware experience, and am unfamiliar with the low level details of USB drivers.
Upvotes: 0
Views: 139
Reputation: 13682
This answer may be useful to you. In that post I discuss how drivers are no longer relevant given modern HID descriptors. I also go into detail about the state of the common libraries you should use for ease and speed of development. You will probably want to pick libusbx. It is decently documented. If you want to see an example of its usage, the answer I linked to has one example at the very bottom of the post. Good luck!
Upvotes: 2
Reputation: 2653
I'd recommend doing this by interfacing all streams over USB with multiple interfaces. You will need to make sure you choose a device that has enough endpoints to support all of these interfaces and processing power to service your audio/video and control streams.
You can have an interface for the USB Audio class for your audio stream, an interface for the USB Video class for your video stream, then you can define a vendor specific bulk or Human Interface Device (HID) class device for the interfacing to your sensors. If you do this then you should get the inbox driver for all of the above interfaces (supported on Windows, OSX and Linux).
You will need to develop some sort of software or protocol on the host to interface to the sensors, through libusb/WinUSB for bulk or through hidapi for HID.
I would say the hardest part here is choosing a device, getting all the descriptors up and correct for your implementation, and adhering to the class specifications for all interfaces.
Definitely read USB Complete. It is a great primer for USB development, and it covers basics as well as HID. Once you know the basics read the specs on USB Video and USB Audio Classes - it will make more sense once you understand interfaces, endpoints and general USB protocol.
Upvotes: 2