usb camera development under QNX

Hi all,

I have been searching in the qnx forum for a usb camera, but somehow could not get a sound answer.

I am now using Gumstix Overo (OMAP 3530), and trying to use a usb camera on it. Below is my “usb -vvv” output. Please kindly give any suggestion making the camera driver work with the modification based on the usb-ddk-printer source. Many thanks.

USB 0 (EHCI) v1.10, v1.01 DDK, v1.01 HCD
Control, Interrupt, Bulk(SG), Isoch(Stream), Low speed, High speed

USB 1 (MENTOR) v1.10, v1.01 DDK, v1.01 HCD
Control, Interrupt, Bulk(SG), Isoch(Stream), High speed

Device Address : 1
Upstream Host Controller : 1
Upstream Device Address : 0
Upstream Port : 0
Upstream Port Speed : High
Vendor : 0x5986 (Vimicro Co.,ltd)
Product : 0x0137 (HP Webcam)
Device Release : r0.05
USB Spec Release : v2.00
Serial Number : N/A
Class : 0xef (Unknown)
Subclass : 0x02
Protocol : 0x01
Max PacketSize0 : 64
Languages : 0x0409 (English)
Current Frame : 1937 (1024 bytes)
Configurations : 1
Configuration : 1
Attributes : 0x80 (Bus-powered)
Max Power : 500 mA
Interfaces : 2 (with 7 alternate)
Interface : 0 / 0 (HP Webcam)
Class : 0x0e (Unknown)
Subclass : 0x01
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 64
Endpoint : 1
Attributes : Interrupt/IN
Max Packet Size: 10
Interval : 2 ms
Interface : 1 / 0
Class : 0x0e (Unknown)
Subclass : 0x02
Protocol : 0x00
Endpoints : Control + 0
Endpoint : 0
Attributes : Control
Max Packet Size: 64
Interface : 1 / 1
Class : 0x0e (Unknown)
Subclass : 0x02
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 64
Endpoint : 2
Attributes : Isoch/IN
Max Packet Size: 128
Interval : 1 mframe
Interface : 1 / 2
Class : 0x0e (Unknown)
Subclass : 0x02
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 64
Endpoint : 2
Attributes : Isoch/IN
Max Packet Size: 512
Interval : 1 mframe
Interface : 1 / 3
Class : 0x0e (Unknown)
Subclass : 0x02
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 64
Endpoint : 2
Attributes : Isoch/IN
Max Packet Size: 1024
Interval : 1 mframe
Interface : 1 / 4
Class : 0x0e (Unknown)
Subclass : 0x02
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 64
Endpoint : 2
Attributes : Isoch/IN
Max Packet Size: 2816
Interval : 1 mframe
Interface : 1 / 5
Class : 0x0e (Unknown)
Subclass : 0x02
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 64
Endpoint : 2
Attributes : Isoch/IN
Max Packet Size: 3072
Interval : 1 mframe
Interface : 1 / 6
Class : 0x0e (Unknown)
Subclass : 0x02
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 64
Endpoint : 2
Attributes : Isoch/IN
Max Packet Size: 4992
Interval : 1 mframe
Interface : 1 / 7
Class : 0x0e (Unknown)
Subclass : 0x02
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 64
Endpoint : 2
Attributes : Isoch/IN
Max Packet Size: 5120
Interval : 1 mframe

Eric,

This device is reporting as a class Unknown:

Looking at the USB class code specs

usb.org/developers/defined_class

says it actually communicates using the Video mode (makes total sense).

The usb-DDK printer source example is set to communicate using Bulk mode (0x0A). So I don’t believe you can easily modify that sample code to work with this mode as I expect it’s a streaming mode. But I could be wrong.

You may want to go to the Foundry27 website (where QNX people are)
community.qnx.com/sf/sfmain/do/listProjects
and post in the BSPs and Drivers forum asking about help for this kind of USB device. Maybe their USB person can give you a hint.

Tim

P.S. After looking at this usb dump again more closely you might be able to make it work after all. This particular transfer mode looks like it’s pure interrupt driven.

For this mode I’d suggest you use the mouse.c example instead of the printer.c. The mouse.c example is designed to work around an interrupt input. So you may get lucky and be able to receive the data. Note the mouse example does not expect to write data since a mouse doesn’t receive anything.

Hi Tim,

Tried with the mouse example, and can be detected as the case in “USB_ATTRIB_INTERRUPT” in mouse_parse_descriptors().

From the usb -vvv output above, it is clear that there are 7 interfaces with only one as the “Interrupt/IN”, the others are all “Isoch/IN”. But in the mouse sample code, this case is left empty in the code there. Further, i modified the “usbd_device_ident_t” as the Isoch/IN mode, then it cannot be identified as expected due to the fact that nothing is done in the code for this case.

But i believe the streaming video data should be working in Isoch/IN mode, so what else can I do now ? Modify the empty case based on other Isoch/IN sample code if any?

Eric

Eric,

You can indeed fill out the Isoch/IN mode case in parse_descriptors.

However I don’t know exactly what Isoch mode does. It’s clear that at the time these samples were created that there wasn’t any Isoch support or there wasn’t a device they had to write sample code for. So the problem for you is that you will attach to this end point. But you won’t have a clue what to do in terms of what’s required for handling this type of USB transfer in mouse_io_read (looking at the printer example it required prn_io and prn_bulk_read functions to do Bulk transfers). So what you’ll have to do is pour over the USB spec and see what Isoch mode is and how it differs from Interrupt mode / Bulk mode and then write all the missing code yourself for that transfer mode.

So if you are sure that mode is how the video is transferred I suggest you try the Foundry27 forum and/or talk to QNX directly (I hope you purchased a support plan) to see if there is an example of Isoch they can give you. You will also want to ask to see if io-usb (the actual hardware driver) supports Isoch mode. The only other option is to hire someone with USB driver experience in Isoch mode.

This link talks about Isoch mode and how it differs from Bulk mode. So maybe you can modify the printer example. Maybe.

sss-mag.com/usb.html

Tim

Hi Tim,

It took me quite a while to get back on this again… From the definition of the two mode, it seems that i can treat the ISOCH equivalently as BULK. While i could not get any response on this problem from the guys at qnx.com, but the new playbook features HD video…

Regards,
Eric

After reading the qnx usb ddk manual and usb camera 2.0 manual from usb. org, it seems that there is hope to make the camera working. I started the development based on the printer ddk sample, and currently i got stuck at one point:
when i provided the {class, subclass, protocol} as {0xef, 0x02, 0x01}, the insertion function can be called back, but if change to one of the interface {0x0e, 0x02, 0x00} then the insertion function can be called. And i found that in the previous case, the stuck happend at SignalWaitinfo().

Based on the usb working principle, the usb device should be first successfully attached and then the host will select the proper alternative setting for transfer. If provide with the latter values, then the interface cannot be set to Isoch/IN, which is desired for the image transfer.

Another question is how should i select the alternative setting, tho there is a negotiation process based on the official usb camera manual? Please suggest. Thank you.

Eric

How can I convert my old Sony Handycam video’s and upload them onto my PC? I have an old Sony Handycam with loads of tapes of old family videos, etc. I want to upload some clips onto Facebook, etc, but not too sure how I go about transferring the analogue video to digital. What connector do I need, etc. I’ve searched the net but there’s been nothing specific about the camera I used.