From: Jean-Francois Moine <moinejf@free.fr>
To: Antonio Ospite <ospite@studenti.unina.it>
Cc: linux-media@vger.kernel.org, "Erik Andrén" <erik.andren@gmail.com>
Subject: Re: gspca V4L2_CID_EXPOSURE_AUTO and VIDIOC_G/S/TRY_EXT_CTRLS
Date: Fri, 27 Apr 2012 09:53:09 +0200 [thread overview]
Message-ID: <20120427095309.5d922000@tele> (raw)
In-Reply-To: <20120418153720.1359c7d2f2a3efc2c7c17b88@studenti.unina.it>
On Wed, 18 Apr 2012 15:37:20 +0200
Antonio Ospite <ospite@studenti.unina.it> wrote:
> I noticed that AEC (Automatic Exposure Control, or
> V4L2_CID_EXPOSURE_AUTO) does not work in the ov534 gspca driver, either
> from guvcview or qv4l2.
[snip]
> So in ov534, but I think in m5602 too, V4L2_CID_EXPOSURE_AUTO does not
> work from guvcview, qv4l2, or v4l2-ctrl, for instance the latter fails
> with the message:
>
> error 25 getting ext_ctrl Auto Exposure
>
> I tried adding an hackish implementation of vidioc_g_ext_ctrls and
> vidioc_s_ext_ctrls to gspca, and with these V4L2_CID_EXPOSURE_AUTO seems
> to work, but I need to learn more about this kind of controls before
> I can propose a decent implementation for mainline inclusion myself, so
> if anyone wants to anticipate me I'd be glad to test :)
>
> Unrelated, but maybe worth mentioning is that V4L2_CID_EXPOSURE_AUTO is
> of type MENU, while some drivers are treating it as a boolean, I think
> I can fix this one if needed.
Hi Antonio,
Yes, V4L2_CID_EXPOSURE_AUTO is of class V4L2_CTRL_CLASS_CAMERA, and, as
the associated menu shows, it is not suitable for webcams.
In the webcam world, the autoexposure is often the same as the
autogain: in the knee algorithm
(http://81.209.78.62:8080/docs/LowLightOptimization.html - also look at
gspca/sonixb.c), both exposure and gain are concerned. The cases where
a user wants only autoexposure (fixed gain) or autogain (fixed
exposure) are rare. If you want people to be able to do that, you
should add a new webcam control, V4L2_CID_AUTOEXPOSURE, and also add it
to each driver which implements the knee algorithm, and handle the three
cases, autogain only, autoexposure only and knee.
Then, looking about your implementation of vidioc_s_ext_ctrls, I found
it was a bit simple: setting many controls is atomic, i.e., if any
error occurs at some point, the previous controls should be reset to
their original values. Same about vidioc_g_ext_ctrls: the mutex must be
taken only once for the values do not change. You also do not check if
the controls are in a same control class. Anyway, are these ioctl's
needed?
Regards.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
next prev parent reply other threads:[~2012-04-27 7:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-18 13:37 gspca V4L2_CID_EXPOSURE_AUTO and VIDIOC_G/S/TRY_EXT_CTRLS Antonio Ospite
2012-04-20 15:19 ` [RFC PATCH 0/3] gspca: Implement VIDIOC_G_EXT_CTRLS and VIDIOC_S_EXT_CTRLS Antonio Ospite
2012-04-20 15:19 ` [RFC PATCH 1/3] [media] gspca - main: rename get_ctrl to get_ctrl_index Antonio Ospite
2012-04-20 15:19 ` [RFC PATCH 2/3] [media] gspca - main: factor out the logic to set and get controls Antonio Ospite
2012-04-20 15:19 ` [RFC PATCH 3/3] [media] gspca - main: implement vidioc_g_ext_ctrls and vidioc_s_ext_ctrls Antonio Ospite
2012-04-27 8:20 ` Hans Verkuil
2012-04-27 9:24 ` Jean-Francois Moine
2012-04-27 9:34 ` Hans Verkuil
2012-04-27 10:51 ` Hans de Goede
2012-04-27 7:53 ` Jean-Francois Moine [this message]
2012-04-27 12:04 ` gspca V4L2_CID_EXPOSURE_AUTO and VIDIOC_G/S/TRY_EXT_CTRLS Antonio Ospite
2012-04-27 12:14 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120427095309.5d922000@tele \
--to=moinejf@free.fr \
--cc=erik.andren@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=ospite@studenti.unina.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox