[Linux-uvc-devel] Always low fps

2010-09-12 Thread Igor Demyanov
Hello.
I have a built-in camera (64e: a219 Suyin Corp) in a laptop Acer
Aspire 5745G. Image fine, but in all modes low fps = 7.5. Can anybody
tell how to solve this problem?
Change various settings through v4l2ucp, changed the resolution, fps always 7.5
Ready to provide any data.

#v4l2ctrl -s
9963776: Brightness:0
9963777:   Contrast:32
9963778: Saturation:64
9963779:Hue:0
9963788:White Balance Temperature, Auto:1
9963792:  Gamma:100
9963800:   Power Line Frequency:1
9963803:  Sharpness:4
9963804: Backlight Compensation:1

-- 
Best regards,
Igor Demyanov
___
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel


Re: [Linux-uvc-devel] Quirk no_fid needed for IMC 13d3:5103

2010-09-12 Thread Laurent Pinchart
Hi Mark,

On Friday 03 September 2010 10:07:46 Mark Huijgen wrote:
  Hi all,
 
 The integrated webcam found in the Medion Akoya all-in-one touch screen PC
 needs a quirk set to get it to work properly. Without it mplayer reports
 lots of select timeouts and the image is just green.
 
 With quirk UVC_QUIRK_STREAM_NO_FID set the webcam works great.
 
 Attached the lsusb -vv output for the webcam and the patch I made to add
 the quirk, maybe this patch can be merged?

Thanks for the report and the patch. I've applied the patch and updated the 
supported devices list.

-- 
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] [UVC] [Linux-UVC] put_unaligned_le32

2010-09-12 Thread Laurent Pinchart
Hi,

On Monday 30 August 2010 19:53:13 Palmax Maverick wrote:
 Hello,
 
 I'm trying to understand uvc_set_video_ctrl (
 http://lxr.linux.no/linux+v2.6.35/drivers/media/video/uvc/uvc_video.c#L209
 ), that its a function for sending and receiving controls.
 
 I don't know why do you use put_unaligned_le32 for dwMaxVideoFrameSize
 and dwMaxPayloadTransferSize (these parameters are explained at the
 table 4-47 of UVC especification pdf).

Because the fields are not aligned to a 32-bit boundary in memory. Platforms 
that can't handle unaligned access (such as ARM) need the put_unaligned_le32 
macro.

-- 
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] 046d:08c2 Logitech Quickcam Orbit/Sphere MP Controls Incompatibility

2010-09-12 Thread Laurent Pinchart
Hi Logan,

On Wednesday 01 September 2010 16:48:20 Logan Stonebraker wrote:
 Greetings,
 
 I have been working with Paulo Assis on the quickcamteam forums.
 
 We have been trying to determine why a Logitech Orbit MP 046d:08c2 is not
 responding to Pan (relative) or Tilt (relative) controls.  Pan/Tilt reset
 and all other Logitech specific controls work splendidly despite this.
 
 The thread with the details is here:
 http://forums.quickcamteam.net/showthread.php?tid=685
 
 I noticed on the uvc driver home page http://www.ideasonboard.org/uvc that
 the 046d:08c2 is listed as being compatible with no mention of these
 controls being unusable (albeit potentially unreliable with the footnotes).
 
 We are unable to get past the camera reporting that it failed to query the
 control.
 
 Interestingly enough pan and tilt functions work fine on any supported
 Windows OS using available pan/tilt control software.  We are thinking that
 perhaps the reason for this is that the uvcvideo driver expects to query
 these controls prior to setting their values (and fails to read), as
 opposed to the working windows drivers which (perhaps aware of this
 firmware issue) do not query the controls, rather just attempt to set
 their values.

The uvcvideo driver indeed tries to query the controls first. The Windows 
driver, being Logitech-specific, might skip that step.

 dmesg uvcvideo trace=15 on module insertion
 
  -snip-
 
  [ 1449.492454] USB Video Class driver (v0.1.0)
  [ 1449.732361] uvcvideo: Control f70c9e90/2 is already defined.
  [ 1449.741717] uvcvideo: Added control f70c9d90/1 to device 2 entity 9
  [ 1449.752219] uvcvideo: Added control f70c9e50/2 to device 2 entity 9
  [ 1449.752259] uvcvideo: Adding mapping Pan (relative) to control
 f70c9d90/1.
  [ 1449.752278] uvcvideo: Adding mapping Tilt (relative) to control
 f70c9d90/1.
  [ 1449.752294] uvcvideo: Adding mapping Pan Reset to control f70c9e50/2.
  [ 1449.752309] uvcvideo: Adding mapping Tilt Reset to control f70c9e50/2.
  [ 1449.752324] uvcvideo: Adding mapping Pan/tilt Reset to control
 f70c9e50/2.
  [ 1449.752340] uvcvideo: Adding mapping Focus to control f70c9dd0/3.
  [ 1449.752355] uvcvideo: Adding mapping LED1 Mode to control f70c9d10/1.
  [ 1449.752371] uvcvideo: Adding mapping LED1 Frequency to control
 f70c9d10/1.
  [ 1449.752387] uvcvideo: Adding mapping Disable video processing to
 control f70c9e90/5.
  [ 1449.752402] uvcvideo: Adding mapping Raw bits per pixel to control
 f70c9fd0/8.
 
 -snip-
 
 sudo ./pan /dev/video0 128
  control(0x009a0904) failed to set (error -1)
 
 dmesg on attempting to set pan or tilt control (via either usb 1.1 or usb
 2.0)
  [3035.732371] uvcvideo: Failed to query (131) UVC control 1 (unit 9) : -32
 (exp. 4).

