Author Topic: OTG Video Class  (Read 10681 times)

jcheriton

  • Member
  • ***
  • Posts: 5
OTG Video Class
« on: July 02, 2010, 12:36:44 pm »
Hi,

I am involved in writing a video class for an Atmel AT32UC3 USB-capable processor so, being new to USB, I bought "USB Complete 4th Edition" in an effort to understand exactly what I had taken on.

So far I have mostly enumerated the video device and am just struggling through setting up the interfaces. The device in question is a webcam with trigger button so it has 2 interfaces in the Interface Association descriptor - one Interrupt type for status (probably mostly the button) and one Streaming type for the video output. The problem I have is that the video streaming interface is made up of several Interface descriptors with differing Alternates that point to the same endpoint. I have assumed that I only need to set up one pipe for this endpoint instead of setting up several, one for each interface/alternate pair with all pointing to the same endpoint.

Am I correct in this assumption?

John

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: OTG Video Class
« Reply #1 on: July 02, 2010, 05:53:06 pm »
Only one alternate interface on an endpoint is active at a time, so yes, you're correct.

Jan

jcheriton

  • Member
  • ***
  • Posts: 5
Re: OTG Video Class
« Reply #2 on: July 05, 2010, 06:24:27 am »
Jan,

Thanks for the reply. It seemed to make more sense doing that :)

John

jcheriton

  • Member
  • ***
  • Posts: 5
Re: OTG Video Class
« Reply #3 on: August 06, 2010, 03:49:29 pm »
Hi again,

Well I'm much further on with this but have reached an impasse when it comes to retrieving data from the camera.

The device is already set to and has accepted the format and frame that I wish to collect using the PROBE and COMMIT controls. I had assumed that if I were to change the streaming interface from Alternate 0 (no bandwidth) to another Alternate (in my case 6) the isochronous data delivery would start as soon as I send an IN token after the next micro-frame SOF. Is this correct or have I forgotten something? Pardon my ignorance but it seems to me that I am missing some information before starting the data retrieval - some command that returns, for example, the number of packets per microframe and their size. PROBE gives me a dwMaxPayloadTransferSize of 1600 bytes while the endpoint shows wMaxPacketSize as 5120 bytes, the last of which apparently implies 3 packets per microframe due to bits 11 & 12 (read that somewhere but not sure where). These two figures don't add up - literally.

[edit] actually having just re-read the paragraph about endpoint packet sizes I realise that the 5120-byte MaxPacketSize reported includes bit 11 and 12 so really I have a 1024-byte packet with 3 per microframe... which doesn't really explain there the 1600-byte dwMaxPayloadTransferSize fits in :-S[/edit]

So, in a nutshell, what, if anything, am I missing. I have read your book until I'm bloodshot and have obviously missed something important. Where, for instance, does one use the USB_START_ISOCH_ASAP flag?

John  :-[
« Last Edit: August 06, 2010, 04:21:41 pm by jcheriton »