Re: [Linux-uvc-devel] Automatic Gain Control

2007-02-02 Thread Michel Xhaard
Le Vendredi 2 Février 2007 02:24, Martin Rubli a écrit :
 Hi Michel,

 On Thu, 11 Jan 2007 00:07:46 -0800, Michel Xhaard [EMAIL PROTECTED] wrote:
  The zero step size for the absolute exposure time is obviously wrong. I
  don't currently have my USB analyzer to check what's going on there.

 I found the problem in the driver. 
Cool, thanks :)
 There is a bug in the uvc_get_le_value 
 function, which leads to wrong values when reading 32-bit wide controls. I
 have a patch and I'll submit it to Laurent. The control now looks as
 follows:

Exposure (Absolute)
  ID  : 17,
  Type: Dword,
  Flags   : { CAN_READ, CAN_WRITE, IS_CUSTOM },
  Values  : [ 1 .. 1, step size: 1 ],
  Default : 166

  Also, I get errors when I try to read these controls. This seems to be
  why the
  controls don't work in luvcview.

 Another bug in the control definition in the UVC driver. Certain controls
 were accidentally marked as write-only, which explains the error. It's
 part of the patch that I mentioned, it should be fixed soon in the
 repository.

  Yes luvcview used the step value.

 We'll post a message to the list as soon as the patch is committed. It
 would be great if you could retest it ...
No problem

 Cheers,
 Martin
 ___
 Linux-uvc-devel mailing list
 Linux-uvc-devel@lists.berlios.de
 https://lists.berlios.de/mailman/listinfo/linux-uvc-devel
Cheers
-- 
Michel Xhaard
http://mxhaard.free.fr
___
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel


Re: [Linux-uvc-devel] Automatic Gain Control

2007-02-01 Thread Martin Rubli
Hi Michel,

On Thu, 11 Jan 2007 00:07:46 -0800, Michel Xhaard [EMAIL PROTECTED] wrote:

 The zero step size for the absolute exposure time is obviously wrong. I
 don't currently have my USB analyzer to check what's going on there.

I found the problem in the driver. There is a bug in the uvc_get_le_value  
function, which leads to wrong values when reading 32-bit wide controls. I  
have a patch and I'll submit it to Laurent. The control now looks as  
follows:

   Exposure (Absolute)
 ID  : 17,
 Type: Dword,
 Flags   : { CAN_READ, CAN_WRITE, IS_CUSTOM },
 Values  : [ 1 .. 1, step size: 1 ],
 Default : 166

 Also, I get errors when I try to read these controls. This seems to be  
 why the
 controls don't work in luvcview.

Another bug in the control definition in the UVC driver. Certain controls  
were accidentally marked as write-only, which explains the error. It's  
part of the patch that I mentioned, it should be fixed soon in the  
repository.

 Yes luvcview used the step value.

We'll post a message to the list as soon as the patch is committed. It  
would be great if you could retest it ...

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


Re: [Linux-uvc-devel] Automatic Gain Control

2007-01-10 Thread Michel Xhaard
Le Mercredi 10 Janvier 2007 03:33, Martin Rubli a écrit :
Martin,
 Michel,

 On Mon, 08 Jan 2007 12:30:05 -0800, Michel Xhaard [EMAIL PROTECTED] wrote:
  I just upload a new revision of luvcview with pan/tilt fix, a lot of
  improvements.

 Cool! :-)

  Seem strange that we cannot change the exposure in manuel
  mode ?

 There should be a control to set the absolute exposure time ...

  Is there a way to set/reset the autowhite balance too ? a lot of
  robotic project need these features

 ... and one for white balance temperature. I'll double check tomorrow on
 my Linux machine but those are standard UVC controls that our cameras
 support.
I have try to used it (look at the last luvcview release) but that did not 
work on my orbit. luvcview use the same code for all control, each control 
can be up or down from the v4l2 step parameter luvcview test if we are 
between min and max and then apply the needed change. For some strange reason 
exposure and white balance always return a value outside the range ? maybe i 
am wrong here, but i don't see the reason :( Help are welcome !!

 Cheers,
 Martin
 ___
 Linux-uvc-devel mailing list
 Linux-uvc-devel@lists.berlios.de
 https://lists.berlios.de/mailman/listinfo/linux-uvc-devel
Cheers,
-- 
Michel Xhaard
http://mxhaard.free.fr
___
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel


Re: [Linux-uvc-devel] Automatic Gain Control

2007-01-10 Thread Gene Imes
Michel Xhaard wrote:
 Le Mardi 9 Janvier 2007 14:43, Gene Imes a écrit :
 I just upload a new revision of luvcview with pan/tilt fix, a lot of
 improvements. Seem strange that we cannot change the exposure in manuel
 mode ? Is there a way to set/reset the autowhite balance too ? a lot of
 robotic project need these features
 Cheers
 Michel, If I click the 'Take a Picture!' button or the 'AVI Start/Stop'
 buttons nothing seems to happen. Is there a trick to it? If so what?

 Or perhaps luvcview is writing to some directory I can not find.


 Thanks,
 Maybe because Picture and Avi only works with the MJPEG palette. Did you need 
 Picture and AVI for all palettes ?
 regards


