Hi Laurent, all,
That's interesting about the timestamps, I though they were supposed to be
essential for synchronising audio and video properly. I'm not using audio
myself so not too concerned about that side of things. Also, there was a
small footnote on one of the msdn pages about interlacing requiring
timestamps so I had tried that for make interlacing work...it didn't work
and interlacing still isn't working properly so I stripped out oll the
interlacing descriptors and I'm going to do deinterlacing manually now
anyway because I need to do frame grabbing to disk so having proper video
card deinterlacing wouldn't help much anyway.

I think I may have found the source of my fps problems however, my frame is
768 x576, and as a point of convenience I found that sending 4 lines in a
uvc packet seemed to work just fine. 4 x 768 + 12 (header) turns out to be
1028 x 3 isoc usb packets, which is obviously more than you're allowed, but
because it was showing the picture just fine I thought it was ok.
Cropping the image to a smaller width though, and making the usb packets
smaller, seems to fix the frame rate in windows. It seems that while the usb
stack can handle the larger isoc packets, there's some buffering in the uvc
driver that's not large enough to work. I still need to do more testing to
confirm that's the root of the problem however. That's actually what that
other message I sent here by mistake was about, I meant to send it to the
lpc3000 group, I need a lot more buffering in chip to get my usb packet
sizes back down to legit sizes. I'll let you all know if I get it sorted
out, because it's a pretty deceptive problem, and highlights a way your
linux driver handles dodgy hardware better!

lsusb:
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x9999 
  idProduct          0x8000 
  bcdDevice            1.00
  iManufacturer           1 xxxx
  iProduct                2 xxx
  iSerial                 3 DEMO12345678
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          198
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower              100mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass         14 Video
      bFunctionSubClass       3 Video Interface Collection
      bFunctionProtocol       0 
      iFunction               2 xxx
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      1 Video Control
      bInterfaceProtocol      0 
      iInterface              2 xxx
      VideoControl Interface Descriptor:
        bLength                13
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdUVC               1.00
        wTotalLength           50
        dwClockFrequency        6.000000MHz
        bInCollection           1
        baInterfaceNr( 0)       1
      VideoControl Interface Descriptor:
        bLength                17
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0201 Camera Sensor
        bAssocTerminal          0
        iTerminal               0 
        wObjectiveFocalLengthMin      0
        wObjectiveFocalLengthMax      0
        wOcularFocalLength            0
        bControlSize                  2
        bmControls           0x00000000
      VideoControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             3
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               5
        iTerminal               0 
      VideoControl Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      5 (PROCESSING_UNIT)
      Warning: Descriptor too short
        bUnitID                 5
        bSourceID               1
        wMaxMultiplier          0
        bControlSize            2
        bmControls     0x0000001f
          Brightness
          Contrast
          Hue
          Saturation
          Sharpness
        iProcessing             0 
        bmVideoStandards     0x 0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               8
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      VideoStreaming Interface Descriptor:
        bLength                            14
        bDescriptorType                    36
        bDescriptorSubtype                  1 (INPUT_HEADER)
        bNumFormats                         1
        wTotalLength                       79
        bEndPointAddress                  131
        bmInfo                              0
        bTerminalLink                       3
        bStillCaptureMethod                 0
        bTriggerSupport                     0
        bTriggerUsage                       0
        bControlSize                        1
        bmaControls( 0)                    27
      VideoStreaming Interface Descriptor:
        bLength                            27
        bDescriptorType                    36
        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)
        bFormatIndex                        1
        bNumFrameDescriptors                1
        guidFormat
{59555932-0000-1000-8000-00aa00389b71}
        bBitsPerPixel                      16
        bDefaultFrameIndex                  1
        bAspectRatioX                       0
        bAspectRatioY                       0
        bmInterlaceFlags                 0x00
          Interlaced stream or variable: No
          Fields per frame: 1 fields
          Field 1 first: No
          Field pattern: Field 1 only
          bCopyProtect                      0
      VideoStreaming Interface Descriptor:
        bLength                            38
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         1
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            768
        wHeight                           576
        dwMinBitRate                197376000
        dwMaxBitRate                197376000
        dwMaxVideoFrameBufferSize      884736
        dwDefaultFrameInterval         400000
        bFrameIntervalType                  0
        dwMinFrameInterval             400000
        dwMaxFrameInterval           10000000
        dwFrameIntervalStep                 1
      VideoStreaming Interface Descriptor:
        bLength                             6
        bDescriptorType                    36
        bDescriptorSubtype                 13 (COLORFORMAT)
        bColorPrimaries                     1 (BT.709,sRGB)
        bTransferCharacteristics            1 (BT.709)
        bMatrixCoefficients                 4 (SMPTE 170M (BT.601))
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x1404  3x 1028 bytes
        bInterval               1


-----Original Message-----
From: Laurent Pinchart [mailto:laurent.pinch...@ideasonboard.com] 
Sent: Monday, 13 September 2010 8:48 AM
To: linux-uvc-devel@lists.berlios.de
Cc: Andrew Leech
Subject: Re: [Linux-uvc-devel] Slow frame rate windows/linux?

----

> I feel there must be something wrong in my uvc descriptors / setup 
> that is confusing the windows driver where the linux one is more 
> forgiving. I've tried playing with the mix/max bitrates, and 
> continuous vs static frame intervals, all to no avail.

If you post the output of lsusb -v I could check the descriptors.

> I've also added timestamps to my frames (uncompressed yuy2) which I 
> think are working, but also noticed no difference.
> 
> Is there any way with the linux driver to check the frame timestamps, 
> if they're wrong it should show up as late/missed frames?

The uvcvideo driver ignores timestamps at the moment;

> Has anyone got any suggestions? I really want to ensure my hardware is 
> going to be stable on as wide a range of computers as possible.

--
Regards,

Laurent Pinchart

_______________________________________________
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to