Re: [Linux-uvc-devel] Slow frame rate windows/linux?

2010-09-16 Thread Laurent Pinchart
Hi Andrew,

On Monday 13 September 2010 01:30:35 Andrew Leech wrote:
 Hi Laurent, all,
 That's interesting about the timestamps, I though they were supposed to be
 essential for synchronising audio and video properly.

Yes they are... :-)

 I'm not using audio myself so not too concerned about that side of things.

Same here, that's why timestamp support hasn't been implemented yet. And also 
because it doesn't seem to be supported in the USB Audio Class driver either.

I'd love it if someone could write timestamps support for the uvcvideo driver, 
but that's a difficult task.

 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!

Given the amount of dodgy hardware out there, I'm not surprised that the Linux 
driver works better than the Windows driver :-) Several vendors ship (or at 
least used to ship) a custom UVC driver for Windows to work around device 
bugs.

-- 
Regards,

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


Re: [Linux-uvc-devel] Slow frame rate windows/linux?

2010-09-15 Thread Andrew Leech
Just an update, yeah I've confirmed that the USB isoc packet sizes were the
culprit. Linux can handle overspec'd usb packets (1028 bytes), it appears
that the microsoft usb stack can handle them, but microsoft's usbvideo.sys
can't, it misses about every second frame. 

Fixed the usb packet size to be = 1024 and it streams just fine in both
windows and linux!

Cheers,
Andrew

-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


Re: [Linux-uvc-devel] Slow frame rate windows/linux?

2010-09-12 Thread Laurent Pinchart
Hi Andrew,

On Wednesday 08 September 2010 02:03:02 Andrew Leech wrote:
 Hi everyone,
 
 This may not be most appropriate place to ask, because the UVC device I'm
 building (custom hardware) actually seems to be working pretty well under
 linux, I'm getting a nice steady 25fps PAL picture. I just feel there's a
 lot of expertise here that someone may be able to assist.
 
 The problem is my hardware under windows only gets ~10-12fps, and I need
 cross platform compatibility. It doesn't report any dropped frames, and it
 gets this speed no matter which renderer I use.
 
 I don't think the problem is the pc, as I've tried it on a couple of
 different windows boxes and the working linux is in a vmware instance on
 the same pc anyway.
 
 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


Re: [Linux-uvc-devel] Slow frame rate windows/linux?

2010-09-12 Thread Andrew Leech
 0x81  EP 1 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0008  1x 8 bytes
bInterval   8
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber1
  bAlternateSetting   0
  bNumEndpoints   0
  bInterfaceClass14 Video
  bInterfaceSubClass  2 Video Streaming
  bInterfaceProtocol  0 
  iInterface  0 
  VideoStreaming Interface Descriptor:
bLength14
bDescriptorType36
bDescriptorSubtype  1 (INPUT_HEADER)
bNumFormats 1
wTotalLength   79
bEndPointAddress  131
bmInfo  0
bTerminalLink   3
bStillCaptureMethod 0
bTriggerSupport 0
bTriggerUsage   0
bControlSize1
bmaControls( 0)27
  VideoStreaming Interface Descriptor:
bLength27
bDescriptorType36
bDescriptorSubtype  4 (FORMAT_UNCOMPRESSED)
bFormatIndex1
bNumFrameDescriptors1
guidFormat
{59555932--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:
bLength38
bDescriptorType36
bDescriptorSubtype  5 (FRAME_UNCOMPRESSED)
bFrameIndex 1
bmCapabilities   0x00
  Still image unsupported
wWidth768
wHeight   576
dwMinBitRate197376000
dwMaxBitRate197376000
dwMaxVideoFrameBufferSize  884736
dwDefaultFrameInterval 40
bFrameIntervalType  0
dwMinFrameInterval 40
dwMaxFrameInterval   1000
dwFrameIntervalStep 1
  VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber1
  bAlternateSetting   1
  bNumEndpoints   1
  bInterfaceClass14 Video
  bInterfaceSubClass  2 Video Streaming
  bInterfaceProtocol  0 
  iInterface  0 
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83  EP 3 IN
bmAttributes5
  Transfer TypeIsochronous
  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] Slow frame rate windows/linux?

2010-09-07 Thread Andrew Leech
Hi everyone,

This may not be most appropriate place to ask, because the UVC device I'm
building (custom hardware) actually seems to be working pretty well under
linux, I'm getting a nice steady 25fps PAL picture. I just feel there's a
lot of expertise here that someone may be able to assist. 

The problem is my hardware under windows only gets ~10-12fps, and I need
cross platform compatibility. It doesn't report any dropped frames, and it
gets this speed no matter which renderer I use. 

I don't think the problem is the pc, as I've tried it on a couple of
different windows boxes and the working linux is in a vmware instance on the
same pc anyway.

 

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. 

 

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?

 

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.

 

Thanks,

Andrew

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