I do not have a clue about MJPEG palette. I have to start luvcview like 
this for it to work.

luvcview -f yuv -s 640x480

would that have any effect?

By the way I am using a Bodelin ProScopeHR, which a cool hand held video 
micorscope.

Thanks,

-- 
Gene Imes = ozob.net
___
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel


Re: [Linux-uvc-devel] Automatic Gain Control

2007-01-09 Thread Jose Luis Landabaso

In case it helps, the errors come from mainloop_v4l2 opencv's function:


  1160 static void mainloop_v4l2(CvCaptureCAM_V4L* capture)
  1161 {
  1162   unsigned int count;
  1163
  1164 count = 1;
  1165
  1166 while (count--  0) {
  1167 for (;;) {
  1168 fd_set fds;
  1169 struct timeval tv;
  1170 int r;
  1171
  1172 FD_ZERO (fds);
  1173 FD_SET (capture-deviceHandle, fds);
  1174
  1175 /* Timeout. */
  1176 tv.tv_sec = 2;
  1177 tv.tv_usec = 0;
  1178
  1179 r = select (capture-deviceHandle+1, fds,
NULL, NULL, tv);
  1180
  1181 if (-1 == r) {
  1182 if (EINTR == errno)
  1183 continue;
  1184
  1185 errno_exit (select);
  1186 }
  1187
  1188 if (0 == r) {
  1189 fprintf (stderr, select
timeout\n);
  1190 //exit (EXIT_FAILURE);
  1191 }
  1192
  1193   if (read_frame_v4l2 (capture))
  1194 break;
  1195
  1196   /* EAGAIN - continue select loop. */
  1197 }
  1198 }
  1199 }

On 1/9/07, Jose Luis Landabaso [EMAIL PROTECTED] wrote:


Laurent, Martin, others,

I have arrived to a point in which I'm very confused.
I have learnt that you can only turn off the color processing when the
camera is not capturing.
So, I stop the capture program, and then run bayer.
If I disable color processing I cannot run my capture program again
since.  I always get:

select timeout
VIDIOC_DQBUF error 11, Resource temporarily unavailable

When I turn again the video processing on then the program works fine
again.

Any ideas?


On 1/8/07, Laurent Pinchart [EMAIL PROTECTED] wrote:

 Hi Jose,

  Hi Martin Rubli and others!
 
  First, let me thank you for the work done so far in the driver!

 As the project leader, let me thank you :-)

  The thing is that I am trying to disable the camera auto gain.
  I have read some previous threads that treated this same topic, but
 haven't
  succeeded so far. I applied the patch that Martin Rubli made
 available. I
  then compliled and installed. Later, I compiled the  bayer.c file.
 
  I am using a Logitech Ultra Vision camera and opencv and works pretty
 ok,
  but when I run the bayer program I get:
 
  sudo ./bayer /dev/video0 0
  Device /dev/video0 opened: USB Video Class device.
  Enabling color pipeline ...
  ERROR: Unable to set device control: -1
 
  From what I understand, the idea is to change the camera behaviour in
  run-time, isn't it? I mean, I can tell the camera to stop doing
  auto-adjustments (gain, shutter, whatever) anytime. Can this be
 achieved?

 That's right. The Quickcam Ultra Vision might have slightly different
 controls. I have no such model here, so I can't test the patch. Maybe
 Martin
 could have a look.

 Martin, by the way, is it necessary to put the webcam in bayer mode to
 disable
 the auto-exposure ? Or would the auto-exposure mode control do the job
 alone ?

 Cheers,

 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] Automatic Gain Control

2007-01-09 Thread Martin Rubli
Hi all,

On Mon, 08 Jan 2007 12:08:38 -0800, Laurent Pinchart  
[EMAIL PROTECTED] wrote:

 The thing is that I am trying to disable the camera auto gain.

 Martin, by the way, is it necessary to put the webcam in bayer mode to  
 disable the auto-exposure ? Or would the auto-exposure mode control do  
 the job
 alone ?

I think what you're doing by enabling raw Bayer mode shoots way over the  
top of what you want. Have you checked out this one here?
https://lists.berlios.de/pipermail/linux-uvc-devel/2006-December/001099.html

This disables auto gain/exposure mode and should be what you're looking  
for.

 That's right. The Quickcam Ultra Vision might have slightly different
 controls. I have no such model here, so I can't test the patch. Maybe  
 Martin could have a look.

This control is the same for the Ultra Vision as for the other controls.  
IIRC we're talking about a standard UVC control here anyway.

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


Re: [Linux-uvc-devel] Automatic Gain Control

2007-01-09 Thread Martin Rubli
Jose,

On Tue, 09 Jan 2007 06:53:29 -0800, Jose Luis Landabaso  
[EMAIL PROTECTED] wrote:

 I have arrived to a point in which I'm very confused.
 I have learnt that you can only turn off the color processing when the
 camera is not capturing.