-32 is -EPIPE, which basically means that your camera failed to answer the 
GET_MAX (131) request on the pan/tilt control (control 1, unit 9). This is 
caused by a timing-related bug in the camera firmware described in footnote 1 
on the website. There's not much I can do about it. According to the messages 
you've posted on the forum, at least one of your test runs showed a different 
behaviour:

 [ 855.955995] uvcvideo: Control 0x009a0900 not found.
 [ 856.003477] uvcvideo: Failed to query (132) UVC control 1 (unit 9) : 1 
(exp. 4).
 [ 856.024605] uvcvideo: Failed to query (132) UVC control 1 (unit 9) : 1 
(exp. 4).
 [ 856.066239] uvcvideo: Control 0x009a0908 not found.

That's also what I get on my computer when I test the pan/tilt controls with 
the same camera. In this case the camera goes past the GET_MAX request, but 
answers the next GET_RES request with only 1 byte of data when the driver 
expect 4. I'll try to get information about that problem from Logitech.

[snip]

 Thank you in advance if you are able to assist in debugging this or at
 the very least making mention in a footnote that these specific pan and
 tilt controls could be totally unusable to warn potential 046d:08c2 Orbit
 owners about this issue.

-- 
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] Multiple Camera Resolution

2010-09-12 Thread Laurent Pinchart
Hi Chris,

On Thursday 02 September 2010 04:32:11 Chris wrote:
 Hi,
 
 I am using an embedded device and wish to get at least 2 USB webcams
 working at one time.
 I have been playing with the:
 bandwidth = stream-ctrl.dwMaxPayloadTransferSize;
 
 And changed it to a variety of numbers finding that setting it to 768
 works: bandwidth = 768;
 
 With the above setting I can get 4 webcams working at 320x240 at 1 fps.
 
 I have tried: 768, 1024, 1536, 1792, 2048 (can run one cam at 640x480 only),
 3072
 The only way I can get multiple cams at any resolution is at 768 and only
 320x240.
 Ideally we want to be able to run up to 4 cams at 640x480.
 
 I was wondering if there are any other ways to achieve this?
 I see there are a few posts this year around this topic by Laurent.

The camera reports the bandwidth requirements and the driver tries to fulfill 
them. You haven't reported the camera model and the frame formats, so I can 
only assume that your camera outputs uncompressed YUV images.

2 cameras streaming uncompressed video at 640x480 will exceed the maximum USB 
bandwidth. You have several options to achieve 4 simultaneous VGA streams:

- switch to MJPEG if your cameras supports hardware compression
- use multiple USB host controllers (on add-on PCI boards for instance)
- use cameras that can buffer whole images and use a lower frame rate (this is 
theoretical only, I don't know of any such camera in the mainstream market).

-- 
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] 064e:a219 Suyin Corp. 1.3M WebCam (Acer Aspire 5745G)

2010-09-12 Thread Laurent Pinchart
Hi Igor,

On Thursday 02 September 2010 01:49:03 Igor Demyanov wrote:
 Work normal, low fps(7.5)
 v4l2ctrl -s
 9963776: Brightness:0
 9963777:   Contrast:32
 9963778: Saturation:64
 9963779:Hue:0
 9963788:White Balance Temperature, Auto:1
 9963792:  Gamma:100
 9963800:   Power Line Frequency:1
 9963803:  Sharpness:4
 9963804: Backlight Compensation:1
 
 lsusb
 Bus 001 Device 003: ID 064e:a219 Suyin Corp.
 Device Descriptor:

[snip]

  // Cutting

Please send me the full descriptors.

-- 
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] [Linux-UVC] [UVC] Probe at uvc_set_video_ctrl. bFormatIndex, dwMaxVideoFrameSize and dwMaxPayloadTransferSize

2010-09-12 Thread Laurent Pinchart
Hi,

On Thursday 02 September 2010 22:57:27 Palmax Maverick wrote:
 Dear Laurent and others linux-UVC developers,
 
 I'm writting the messages of ctrl that will be based on yours. I'm
 trying to understand the meaning of the probe parameter of
 uvc_vide.c::uvc_get_video_ctrl
 
 Could you tell me it please?

See section 4.3.1.1 in the UVC 1.1 specification.

 In addition, I want to know what is the value of bFormatIndex that It's the
 last selected. Have I to query it?

The current bFormatIndex value can be retrieved with a GET_CUR request on the 
video commit control.

 What is the meaning of dwMaxVideoFrameSize?

For frame-based formats (stream-based formats are not supported by the 
uvcvideo driver yet) the field stores the maximum size of a video frame.

 and dwMaxPayloadTransferSize at still image controls point of view?

It has the same meaning as for the video controls.

-- 
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] Unlisted UVC Camera

2010-09-12 Thread Laurent Pinchart
Hi,

On Saturday 04 September 2010 19:40:30 Civil wrote:
 Device id: 04f2:b1be (Chicony Electronics Co., Ltd). Found on ASUS UL30Jt
 Laptop. Works well, but seems to be mounter upside-down.

Please send me the output of

lsusb -v -d 04f2:b1be

and (as root)

dmidecode

-- 
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] Another Confirmed Model

2010-09-12 Thread Laurent Pinchart
Hi Chris,

On Thursday 09 September 2010 08:01:47 Chris Largret wrote:
 I purchased a used netbook with a Chicony webcam in it. Since there is
 a list of supported devices at http://www.ideasonboard.org/uvc/, I
 wanted to sound off.
 
 As of the 2.6.33.4 kernel (slightly old now), UVC works with
 Chicony Electronics device ID 04f2:b084.

Thanks for the report. Could you please send me the output of

lsusb -v -d 04f2:b084

-- 
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] Logitech C910, long exposures?

2010-09-12 Thread Laurent Pinchart
Hi,

On Wednesday 08 September 2010 16:14:32 Moritz Barsnick wrote:
 On Wed, Sep 08, 2010 at 15:36:58 +0200, Florian Echtler wrote:
  If still image support (for still image method 2) were to be added,
  would that bring exposure control with it? (probably not?)
 
 Good question. I have no understanding of the UVC standard, I only know
 the still image buzzword from many threads here. :)
 In Message-Id: 200804162242.45541.laurent.pinch...@skynet.be, Laurent
 wrote:
  It all depends on the hardware. The UVC spec defines several method
  to capture still images. The most common one, implemented by all the
  webcams I've tested so far, is to take the next image from the video
  stream. This won't help improving image quality.
 
 So you're probably out of luck.

Still image capture won't bring exposure control.

  Hm, but resolutions from full HD and up in YUYV show 1/2 fps? (Don't know
  if this is actually equal to exposure time or just due to the
  bandwidth..)
 
 You're right, I missed that. It does say 1/2 (that's SPF, not FPS, by
 the way).
 
 My experience - without having done _anything_ with re-adjusting
 autoexposure or the likes - is that the camera will expose as much of
 that interval if it needs to. But since it doesn't have an aperture, it
 reduces exposure time in better lighting. One of my personal webcam
 (non-UVC) installations is at constant 5 FPS, but only in the evening
 does movement appear blurry in the stream.

In theory, auto-exposure will modify the frame rate according to the light 
conditions and can lower the frame rate. It should never push the frame rate 
higher than the selected value.

 I do _not_ know whether a constant FPS and disabled autoexposure would
 lead to under-/overexposure but defined exposure time.

The UVC specification isn't very clear on the subject. It states that [...] 
the manual exposure control is further limited by the frame interval, which 
always has higher precedence.

My understanding is that disabling auto-exposure and setting the exposure time 
manually should work when the requested exposure time is lower than the frame 
interval. The specificat

In practice I expect most webcams not to bother about this and honor the 
requested exposure time. I've just tested an old Logitech camera and it seems 
to work that way (although the exposure time values seem broken, a lower value 
corresponds to a higher exposure time).

  Well, this is exactly the solution I am using right now :-)
 
 Ha! :-) But you have valid points there. No mechanical wear in the web
 cam. (But my web cam's sensor seems to have deteriorated over the
 years.)

-- 
Regards,

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


[Linux-uvc-devel] 064e:a219 Suyin Corp. 1.3M WebCam (Acer Aspire 5745G)

2010-09-12 Thread Igor Demyanov
Hi Laurent,
lsusb -v attached.

I'm sorry if repeat. My first time using mailing list.
Please add the camera(064e:a219 Suyin Corp.) to supported
deviceshttp://www.ideasonboard.org/uvc/
.