True.

 So, I stop the capture program, and then run bayer.
 If I disable color processing I cannot run my capture program again  
 since.
 I always get:

 select timeout
 VIDIOC_DQBUF error 11, Resource temporarily unavailable

 When I turn again the video processing on then the program works fine  
 again.

 Any ideas?

I'm assuming you're not using any of the native resolutions for which raw  
mode works. Quoting from the FAQ entry:

For 1.3 MP cameras raw mode may only work in the camera's native  
resolutions, which are 960x720 or 1280x960. If color processing is  
disabled and streaming is started in a not supported resolution, the  
camera sends no data and the application may appear to hang.

This would certainly explain the timeout. What camera are you using and at  
which resolution?

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


Re: [Linux-uvc-devel] Automatic Gain Control

2007-01-09 Thread Martin Rubli
Michel,

On Mon, 08 Jan 2007 12:30:05 -0800, Michel Xhaard [EMAIL PROTECTED] wrote:

 I just upload a new revision of luvcview with pan/tilt fix, a lot of
 improvements.

Cool! :-)

 Seem strange that we cannot change the exposure in manuel
 mode ?

There should be a control to set the absolute exposure time ...

 Is there a way to set/reset the autowhite balance too ? a lot of
 robotic project need these features

... and one for white balance temperature. I'll double check tomorrow on  
my Linux machine but those are standard UVC controls that our cameras  
support.

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


Re: [Linux-uvc-devel] Automatic Gain Control

2006-12-20 Thread Martin Rubli
Hey,

Actually, it couldn't be much simpler. I think what you're looking for is  
the Exposure, Auto control, which looks something like this:

   Auto-exposure mode
 ID  : 15,
 Type: Choice,
 Flags   : { CAN_READ, CAN_WRITE },
 Values  : { 'Manual'[1], 'Aperture priority'[8] },
 Default : 8

Setting the control to 1 disables auto-gain and setting it back to 8  
reenables it. If you look at the UVC specification you'll see the meaning  
of the different bits, but 1 and 8 are the only values supported by the  
Logitech cameras.

Cheers,
Martin


On Wed, 06 Dec 2006 11:12:15 +0100, andrea giachetti [EMAIL PROTECTED] wrote:

 Hi
 Is there a way tro disable the automtic gain control
 of Logitech QuickCam Fusion webcams using
 linux-uvc? Thanks in advance
 andrea giachetti
___
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel


Re: [Linux-uvc-devel] Automatic Gain Control

2006-12-20 Thread Laurent Pinchart
 Actually, it couldn't be much simpler. I think what you're looking for is
 the Exposure, Auto control, which looks something like this:

Auto-exposure mode
  ID  : 15,
  Type: Choice,
  Flags   : { CAN_READ, CAN_WRITE },
  Values  : { 'Manual'[1], 'Aperture priority'[8] },
  Default : 8

 Setting the control to 1 disables auto-gain and setting it back to 8
 reenables it. If you look at the UVC specification you'll see the meaning
 of the different bits, but 1 and 8 are the only values supported by the
 Logitech cameras.

Actually, the bit you are interested in are D0 and D3. 1 and 8 are the control 
values.

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] Automatic Gain Control

2006-12-07 Thread Martin Rubli
The only way I can think of is to completely disable the color processing.  
This gives you access to the raw Bayer data, therefore disabling any (!)  
sort of automatic adjustments. If that sounds like something you want to  
try, let me know and I'll post some doc on how to do that. Also, I'll ask  
around a bit and see if there are any other ways ...

Cheers,
Martin


On Thu, 07 Dec 2006 09:21:11 +0100, Andrea Giachetti [EMAIL PROTECTED]  
wrote:

 Hi
 Thanks for the quick answer.
 I bought two webcams for a gesture tracking system, but, using  
 thresholding and color segmentation
 I'd lile to disable the automatic adjustments.
 isn't there any way?
 regards
 andrea

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


Re: [Linux-uvc-devel] Automatic Gain Control

2006-12-07 Thread Martin Rubli

Hi Evgeny,


Is this possible for Logitech QuickCam 5000? Accesing raw data is really
important for me.


Yes, it should work with all current Logitech UVC cameras.

I've attached a few instructions and files that should help you. Sorry for  
the poor layout, I just extracted it from the Wiki I'm currently  
preparing. A nicer version will be publicly available soon ...


Cheers,
Martin

quickcam-raw.tar.gz
Description: GNU Zip compressed data
___
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel


Re: [Linux-uvc-devel] Automatic Gain Control

2006-12-06 Thread Martin Rubli
No, there isn't. But if you tell us a little more about the requirement  
behind it, we might be able to suggest something else. :-)

Cheers,
Martin


On Wed, 06 Dec 2006 11:12:15 +0100, andrea giachetti [EMAIL PROTECTED] wrote:

 Hi
 Is there a way tro disable the automtic gain control
 of Logitech QuickCam Fusion webcams using
 linux-uvc? Thanks in advance
 andrea giachetti
 ___
 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