2010/9/12 Laurent Pinchart laurent.pinch...@ideasonboard.com:
 Hi Igor,

 On Thursday 02 September 2010 01:49:03 Igor Demyanov wrote:
 Work normal, low fps(7.5)
 v4l2ctrl -s
 9963776: Brightness:0
 9963777:   Contrast:32
 9963778: Saturation:64
 9963779:Hue:0
 9963788:White Balance Temperature, Auto:1
 9963792:  Gamma:100
 9963800:   Power Line Frequency:1
 9963803:  Sharpness:4
 9963804: Backlight Compensation:1

 lsusb
 Bus 001 Device 003: ID 064e:a219 Suyin Corp.
 Device Descriptor:

 [snip]

  // Cutting

 Please send me the full descriptors.

-- 
Best regards,
Igor Demyanov
Bus 001 Device 003: ID 064e:a219 Suyin Corp. 
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass  239 Miscellaneous Device
  bDeviceSubClass 2 ?
  bDeviceProtocol 1 Interface Association
  bMaxPacketSize064
  idVendor   0x064e Suyin Corp.
  idProduct  0xa219 
  bcdDevice2.15
  iManufacturer   2 Suyin
  iProduct1 1.3M WebCam
  iSerial 3 HF1315-S32B-OV01-VA-R02.01.05
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength  527
bNumInterfaces  2
bConfigurationValue 1
iConfiguration  0 
bmAttributes 0x80
  (Bus Powered)
MaxPower  500mA
Interface Association:
  bLength 8
  bDescriptorType11
  bFirstInterface 0
  bInterfaceCount 2
  bFunctionClass 14 Video
  bFunctionSubClass   3 Video Interface Collection
  bFunctionProtocol   0 
  iFunction   5 1.3M WebCam
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass14 Video
  bInterfaceSubClass  1 Video Control
  bInterfaceProtocol  0 
  iInterface  5 1.3M WebCam
  VideoControl Interface Descriptor:
bLength13
bDescriptorType36
bDescriptorSubtype  1 (HEADER)
bcdUVC   1.00
wTotalLength   77
dwClockFrequency   15.00MHz
bInCollection   1
baInterfaceNr( 0)   1
  VideoControl Interface Descriptor:
bLength 9
bDescriptorType36
bDescriptorSubtype  3 (OUTPUT_TERMINAL)
bTerminalID 2
wTerminalType  0x0101 USB Streaming
bAssocTerminal  0
bSourceID   4
iTerminal   0 
  VideoControl Interface Descriptor:
bLength26
bDescriptorType36
bDescriptorSubtype  6 (EXTENSION_UNIT)
bUnitID 4
guidExtensionCode {7033f028-1163-2e4a-ba2c-6890eb334016}
bNumControl 8
bNrPins 1
baSourceID( 0)  3
bControlSize1
bmControls( 0)   0x0f
iExtension  0 
  VideoControl Interface Descriptor:
bLength18
bDescriptorType36
bDescriptorSubtype  2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType  0x0201 Camera Sensor
bAssocTerminal  0
iTerminal   0 
wObjectiveFocalLengthMin  0
wObjectiveFocalLengthMax  0
wOcularFocalLength0
bControlSize  3
bmControls   0x
  VideoControl Interface Descriptor:
bLength11
bDescriptorType36
bDescriptorSubtype  5 (PROCESSING_UNIT)
  Warning: Descriptor too short
bUnitID 3
bSourceID   1
wMaxMultiplier  0
bControlSize2
bmControls 0x153f
  Brightness
  Contrast
  Hue
  Saturation
  Sharpness
  Gamma
  Backlight Compensation
  Power Line Frequency
  White Balance Temperature, Auto
iProcessing 0 
bmVideoStandards 0x 0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83  EP 3 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch 

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] Always low fps

2010-09-12 Thread Laurent Pinchart
Hi Igor,

On Sunday 12 September 2010 13:28:44 Igor Demyanov wrote:
 Hello.
 I have a built-in camera (64e: a219 Suyin Corp) in a laptop Acer
 Aspire 5745G.

Please send me the output of

lsusb -v -d 064e:a219

 Image fine, but in all modes low fps = 7.5. Can anybody tell how to solve
 this problem?
 Change various settings through v4l2ucp, changed the resolution, fps always
 7.5 Ready to provide any data.
 
 #v4l2ctrl -s
 9963776: Brightness:0
 9963777:   Contrast:32
 9963778: Saturation:64
 9963779:Hue:0
 9963788:White Balance Temperature, Auto:1
 9963792:  Gamma:100
 9963800:   Power Line Frequency:1
 9963803:  Sharpness:4
 9963804: Backlight Compensation:1

-- 
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] Maximising iram throughput?

2010-09-12 Thread Laurent Pinchart
Hi Andrew,

On Friday 10 September 2010 08:14:30 Andrew Leech wrote:
 Hi all,
 
 Just wondering if anyone's found some tricks to speed up iram data
 throughput, specifically with dma transfers.

Are you sure you've sent this mail to the right mailing list ?

 My application is basically sending data (real time video) from the
 external static ram interface over USB. The catch is the data buffer sizes
 of the external data and the usb data need to be quite different so I've
 had to set up a double buffering arrangement, where I'm using the DMA to
 copy from external port to a large rolling buffer space in iram, and then
 on a separate dma channel copying the (smaller) chunks of data from the
 large buffer to my usb buffer/structs. The usb packets needs a header on
 each one, so I can't just give the usb a pointer to a location in the main
 buffer because it obviously won't have the header.
 
 The system is technically working, but I'm running very low on memory bus
 bandwidth. The main issue is coming from latency in the external interface,
 I currently have it running with a MPMCStaticWaitRd0 of 1 and have a couple
 of errors in transmission. The errors are completely gone if I up the
 WaitRd to 2 but then the dma from buffer to usb is not keeping up.
 
 The external ram interface is in 16 bit mode, and the write buffers (in
 MPMCStaticConfig) are disabled, I'm using interface strictly read only and
 enabling them slowed it down more.
 
 Both dma channels are running in burst mode (16 byte chunks).
 
 Clocks are all at csp default settings again, so mpmc, dma, ebi all at
 90Mhz, core at 180Mhz.
 
 I've tried SYS_REGS-eshctrl_sup4 = 0; to enable high speed performance
 mode on EBI, but that doesn't really seem to help much, not that I
 expected it to really.
 
 I've also tried enabling instruction and data caches at start of main:
 
 // Set virtual address of MMU table
 cp15_set_vmmu_addr((void *) ISROM_MMU_TTB_BASE);
 cp15_set_mmu(1);
 cp15_set_icache(1);
 cp15_set_dcache(1);
 
 But I didn't notice any difference in application speed, can anyone confirm
 whether this is the correct way to enable the buffers? Although I guess
 these are buffers for the cpu, so wouldn't affect the dma anyway.
 
 Basically I'd really like to speed up the iram - iram dma transfer to allow
 more bus bandwidth / time to devote to external ram - iram dma channel so I
 can slow the mpmc WaitRd down a touch and still kepp up with the video
 stream.

-- 
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] Always low fps

2010-09-12 Thread Igor Demyanov
lsusb -v -d 064e:a219 attached

2010/9/13 Laurent Pinchart laurent.pinch...@ideasonboard.com

 Hi Igor,

 On Sunday 12 September 2010 13:28:44 Igor Demyanov wrote:
  Hello.
  I have a built-in camera (64e: a219 Suyin Corp) in a laptop Acer
  Aspire 5745G.

 Please send me the output of

 lsusb -v -d 064e:a219

  Image fine, but in all modes low fps = 7.5. Can anybody tell how to solve
  this problem?
  Change various settings through v4l2ucp, changed the resolution, fps
 always
  7.5 Ready to provide any data.
 
  #v4l2ctrl -s
  9963776: Brightness:0
  9963777:   Contrast:32
  9963778: Saturation:64
  9963779:Hue:0
  9963788:White Balance Temperature, Auto:1
  9963792:  Gamma:100
  9963800:   Power Line Frequency:1
  9963803:  Sharpness:4
  9963804: Backlight Compensation:1

 --
 Regards,

 Laurent Pinchart




-- 
Best regards,
Igor Demyanov

Bus 001 Device 003: ID 064e:a219 Suyin Corp. 
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass  239 Miscellaneous Device
  bDeviceSubClass 2 ?
  bDeviceProtocol 1 Interface Association
  bMaxPacketSize064
  idVendor   0x064e Suyin Corp.
  idProduct  0xa219 
  bcdDevice2.15
  iManufacturer   2 Suyin
  iProduct1 1.3M WebCam
  iSerial 3 HF1315-S32B-OV01-VA-R02.01.05
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength  527
bNumInterfaces  2
bConfigurationValue 1
iConfiguration  0 
bmAttributes 0x80
  (Bus Powered)
MaxPower  500mA
Interface Association:
  bLength 8
  bDescriptorType11
  bFirstInterface 0
  bInterfaceCount 2
  bFunctionClass 14 Video
  bFunctionSubClass   3 Video Interface Collection
  bFunctionProtocol   0 
  iFunction   5 1.3M WebCam
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass14 Video
  bInterfaceSubClass  1 Video Control
  bInterfaceProtocol  0 
  iInterface  5 1.3M WebCam
  VideoControl Interface Descriptor:
bLength13
bDescriptorType36
bDescriptorSubtype  1 (HEADER)
bcdUVC   1.00
wTotalLength   77
dwClockFrequency   15.00MHz
bInCollection   1
baInterfaceNr( 0)   1
  VideoControl Interface Descriptor:
bLength 9
bDescriptorType36
bDescriptorSubtype  3 (OUTPUT_TERMINAL)
bTerminalID 2
wTerminalType  0x0101 USB Streaming
bAssocTerminal  0
bSourceID   4
iTerminal   0 
  VideoControl Interface Descriptor:
bLength26
bDescriptorType36
bDescriptorSubtype  6 (EXTENSION_UNIT)
bUnitID 4
guidExtensionCode {7033f028-1163-2e4a-ba2c-6890eb334016}
bNumControl 8
bNrPins 1
baSourceID( 0)  3
bControlSize1
bmControls( 0)   0x0f
iExtension  0 
  VideoControl Interface Descriptor:
bLength18
bDescriptorType36
bDescriptorSubtype  2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType  0x0201 Camera Sensor
bAssocTerminal  0
iTerminal   0 
wObjectiveFocalLengthMin  0
wObjectiveFocalLengthMax  0
wOcularFocalLength0
bControlSize  3
bmControls   0x
  VideoControl Interface Descriptor:
bLength11
bDescriptorType36
bDescriptorSubtype  5 (PROCESSING_UNIT)
  Warning: Descriptor too short
bUnitID 3
bSourceID   1
wMaxMultiplier  0
bControlSize2
bmControls 0x153f
  Brightness
  Contrast
  Hue
  Saturation
  Sharpness
  Gamma
  Backlight Compensation
  Power Line Frequency
  White Balance Temperature, Auto
iProcessing 0 
bmVideoStandards 0x 0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83  EP 3 IN

Re: [Linux-uvc-devel] resetting resolution causes crash/failure

2010-09-12 Thread Laurent Pinchart
Hi Travis,

On Friday 03 September 2010 23:58:45 travis+ml-uvc-...@subspacefield.org 
wrote:
 Hey all,
 
 I'm using uvc/v4l2 and running into a weird problem.
 
 Under VMWare Fusion, if I reset resolution twice, it hangs the VM.
 
 Attached camera is a USB camera attached to host.
 
 On a native machine, it merely causes the camera to return a blank
 screen.
 
 Before getting into details, I wanted to see if anyone had a hunch as
 to why this might be.
 
 Also, on my Ubuntu 9.04 box, I'm seeing lots of stuff in dmesg
 about uvcvideo: unknown event type x, where x varies, but 121
 is a popular value.  I assume that can be ignored and merely
 suggests the s/w is out of date.

What camera are you using ?

-- 
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] Maximising iram throughput?

2010-09-12 Thread Andrew Leech
Ah whoops, yep I really though I picked a different email to reply to
thanks for the heads up, I can ask the right lot now!

Andrew

-Original Message-
From: Laurent Pinchart [mailto:laurent.pinch...@ideasonboard.com] 
Sent: Monday, 13 September 2010 8:52 AM
To: linux-uvc-devel@lists.berlios.de
Cc: Andrew Leech
Subject: Re: [Linux-uvc-devel] Maximising iram throughput?

Hi Andrew,

On Friday 10 September 2010 08:14:30 Andrew Leech wrote:
 Hi all,
 
 Just wondering if anyone's found some tricks to speed up iram data 
 throughput, specifically with dma transfers.

Are you sure you've sent this mail to the right mailing list ?

 My application is basically sending data (real time video) from the 
 external static ram interface over USB. The catch is the data buffer 
 sizes of the external data and the usb data need to be quite different 
 so I've had to set up a double buffering arrangement, where I'm using 
 the DMA to copy from external port to a large rolling buffer space in 
 iram, and then on a separate dma channel copying the (smaller) chunks 
 of data from the large buffer to my usb buffer/structs. The usb 
 packets needs a header on each one, so I can't just give the usb a 
 pointer to a location in the main buffer because it obviously won't have
the header.
 
 The system is technically working, but I'm running very low on memory 
 bus bandwidth. The main issue is coming from latency in the external 
 interface, I currently have it running with a MPMCStaticWaitRd0 of 1 
 and have a couple of errors in transmission. The errors are completely 
 gone if I up the WaitRd to 2 but then the dma from buffer to usb is not
keeping up.
 
 The external ram interface is in 16 bit mode, and the write buffers 
 (in
 MPMCStaticConfig) are disabled, I'm using interface strictly read only 
 and enabling them slowed it down more.
 
 Both dma channels are running in burst mode (16 byte chunks).
 
 Clocks are all at csp default settings again, so mpmc, dma, ebi all at 
 90Mhz, core at 180Mhz.
 
 I've tried SYS_REGS-eshctrl_sup4 = 0; to enable high speed 
 performance mode on EBI, but that doesn't really seem to help much, 
 not that I expected it to really.
 
 I've also tried enabling instruction and data caches at start of main:
 
 // Set virtual address of MMU table
 cp15_set_vmmu_addr((void *) ISROM_MMU_TTB_BASE);
 cp15_set_mmu(1);
 cp15_set_icache(1);
 cp15_set_dcache(1);
 
 But I didn't notice any difference in application speed, can anyone 
 confirm whether this is the correct way to enable the buffers? 
 Although I guess these are buffers for the cpu, so wouldn't affect the dma
anyway.
 
 Basically I'd really like to speed up the iram - iram dma transfer to 
 allow more bus bandwidth / time to devote to external ram - iram dma 
 channel so I can slow the mpmc WaitRd down a touch and still kepp up 
 with the video stream.

--
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] Running multiple webcams on the same hub

2010-09-12 Thread Laurent Pinchart
Hi Martin,

On Friday 27 August 2010 16:14:52 Martin wrote:
 The problem:
 
 From reading around this list and elsewhere, it appears that you simply
 cannot run more than one webcam video stream per USB root hub.

 When enabled for video streaming, the webcam reserves the full
 isochronous bandwidth needed to stream data at the selected resolution
 and framerate, regardless of whether your application acquires the full
 framerate or just samples at one frame per second.

That's not correct. The webcam reports its bandwidth requirements, and the 
driver allocates bandwidth accordingly. Some cameras are buggy and report high 
bandwidth requirements when they could use lower bandwidths.

 Hence, trying to set a low framerate in your user application has no effect
 to reduce the bandwidth from the webcam.

That's correct, because most webcams can't buffer a whole frame of video data 
and send it slowly over USB (embedded RAM is expensive). Even at lower frame 
rates, webcams might thus need high bandwidth for a short time. As USB 
bandwidth reservation takes the peak bandwidth into account, bandwidth will be 
wasted.

 The webcam is still streaming at the maximum framerate regardless.
 
 I'm guessing that the video stream is being 'pushed' out by the webcam
 firmware and so the UVC driver must take all that it is given...

The webcam sends a frame at high speed and then waits a (relatively) long time 
before sending the next frame.

 *A possible solution* ?
 
 Instead, could the UVC driver 'simulate' a reduced framerate by instead
 using the STILL_IMAGE_FRAME mode of the webcam and grab for itself a
 set number of images per second? Or even only when polled by a read from
 the user application?

Still image capture isn't supported yet. The reason is that most webcams just 
ask the driver to take the next picture in the video stream to emulate still 
image capture. Very few cameras support out-of-band still image capture, and I 
don't own any that support that.

As most cameras just ask the driver to capture the next frame in an active 
video stream this won't solve your problem anyway.

 On *nix, everything is a file... Could the uvc driver accept reading
 of /dev/videoX by the command cp so that still image data is copied,
 formatted for a jpg or png?

It would need to process the image (compress it to JPG or PNG), and that's not 
the job of a kernel driver, so no.

 Could the quirks setting be abused to set the image grab rate? Or some
 other neater method?
 
 Further details:
 
 I'm trying to use two webcams simultaneously:
 
   iManufacturer   1 Sweex
   iProduct2 WC060 Series HD Webcam

Please post the whole USB descriptors (lsusb -v)

 On separate hubs, they work fine. On the same hub, the second one to
 start shows the error:
 
 Error starting stream VIDIOC_STREAMON: No space left on device.
 
 I've only got the one root hub on the system I want to use for the two
 webcams!
 
 Their descriptors show:
 
 bFrameIntervalType  2
 dwFrameInterval( 0)   200
 dwFrameInterval( 1)   400
 
 
 Can I tweak the UVC driver to preferentially choose the slower frame
 rate available?

You can select a frame rate explictly with VIDIOC_S_PARM.

 Aside: The MJPG format doesn't seem to work, nor are any compression
 settings visible...

Maybe your webcam doesn't support MJPG.

 Given a few hints or a patch, I can hack the kernel module to test :-)
 
 This is running on Gentoo, kernel 2.6.34 using the in-kernel uvc module.
 
 Any comment/ideas welcomed.

If you don't need to capture frames simultaneously, you can just start the 
video stream, capture a frame, stop the video stream, and repeat the sequence 
on the second webcam.

If you need higher frame rates, search the mailing list archives for 
discussions about bandwidth (dwMaxPayloadTransferSize is a keyword). You can 
also have a look at the Multiple camera framerate. mail thread started by  
Dennis Muhlestein.

-- 
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
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:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass  239 Miscellaneous Device
  bDeviceSubClass 2 ?
  bDeviceProtocol 1 Interface Association
  bMaxPacketSize064
  idVendor   0x 
  idProduct  0x8000 
  bcdDevice1.00
  iManufacturer   1 
  iProduct2 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
  bDescriptorType11
  bFirstInterface 0
  bInterfaceCount 2
  bFunctionClass 14 Video
  bFunctionSubClass   3 Video Interface Collection
  bFunctionProtocol   0 
  iFunction   2 xxx
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass14 Video
  bInterfaceSubClass  1 Video Control
  bInterfaceProtocol  0 
  iInterface  2 xxx
  VideoControl Interface Descriptor:
bLength13
bDescriptorType36
bDescriptorSubtype  1 (HEADER)
bcdUVC   1.00
wTotalLength   50
dwClockFrequency6.00MHz
bInCollection   1
baInterfaceNr( 0)   1
  VideoControl Interface Descriptor:
bLength17
bDescriptorType36
bDescriptorSubtype  2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType  0x0201 Camera Sensor
bAssocTerminal  0
iTerminal   0 
wObjectiveFocalLengthMin  0
wObjectiveFocalLengthMax  0
wOcularFocalLength0
bControlSize  2
bmControls   0x
  VideoControl Interface Descriptor:
bLength 9
bDescriptorType36
bDescriptorSubtype  3 (OUTPUT_TERMINAL)
bTerminalID 3
wTerminalType  0x0101 USB Streaming
bAssocTerminal  0
bSourceID   5
iTerminal   0 
  VideoControl Interface Descriptor:
bLength11
bDescriptorType36
bDescriptorSubtype  5 (PROCESSING_UNIT)
  Warning: Descriptor too short
bUnitID 5
bSourceID   1
wMaxMultiplier  0
bControlSize2
bmControls 0x001f
  Brightness
  Contrast
  Hue
  Saturation
  Sharpness
iProcessing 0 
bmVideoStandards 0x 0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 

Re: [Linux-uvc-devel] Maximising iram throughput?

2010-09-12 Thread Sebastian



On 09/13/2010 12:06 AM, Andrew Leech wrote:

Ah whoops, yep I really though I picked a different email to reply to
thanks for the heads up, I can ask the right lot now!

Andrew

-Original Message-
From: Laurent Pinchart [mailto:laurent.pinch...@ideasonboard.com]
Sent: Monday, 13 September 2010 8:52 AM
To: linux-uvc-devel@lists.berlios.de
Cc: Andrew Leech
Subject: Re: [Linux-uvc-devel] Maximising iram throughput?

Hi Andrew,

On Friday 10 September 2010 08:14:30 Andrew Leech wrote:

Hi all,

Just wondering if anyone's found some tricks to speed up iram data
throughput, specifically with dma transfers.


Are you sure you've sent this mail to the right mailing list ?


Thanks Laurent. I was lost there for a moment. I was scratching my head 
thinking I was even further behind technology then I thought I was :-)


Sebastian




My application is basically sending data (real time video) from the
external static ram interface over USB. The catch is the data buffer
sizes of the external data and the usb data need to be quite different
so I've had to set up a double buffering arrangement, where I'm using
the DMA to copy from external port to a large rolling buffer space in
iram, and then on a separate dma channel copying the (smaller) chunks
of data from the large buffer to my usb buffer/structs. The usb
packets needs a header on each one, so I can't just give the usb a
pointer to a location in the main buffer because it obviously won't have

the header.


The system is technically working, but I'm running very low on memory
bus bandwidth. The main issue is coming from latency in the external
interface, I currently have it running with a MPMCStaticWaitRd0 of 1
and have a couple of errors in transmission. The errors are completely
gone if I up the WaitRd to 2 but then the dma from buffer to usb is not

keeping up.


The external ram interface is in 16 bit mode, and the write buffers
(in
MPMCStaticConfig) are disabled, I'm using interface strictly read only
and enabling them slowed it down more.

Both dma channels are running in burst mode (16 byte chunks).

Clocks are all at csp default settings again, so mpmc, dma, ebi all at
90Mhz, core at 180Mhz.

I've tried SYS_REGS-eshctrl_sup4 = 0; to enable high speed
performance mode on EBI, but that doesn't really seem to help much,
not that I expected it to really.

I've also tried enabling instruction and data caches at start of main:

 // Set virtual address of MMU table
 cp15_set_vmmu_addr((void *) ISROM_MMU_TTB_BASE);
 cp15_set_mmu(1);
 cp15_set_icache(1);
 cp15_set_dcache(1);

But I didn't notice any difference in application speed, can anyone
confirm whether this is the correct way to enable the buffers?
Although I guess these are buffers for the cpu, so wouldn't affect the dma

anyway.


Basically I'd really like to speed up the iram - iram dma transfer to
allow more bus bandwidth / time to devote to external ram - iram dma
channel so I can slow the mpmc WaitRd down a touch and still kepp up
with the video stream.


--
Regards,

Laurent Pinchart

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


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