* Gain controls in v4l2-ctrl framework
@ 2012-09-23 11:26 Prabhakar Lad
2012-09-23 13:20 ` Sakari Ailus
` (3 more replies)
0 siblings, 4 replies; 26+ messages in thread
From: Prabhakar Lad @ 2012-09-23 11:26 UTC (permalink / raw)
To: Hans Verkuil, Sakari Ailus, Laurent Pinchart,
Guennadi Liakhovetski, Sylwester Nawrocki
Cc: dlos, linux-media, Prabhakar Lad, Manjunath Hadli
Hi All,
The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
B/Mg gain values.
Since these control can be re-usable I am planning to add the
following gain controls as part
of the framework:
1: V4L2_CID_GAIN_RED
2: V4L2_CID_GAIN_GREEN_RED
3: V4L2_CID_GAIN_GREEN_BLUE
4: V4L2_CID_GAIN_BLUE
5: V4L2_CID_GAIN_OFFSET
I need your opinion's to get moving to add them.
Thanks and Regards,
--Prabhakar Lad
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-23 11:26 Gain controls in v4l2-ctrl framework Prabhakar Lad
@ 2012-09-23 13:20 ` Sakari Ailus
2012-09-23 16:17 ` Laurent Pinchart
2012-09-24 10:55 ` Hans de Goede
` (2 subsequent siblings)
3 siblings, 1 reply; 26+ messages in thread
From: Sakari Ailus @ 2012-09-23 13:20 UTC (permalink / raw)
To: Prabhakar Lad
Cc: Hans Verkuil, Laurent Pinchart, Guennadi Liakhovetski,
Sylwester Nawrocki, dlos, linux-media, Prabhakar Lad,
Manjunath Hadli
Hi Prabhakar,
Prabhakar Lad wrote:
> Hi All,
>
> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
> B/Mg gain values.
> Since these control can be re-usable I am planning to add the
> following gain controls as part
> of the framework:
>
> 1: V4L2_CID_GAIN_RED
> 2: V4L2_CID_GAIN_GREEN_RED
> 3: V4L2_CID_GAIN_GREEN_BLUE
> 4: V4L2_CID_GAIN_BLUE
> 5: V4L2_CID_GAIN_OFFSET
>
> I need your opinion's to get moving to add them.
I think these controls can fit under the image processing controls class
--- image processing and not image source since these can also have a
digital implementation e.g. in an ISP.
Kind regards,
--
Sakari Ailus
sakari.ailus@iki.fi
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-23 13:20 ` Sakari Ailus
@ 2012-09-23 16:17 ` Laurent Pinchart
2012-09-23 16:27 ` Sakari Ailus
0 siblings, 1 reply; 26+ messages in thread
From: Laurent Pinchart @ 2012-09-23 16:17 UTC (permalink / raw)
To: Sakari Ailus
Cc: Prabhakar Lad, Hans Verkuil, Guennadi Liakhovetski,
Sylwester Nawrocki, dlos, linux-media, Prabhakar Lad,
Manjunath Hadli
Hi,
On Sunday 23 September 2012 16:20:06 Sakari Ailus wrote:
> Prabhakar Lad wrote:
> > Hi All,
> >
> > The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
> > B/Mg gain values.
> > Since these control can be re-usable I am planning to add the
> > following gain controls as part
> > of the framework:
> >
> > 1: V4L2_CID_GAIN_RED
> > 2: V4L2_CID_GAIN_GREEN_RED
> > 3: V4L2_CID_GAIN_GREEN_BLUE
> > 4: V4L2_CID_GAIN_BLUE
> > 5: V4L2_CID_GAIN_OFFSET
> >
> > I need your opinion's to get moving to add them.
We already have a V4L2_CID_GAIN control and a V4L2_CID_CHROMA_GAIN control in
the user controls class. I'd like to document how those controls and the new
proposed gain controls interact. At first glance they don't interact at all,
devices should not implement both, the user class gain controls are higher-
level than the controls you proposed - this should still be documented though,
to make sure driver and application authors will not get confused.
A couple of quick questions about the new controls. Do we also need a common
gain controls for monochrome sensors ? Is the offset always common for the 4
channels, or could devices implement a per-channel offset ? Is the offset
applied before or after the gains ? How does it relate to black level
compensation ?
> I think these controls can fit under the image processing controls class
> --- image processing and not image source since these can also have a
> digital implementation e.g. in an ISP.
Sounds good to me.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-23 16:17 ` Laurent Pinchart
@ 2012-09-23 16:27 ` Sakari Ailus
2012-09-24 11:05 ` Laurent Pinchart
0 siblings, 1 reply; 26+ messages in thread
From: Sakari Ailus @ 2012-09-23 16:27 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Prabhakar Lad, Hans Verkuil, Guennadi Liakhovetski,
Sylwester Nawrocki, dlos, linux-media, Prabhakar Lad,
Manjunath Hadli
Hi Laurent,
Laurent Pinchart wrote:
> Hi,
>
> On Sunday 23 September 2012 16:20:06 Sakari Ailus wrote:
>> Prabhakar Lad wrote:
>>> Hi All,
>>>
>>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
>>> B/Mg gain values.
>>> Since these control can be re-usable I am planning to add the
>>> following gain controls as part
>>> of the framework:
>>>
>>> 1: V4L2_CID_GAIN_RED
>>> 2: V4L2_CID_GAIN_GREEN_RED
>>> 3: V4L2_CID_GAIN_GREEN_BLUE
>>> 4: V4L2_CID_GAIN_BLUE
>>> 5: V4L2_CID_GAIN_OFFSET
>>>
>>> I need your opinion's to get moving to add them.
>
> We already have a V4L2_CID_GAIN control and a V4L2_CID_CHROMA_GAIN control in
> the user controls class. I'd like to document how those controls and the new
> proposed gain controls interact. At first glance they don't interact at all,
> devices should not implement both, the user class gain controls are higher-
> level than the controls you proposed - this should still be documented though,
> to make sure driver and application authors will not get confused.
>
> A couple of quick questions about the new controls. Do we also need a common
> gain controls for monochrome sensors ? Is the offset always common for the 4
I think we should have a common gain control for sensors in general,
whether monochrome or not. Many sensors support global digital gain,
either only or besides the per-channel gains.
Kind regards,
--
Sakari Ailus
sakari.ailus@iki.fi
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-23 11:26 Gain controls in v4l2-ctrl framework Prabhakar Lad
2012-09-23 13:20 ` Sakari Ailus
@ 2012-09-24 10:55 ` Hans de Goede
2012-09-24 11:00 ` Laurent Pinchart
2012-09-24 14:42 ` Prabhakar Lad
2012-09-24 20:06 ` Sakari Ailus
2012-09-26 6:44 ` Prabhakar Lad
3 siblings, 2 replies; 26+ messages in thread
From: Hans de Goede @ 2012-09-24 10:55 UTC (permalink / raw)
To: Prabhakar Lad
Cc: Hans Verkuil, Sakari Ailus, Laurent Pinchart,
Guennadi Liakhovetski, Sylwester Nawrocki, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli
Hi,
On 09/23/2012 01:26 PM, Prabhakar Lad wrote:
> Hi All,
>
> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
> B/Mg gain values.
> Since these control can be re-usable I am planning to add the
> following gain controls as part
> of the framework:
>
> 1: V4L2_CID_GAIN_RED
> 2: V4L2_CID_GAIN_GREEN_RED
> 3: V4L2_CID_GAIN_GREEN_BLUE
Not all sensors have separate V4L2_CID_GAIN_GREEN_RED / V4L2_CID_GAIN_GREEN_BLUE,
so we will need a separate control for sensors which have one combined gain
called simply V4L2_CID_GAIN_GREEN
Also do we really need separate V4L2_CID_GAIN_GREEN_RED / V4L2_CID_GAIN_GREEN_BLUE
controls? I know hardware has them, but in my experience that is only done as it
is simpler to make the hardware this way (fully symmetric sensor grid), have you ever
tried actually using different gain settings for the 2 different green rows ?
I've and that always results in an ugly checker board pattern. So I think we can
and should only have a V4L2_CID_GAIN_GREEN, and for sensors with 2 green gains
have that control both, forcing both to always have the same setting, which is
really what you want anyways ...
> 4: V4L2_CID_GAIN_BLUE
> 5: V4L2_CID_GAIN_OFFSET
GAIN_OFFSET that sounds a bit weird... GAIN_OFFSET sounds like it is
a number which gets added to the 3/4 gain settings before the gain gets applied,
but I assume that you just mean a number which gets added to the value from
the pixel, either before or after the gain is applied and I must admit I cannot
come up with a better name.
I believe (not sure) that some sensors have these per color ... The question
is if it makes sense to actually control this per color though, I don't think it
does as it is meant to compensate for any fixed measuring errors, which are the
same for all 3/4 colors. Note that all the sensor cells are exactly the same,
later on a color grid gets added on top of the sensors to turn them into r/g/b
cells, but physically they are the same cells, so with the same process and
temperature caused measuring errors...
Regards,
Hans
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-24 10:55 ` Hans de Goede
@ 2012-09-24 11:00 ` Laurent Pinchart
2012-09-24 11:04 ` Hans de Goede
2012-09-24 14:42 ` Prabhakar Lad
1 sibling, 1 reply; 26+ messages in thread
From: Laurent Pinchart @ 2012-09-24 11:00 UTC (permalink / raw)
To: Hans de Goede
Cc: Prabhakar Lad, Hans Verkuil, Sakari Ailus, Guennadi Liakhovetski,
Sylwester Nawrocki, dlos, linux-media, Prabhakar Lad,
Manjunath Hadli
Hi Hans,
On Monday 24 September 2012 12:55:53 Hans de Goede wrote:
> On 09/23/2012 01:26 PM, Prabhakar Lad wrote:
> > Hi All,
> >
> > The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
> > B/Mg gain values.
> > Since these control can be re-usable I am planning to add the
> > following gain controls as part of the framework:
> >
> > 1: V4L2_CID_GAIN_RED
> > 2: V4L2_CID_GAIN_GREEN_RED
> > 3: V4L2_CID_GAIN_GREEN_BLUE
>
> Not all sensors have separate V4L2_CID_GAIN_GREEN_RED /
> V4L2_CID_GAIN_GREEN_BLUE, so we will need a separate control for sensors
> which have one combined gain called simply V4L2_CID_GAIN_GREEN
>
> Also do we really need separate V4L2_CID_GAIN_GREEN_RED /
> V4L2_CID_GAIN_GREEN_BLUE controls? I know hardware has them, but in my
> experience that is only done as it is simpler to make the hardware this way
> (fully symmetric sensor grid), have you ever tried actually using different
> gain settings for the 2 different green rows ?
>
> I've and that always results in an ugly checker board pattern. So I think we
> can and should only have a V4L2_CID_GAIN_GREEN, and for sensors with 2
> green gains have that control both, forcing both to always have the same
> setting, which is really what you want anyways ...
I've never had to set different gains for the two green components either,
although I haven't done much with them.
> > 4: V4L2_CID_GAIN_BLUE
> > 5: V4L2_CID_GAIN_OFFSET
>
> GAIN_OFFSET that sounds a bit weird... GAIN_OFFSET sounds like it is
> a number which gets added to the 3/4 gain settings before the gain gets
> applied, but I assume that you just mean a number which gets added to the
> value from the pixel, either before or after the gain is applied and I must
> admit I cannot come up with a better name.
>
> I believe (not sure) that some sensors have these per color ...
Some might at least.
> The question is if it makes sense to actually control this per color though,
> I don't think it does as it is meant to compensate for any fixed measuring
> errors, which are the same for all 3/4 colors.
The offset is usually applied after the gain, so you might need different
offsets to compensate for a fixed error that is multiplied by different gains.
> Note that all the sensor cells are exactly the same, later on a color grid
> gets added on top of the sensors to turn them into r/g/b cells, but
> physically they are the same cells, so with the same process and temperature
> caused measuring errors...
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-24 11:00 ` Laurent Pinchart
@ 2012-09-24 11:04 ` Hans de Goede
0 siblings, 0 replies; 26+ messages in thread
From: Hans de Goede @ 2012-09-24 11:04 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Prabhakar Lad, Hans Verkuil, Sakari Ailus, Guennadi Liakhovetski,
Sylwester Nawrocki, dlos, linux-media, Prabhakar Lad,
Manjunath Hadli
Hi,
On 09/24/2012 01:00 PM, Laurent Pinchart wrote:
> Hi Hans,
>
> On Monday 24 September 2012 12:55:53 Hans de Goede wrote:
>> On 09/23/2012 01:26 PM, Prabhakar Lad wrote:
>>> Hi All,
>>>
>>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
>>> B/Mg gain values.
>>> Since these control can be re-usable I am planning to add the
>>> following gain controls as part of the framework:
>>>
>>> 1: V4L2_CID_GAIN_RED
>>> 2: V4L2_CID_GAIN_GREEN_RED
>>> 3: V4L2_CID_GAIN_GREEN_BLUE
>>
>> Not all sensors have separate V4L2_CID_GAIN_GREEN_RED /
>> V4L2_CID_GAIN_GREEN_BLUE, so we will need a separate control for sensors
>> which have one combined gain called simply V4L2_CID_GAIN_GREEN
>>
>> Also do we really need separate V4L2_CID_GAIN_GREEN_RED /
>> V4L2_CID_GAIN_GREEN_BLUE controls? I know hardware has them, but in my
>> experience that is only done as it is simpler to make the hardware this way
>> (fully symmetric sensor grid), have you ever tried actually using different
>> gain settings for the 2 different green rows ?
>>
>> I've and that always results in an ugly checker board pattern. So I think we
>> can and should only have a V4L2_CID_GAIN_GREEN, and for sensors with 2
>> green gains have that control both, forcing both to always have the same
>> setting, which is really what you want anyways ...
>
> I've never had to set different gains for the two green components either,
> although I haven't done much with them.
>
>>> 4: V4L2_CID_GAIN_BLUE
>>> 5: V4L2_CID_GAIN_OFFSET
>>
>> GAIN_OFFSET that sounds a bit weird... GAIN_OFFSET sounds like it is
>> a number which gets added to the 3/4 gain settings before the gain gets
>> applied, but I assume that you just mean a number which gets added to the
>> value from the pixel, either before or after the gain is applied and I must
>> admit I cannot come up with a better name.
>>
>> I believe (not sure) that some sensors have these per color ...
>
> Some might at least.
>
>> The question is if it makes sense to actually control this per color though,
>> I don't think it does as it is meant to compensate for any fixed measuring
>> errors, which are the same for all 3/4 colors.
>
> The offset is usually applied after the gain, so you might need different
> offsets to compensate for a fixed error that is multiplied by different gains.
Hmm, so some have per color, some don't, so then we need:
V4L2_CID_GAIN_OFFSET
V4L2_CID_BLUE_OFFSET
V4L2_CID_RED_OFFSET
V4L2_CID_GREEN_OFFSET
Where GAIN_OFFSET is for the ones with just 1 offset register. Anyone have
a better name for that ?
Regards,
Hans
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-23 16:27 ` Sakari Ailus
@ 2012-09-24 11:05 ` Laurent Pinchart
0 siblings, 0 replies; 26+ messages in thread
From: Laurent Pinchart @ 2012-09-24 11:05 UTC (permalink / raw)
To: Sakari Ailus
Cc: Prabhakar Lad, Hans Verkuil, Guennadi Liakhovetski,
Sylwester Nawrocki, dlos, linux-media, Prabhakar Lad,
Manjunath Hadli
On Sunday 23 September 2012 19:27:03 Sakari Ailus wrote:
> Laurent Pinchart wrote:
> > On Sunday 23 September 2012 16:20:06 Sakari Ailus wrote:
> >> Prabhakar Lad wrote:
> >>> Hi All,
> >>>
> >>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
> >>> B/Mg gain values.
> >>> Since these control can be re-usable I am planning to add the
> >>> following gain controls as part of the framework:
> >>>
> >>> 1: V4L2_CID_GAIN_RED
> >>> 2: V4L2_CID_GAIN_GREEN_RED
> >>> 3: V4L2_CID_GAIN_GREEN_BLUE
> >>> 4: V4L2_CID_GAIN_BLUE
> >>> 5: V4L2_CID_GAIN_OFFSET
> >>>
> >>> I need your opinion's to get moving to add them.
> >
> > We already have a V4L2_CID_GAIN control and a V4L2_CID_CHROMA_GAIN control
> > in the user controls class. I'd like to document how those controls and
> > the new proposed gain controls interact. At first glance they don't
> > interact at all, devices should not implement both, the user class gain
> > controls are higher- level than the controls you proposed - this should
> > still be documented though, to make sure driver and application authors
> > will not get confused.
> >
> > A couple of quick questions about the new controls. Do we also need a
> > common gain controls for monochrome sensors ? Is the offset always common
> > for the 4
>
> I think we should have a common gain control for sensors in general,
> whether monochrome or not. Many sensors support global digital gain,
> either only or besides the per-channel gains.
Agreed. The documentation should clearly state that drivers must not implement
the common gain control as a shortcut to set all color gains to the same
value.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-24 10:55 ` Hans de Goede
2012-09-24 11:00 ` Laurent Pinchart
@ 2012-09-24 14:42 ` Prabhakar Lad
2012-09-24 17:17 ` Chris MacGregor
1 sibling, 1 reply; 26+ messages in thread
From: Prabhakar Lad @ 2012-09-24 14:42 UTC (permalink / raw)
To: Hans de Goede
Cc: Hans Verkuil, Sakari Ailus, Laurent Pinchart,
Guennadi Liakhovetski, Sylwester Nawrocki, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli
Hi Hans,
On Mon, Sep 24, 2012 at 4:25 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> Hi,
>
>
> On 09/23/2012 01:26 PM, Prabhakar Lad wrote:
>>
>> Hi All,
>>
>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
>> B/Mg gain values.
>> Since these control can be re-usable I am planning to add the
>> following gain controls as part
>> of the framework:
>>
>> 1: V4L2_CID_GAIN_RED
>> 2: V4L2_CID_GAIN_GREEN_RED
>> 3: V4L2_CID_GAIN_GREEN_BLUE
>
>
> Not all sensors have separate V4L2_CID_GAIN_GREEN_RED /
> V4L2_CID_GAIN_GREEN_BLUE,
> so we will need a separate control for sensors which have one combined gain
> called simply V4L2_CID_GAIN_GREEN
>
Agreed
> Also do we really need separate V4L2_CID_GAIN_GREEN_RED /
> V4L2_CID_GAIN_GREEN_BLUE
> controls? I know hardware has them, but in my experience that is only done
> as it
> is simpler to make the hardware this way (fully symmetric sensor grid), have
> you ever
> tried actually using different gain settings for the 2 different green rows
> ?
>
Never tried it.
> I've and that always results in an ugly checker board pattern. So I think we
> can
> and should only have a V4L2_CID_GAIN_GREEN, and for sensors with 2 green
> gains
> have that control both, forcing both to always have the same setting, which
> is
> really what you want anyways ...
>
Agreed.
Regards,
--Prabhakar Lad
>> 4: V4L2_CID_GAIN_BLUE
>> 5: V4L2_CID_GAIN_OFFSET
>
>
> GAIN_OFFSET that sounds a bit weird... GAIN_OFFSET sounds like it is
> a number which gets added to the 3/4 gain settings before the gain gets
> applied,
> but I assume that you just mean a number which gets added to the value from
> the pixel, either before or after the gain is applied and I must admit I
> cannot
> come up with a better name.
>
> I believe (not sure) that some sensors have these per color ... The question
> is if it makes sense to actually control this per color though, I don't
> think it
> does as it is meant to compensate for any fixed measuring errors, which are
> the
> same for all 3/4 colors. Note that all the sensor cells are exactly the
> same,
> later on a color grid gets added on top of the sensors to turn them into
> r/g/b
> cells, but physically they are the same cells, so with the same process and
> temperature caused measuring errors...
>
> Regards,
>
> Hans
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-24 14:42 ` Prabhakar Lad
@ 2012-09-24 17:17 ` Chris MacGregor
2012-09-24 18:46 ` Hans de Goede
0 siblings, 1 reply; 26+ messages in thread
From: Chris MacGregor @ 2012-09-24 17:17 UTC (permalink / raw)
To: Prabhakar Lad, Hans de Goede
Cc: Hans Verkuil, Sakari Ailus, Laurent Pinchart,
Guennadi Liakhovetski, Sylwester Nawrocki, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli
On 09/24/2012 07:42 AM, Prabhakar Lad wrote:
> Hi Hans,
>
> On Mon, Sep 24, 2012 at 4:25 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>> Hi,
>>
>>
>> On 09/23/2012 01:26 PM, Prabhakar Lad wrote:
>>> Hi All,
>>>
>>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
>>> B/Mg gain values.
>>> Since these control can be re-usable I am planning to add the
>>> following gain controls as part
>>> of the framework:
>>>
>>> 1: V4L2_CID_GAIN_RED
>>> 2: V4L2_CID_GAIN_GREEN_RED
>>> 3: V4L2_CID_GAIN_GREEN_BLUE
>>
>> Not all sensors have separate V4L2_CID_GAIN_GREEN_RED /
>> V4L2_CID_GAIN_GREEN_BLUE,
>> so we will need a separate control for sensors which have one combined gain
>> called simply V4L2_CID_GAIN_GREEN
>>
> Agreed
>
>> Also do we really need separate V4L2_CID_GAIN_GREEN_RED /
>> V4L2_CID_GAIN_GREEN_BLUE
>> controls? I know hardware has them, but in my experience that is only done
>> as it
>> is simpler to make the hardware this way (fully symmetric sensor grid), have
>> you ever
>> tried actually using different gain settings for the 2 different green rows
>> ?
>>
> Never tried it.
>
>> I've and that always results in an ugly checker board pattern. So I think we
>> can
>> and should only have a V4L2_CID_GAIN_GREEN, and for sensors with 2 green
>> gains
>> have that control both, forcing both to always have the same setting, which
>> is
>> really what you want anyways ...
>>
> Agreed.
Please don't do this. I am working with the MT9P031, which has separate
gains, and as we are using the color version of the sensor (which we can
get much more cheaply) with infrared illumination, we correct for the
slightly different response levels of the different color channels by
adjusting the individual gain controls. (I have patches to add the
controls, but I haven't had time yet to get them into good enough shape
to submit - sorry!)
It seems to me that for applications that want to set them to the same
value (presumably the vast majority), it is not so hard to set both the
green_red and green_blue. If you implement a single control, what
happens for the (admittedly rare) application that needs to control them
separately?
>
> Regards,
> --Prabhakar Lad
>
>>> 4: V4L2_CID_GAIN_BLUE
>>> 5: V4L2_CID_GAIN_OFFSET
>>
>> GAIN_OFFSET that sounds a bit weird... GAIN_OFFSET sounds like it is
>> a number which gets added to the 3/4 gain settings before the gain gets
>> applied,
>> but I assume that you just mean a number which gets added to the value from
>> the pixel, either before or after the gain is applied and I must admit I
>> cannot
>> come up with a better name.
>>
>> I believe (not sure) that some sensors have these per color ... The question
>> is if it makes sense to actually control this per color though, I don't
>> think it
>> does as it is meant to compensate for any fixed measuring errors, which are
>> the
>> same for all 3/4 colors. Note that all the sensor cells are exactly the
>> same,
>> later on a color grid gets added on top of the sensors to turn them into
>> r/g/b
>> cells, but physically they are the same cells, so with the same process and
>> temperature caused measuring errors...
>>
>> Regards,
>>
>> Hans
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-24 17:17 ` Chris MacGregor
@ 2012-09-24 18:46 ` Hans de Goede
2012-09-24 19:16 ` Chris MacGregor
0 siblings, 1 reply; 26+ messages in thread
From: Hans de Goede @ 2012-09-24 18:46 UTC (permalink / raw)
To: Chris MacGregor
Cc: Prabhakar Lad, Hans Verkuil, Sakari Ailus, Laurent Pinchart,
Guennadi Liakhovetski, Sylwester Nawrocki, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli
Hi,
On 09/24/2012 07:17 PM, Chris MacGregor wrote:
>
> On 09/24/2012 07:42 AM, Prabhakar Lad wrote:
>> Hi Hans,
>>
>> On Mon, Sep 24, 2012 at 4:25 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>>> Hi,
>>>
>>>
>>> On 09/23/2012 01:26 PM, Prabhakar Lad wrote:
>>>> Hi All,
>>>>
>>>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
>>>> B/Mg gain values.
>>>> Since these control can be re-usable I am planning to add the
>>>> following gain controls as part
>>>> of the framework:
>>>>
>>>> 1: V4L2_CID_GAIN_RED
>>>> 2: V4L2_CID_GAIN_GREEN_RED
>>>> 3: V4L2_CID_GAIN_GREEN_BLUE
>>>
>>> Not all sensors have separate V4L2_CID_GAIN_GREEN_RED /
>>> V4L2_CID_GAIN_GREEN_BLUE,
>>> so we will need a separate control for sensors which have one combined gain
>>> called simply V4L2_CID_GAIN_GREEN
>>>
>> Agreed
>>
>>> Also do we really need separate V4L2_CID_GAIN_GREEN_RED /
>>> V4L2_CID_GAIN_GREEN_BLUE
>>> controls? I know hardware has them, but in my experience that is only done
>>> as it
>>> is simpler to make the hardware this way (fully symmetric sensor grid), have
>>> you ever
>>> tried actually using different gain settings for the 2 different green rows
>>> ?
>>>
>> Never tried it.
>>
>>> I've and that always results in an ugly checker board pattern. So I think we
>>> can
>>> and should only have a V4L2_CID_GAIN_GREEN, and for sensors with 2 green
>>> gains
>>> have that control both, forcing both to always have the same setting, which
>>> is
>>> really what you want anyways ...
>>>
>> Agreed.
>
> Please don't do this. I am working with the MT9P031, which has separate gains, and as we are using the color version of the sensor (which we can get much more cheaply) with infrared illumination, we correct for the slightly different response levels of the different color channels by adjusting the individual gain controls.
Ok, sofar I'm following you, but are you saying that the correction you need to apply for the green pixels on the same row as red pixels, is different then the one for the green pixels on the same row as blue pixels ?
I can understand that the green "lenses" let through a different amount of infrared light then sat the red lenses, but is there any (significant) differences between the green lenses on 2 different rows?
(I have patches to add the controls, but I haven't had time yet to get them into good enough shape to submit - sorry!)
>
> It seems to me that for applications that want to set them to the same value (presumably the vast majority), it is not so hard to set both the green_red and green_blue. If you implement a single control, what happens for the (admittedly rare) application that needs to control them separately?
Well if these are showing up in something like a user oriented control-panel (which they may) then having one slider for both certainly is more userfriendly.
Regards,
Hans
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-24 18:46 ` Hans de Goede
@ 2012-09-24 19:16 ` Chris MacGregor
2012-09-24 20:12 ` Sakari Ailus
2012-09-24 20:27 ` Laurent Pinchart
0 siblings, 2 replies; 26+ messages in thread
From: Chris MacGregor @ 2012-09-24 19:16 UTC (permalink / raw)
To: Hans de Goede
Cc: Prabhakar Lad, Hans Verkuil, Sakari Ailus, Laurent Pinchart,
Guennadi Liakhovetski, Sylwester Nawrocki, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli
Hi, Hans.
On 09/24/2012 11:46 AM, Hans de Goede wrote:
> Hi,
>
> On 09/24/2012 07:17 PM, Chris MacGregor wrote:
>>
>> On 09/24/2012 07:42 AM, Prabhakar Lad wrote:
>>> Hi Hans,
>>>
>>> On Mon, Sep 24, 2012 at 4:25 PM, Hans de Goede <hdegoede@redhat.com>
>>> wrote:
>>>> Hi,
>>>>
>>>>
>>>> On 09/23/2012 01:26 PM, Prabhakar Lad wrote:
>>>>> Hi All,
>>>>>
>>>>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
>>>>> B/Mg gain values.
>>>>> Since these control can be re-usable I am planning to add the
>>>>> following gain controls as part
>>>>> of the framework:
>>>>>
>>>>> 1: V4L2_CID_GAIN_RED
>>>>> 2: V4L2_CID_GAIN_GREEN_RED
>>>>> 3: V4L2_CID_GAIN_GREEN_BLUE
>>>>
>>>> Not all sensors have separate V4L2_CID_GAIN_GREEN_RED /
>>>> V4L2_CID_GAIN_GREEN_BLUE,
>>>> so we will need a separate control for sensors which have one
>>>> combined gain
>>>> called simply V4L2_CID_GAIN_GREEN
>>>>
>>> Agreed
>>>
>>>> Also do we really need separate V4L2_CID_GAIN_GREEN_RED /
>>>> V4L2_CID_GAIN_GREEN_BLUE
>>>> controls? I know hardware has them, but in my experience that is
>>>> only done
>>>> as it
>>>> is simpler to make the hardware this way (fully symmetric sensor
>>>> grid), have
>>>> you ever
>>>> tried actually using different gain settings for the 2 different
>>>> green rows
>>>> ?
>>>>
>>> Never tried it.
>>>
>>>> I've and that always results in an ugly checker board pattern. So I
>>>> think we
>>>> can
>>>> and should only have a V4L2_CID_GAIN_GREEN, and for sensors with 2
>>>> green
>>>> gains
>>>> have that control both, forcing both to always have the same
>>>> setting, which
>>>> is
>>>> really what you want anyways ...
>>>>
>>> Agreed.
>>
>> Please don't do this. I am working with the MT9P031, which has
>> separate gains, and as we are using the color version of the sensor
>> (which we can get much more cheaply) with infrared illumination, we
>> correct for the slightly different response levels of the different
>> color channels by adjusting the individual gain controls.
>
> Ok, sofar I'm following you, but are you saying that the correction
> you need to apply for the green pixels on the same row as red pixels,
> is different then the one for the green pixels on the same row as blue
> pixels ?
IIRC, when we were calibrating, the two greens were at some times
different. The gain settings we're using at the moment are in fact the
same for both greens - we had to compromise to avoid getting into higher
values that increase the noise more than we like - but I don't know that
it would be that way in the future.
> I can understand that the green "lenses" let through a different
> amount of infrared light then sat the red lenses, but is there any
> (significant) differences between the green lenses on 2 different rows?
I don't have time right now to dig out the datasheet and re-read it, but
IIRC the auto-BLC (for instance) is row-wise, and consequently the
greens could actually need slightly different values. I think the
datasheet made it fairly clear that the motivation for including
separate green controls was because you might need them in practice, not
because the hardware guys were punting the problem over to the software
side.
>
> (I have patches to add the controls, but I haven't had time yet to
> get them into good enough shape to submit - sorry!)
>>
>> It seems to me that for applications that want to set them to the
>> same value (presumably the vast majority), it is not so hard to set
>> both the green_red and green_blue. If you implement a single
>> control, what happens for the (admittedly rare) application that
>> needs to control them separately?
>
> Well if these are showing up in something like a user oriented
> control-panel (which they may) then having one slider for both
> certainly is more userfriendly.
Okay, that's a fair point. But an application that wanted to could
insulate the user from it fairly easily.
I'm not opposed to having a single control, *if* there is some way for
apps to control the greens separately when they need to. I don't have a
brilliant solution for this offhand, other than just exposing the
separate controls.
>
> Regards,
>
> Hans
Thanks,
Chris
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-23 11:26 Gain controls in v4l2-ctrl framework Prabhakar Lad
2012-09-23 13:20 ` Sakari Ailus
2012-09-24 10:55 ` Hans de Goede
@ 2012-09-24 20:06 ` Sakari Ailus
2012-09-24 20:42 ` Laurent Pinchart
2012-09-26 6:44 ` Prabhakar Lad
3 siblings, 1 reply; 26+ messages in thread
From: Sakari Ailus @ 2012-09-24 20:06 UTC (permalink / raw)
To: Prabhakar Lad
Cc: Hans Verkuil, Laurent Pinchart, Guennadi Liakhovetski,
Sylwester Nawrocki, dlos, linux-media, Prabhakar Lad,
Manjunath Hadli
Hi Prabhakar,
On Sun, Sep 23, 2012 at 04:56:21PM +0530, Prabhakar Lad wrote:
> Hi All,
>
> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
> B/Mg gain values.
> Since these control can be re-usable I am planning to add the
> following gain controls as part
> of the framework:
>
> 1: V4L2_CID_GAIN_RED
> 2: V4L2_CID_GAIN_GREEN_RED
> 3: V4L2_CID_GAIN_GREEN_BLUE
> 4: V4L2_CID_GAIN_BLUE
One more thing: There's an analogue gain control already in the image source
class. I think we should explicitly say that the gains are digital (vs.
analogue).
Kind regards,
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-24 19:16 ` Chris MacGregor
@ 2012-09-24 20:12 ` Sakari Ailus
2012-09-24 20:27 ` Laurent Pinchart
1 sibling, 0 replies; 26+ messages in thread
From: Sakari Ailus @ 2012-09-24 20:12 UTC (permalink / raw)
To: Chris MacGregor
Cc: Hans de Goede, Prabhakar Lad, Hans Verkuil, Laurent Pinchart,
Guennadi Liakhovetski, Sylwester Nawrocki, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli
Hi Chris and Hans,
On Mon, Sep 24, 2012 at 12:16:01PM -0700, Chris MacGregor wrote:
...
> > (I have patches to add the controls, but I haven't had time yet
> >to get them into good enough shape to submit - sorry!)
> >>
> >>It seems to me that for applications that want to set them to
> >>the same value (presumably the vast majority), it is not so hard
> >>to set both the green_red and green_blue. If you implement a
> >>single control, what happens for the (admittedly rare)
> >>application that needs to control them separately?
> >
> >Well if these are showing up in something like a user oriented
> >control-panel (which they may) then having one slider for both
> >certainly is more userfriendly.
>
> Okay, that's a fair point. But an application that wanted to could
> insulate the user from it fairly easily.
>
> I'm not opposed to having a single control, *if* there is some way
> for apps to control the greens separately when they need to. I
> don't have a brilliant solution for this offhand, other than just
> exposing the separate controls.
I do recognise there's a need for developers to fiddle with such low level
controls as these but I can hardly see end users using them as such. Either
automatic white balance or a white balance control with higher level of
abstraction is likely better for that purpose.
Some sensors have only a single gain for the greens so these devices should
anyway implement just a single green gain (which is neither of the two).
Perhaps such abstraction could be performed by libv4l?
Just my 0,05 euros.
Kind regards,
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-24 19:16 ` Chris MacGregor
2012-09-24 20:12 ` Sakari Ailus
@ 2012-09-24 20:27 ` Laurent Pinchart
1 sibling, 0 replies; 26+ messages in thread
From: Laurent Pinchart @ 2012-09-24 20:27 UTC (permalink / raw)
To: Chris MacGregor
Cc: Hans de Goede, Prabhakar Lad, Hans Verkuil, Sakari Ailus,
Guennadi Liakhovetski, Sylwester Nawrocki, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli
On Monday 24 September 2012 12:16:01 Chris MacGregor wrote:
> On 09/24/2012 11:46 AM, Hans de Goede wrote:
> > On 09/24/2012 07:17 PM, Chris MacGregor wrote:
> >> On 09/24/2012 07:42 AM, Prabhakar Lad wrote:
> >>> On Mon, Sep 24, 2012 at 4:25 PM, Hans de Goede wrote:
> >>>> On 09/23/2012 01:26 PM, Prabhakar Lad wrote:
> >>>>> Hi All,
> >>>>>
> >>>>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
> >>>>> B/Mg gain values.
> >>>>> Since these control can be re-usable I am planning to add the
> >>>>> following gain controls as part of the framework:
> >>>>>
> >>>>> 1: V4L2_CID_GAIN_RED
> >>>>> 2: V4L2_CID_GAIN_GREEN_RED
> >>>>> 3: V4L2_CID_GAIN_GREEN_BLUE
> >>>>
> >>>> Not all sensors have separate V4L2_CID_GAIN_GREEN_RED /
> >>>> V4L2_CID_GAIN_GREEN_BLUE, so we will need a separate control for
> >>>> sensors which have one combined gain called simply V4L2_CID_GAIN_GREEN
> >>>
> >>> Agreed
> >>>
> >>>> Also do we really need separate V4L2_CID_GAIN_GREEN_RED /
> >>>> V4L2_CID_GAIN_GREEN_BLUE controls? I know hardware has them, but in my
> >>>> experience that is only done as it is simpler to make the hardware this
> >>>> way (fully symmetric sensor grid), have you ever tried actually using
> >>>> different gain settings for the 2 different green rows?
> >>>
> >>> Never tried it.
> >>>
> >>>> I've and that always results in an ugly checker board pattern. So I
> >>>> think we can and should only have a V4L2_CID_GAIN_GREEN, and for
> >>>> sensors with 2 green gains have that control both, forcing both to
> >>>> always have the same setting, which is really what you want anyways ...
> >>>
> >>> Agreed.
> >>
> >> Please don't do this. I am working with the MT9P031, which has separate
> >> gains, and as we are using the color version of the sensor (which we can
> >> get much more cheaply) with infrared illumination, we correct for the
> >> slightly different response levels of the different color channels by
> >> adjusting the individual gain controls.
> >
> > Ok, sofar I'm following you, but are you saying that the correction
> > you need to apply for the green pixels on the same row as red pixels,
> > is different then the one for the green pixels on the same row as blue
> > pixels ?
>
> IIRC, when we were calibrating, the two greens were at some times
> different. The gain settings we're using at the moment are in fact the
> same for both greens - we had to compromise to avoid getting into higher
> values that increase the noise more than we like - but I don't know that
> it would be that way in the future.
>
> > I can understand that the green "lenses" let through a different
> > amount of infrared light then sat the red lenses, but is there any
> > (significant) differences between the green lenses on 2 different rows?
>
> I don't have time right now to dig out the datasheet and re-read it, but
> IIRC the auto-BLC (for instance) is row-wise, and consequently the
> greens could actually need slightly different values. I think the
> datasheet made it fairly clear that the motivation for including
> separate green controls was because you might need them in practice, not
> because the hardware guys were punting the problem over to the software
> side.
>
> > (I have patches to add the controls, but I haven't had time yet to
> >
> > get them into good enough shape to submit - sorry!)
> >
> >> It seems to me that for applications that want to set them to the
> >> same value (presumably the vast majority), it is not so hard to set
> >> both the green_red and green_blue. If you implement a single
> >> control, what happens for the (admittedly rare) application that
> >> needs to control them separately?
> >
> > Well if these are showing up in something like a user oriented
> > control-panel (which they may) then having one slider for both
> > certainly is more userfriendly.
Those gains are low-level controls, they will very likely not appear in a
generic panel.
> Okay, that's a fair point. But an application that wanted to could insulate
> the user from it fairly easily.
>
> I'm not opposed to having a single control, *if* there is some way for apps
> to control the greens separately when they need to. I don't have a brilliant
> solution for this offhand, other than just exposing the separate controls.
As you have a use case for separate controls I'd vote for having separate
controls.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-24 20:06 ` Sakari Ailus
@ 2012-09-24 20:42 ` Laurent Pinchart
0 siblings, 0 replies; 26+ messages in thread
From: Laurent Pinchart @ 2012-09-24 20:42 UTC (permalink / raw)
To: Sakari Ailus
Cc: Prabhakar Lad, Hans Verkuil, Guennadi Liakhovetski,
Sylwester Nawrocki, dlos, linux-media, Prabhakar Lad,
Manjunath Hadli
Hi Sakari,
On Monday 24 September 2012 23:06:34 Sakari Ailus wrote:
> On Sun, Sep 23, 2012 at 04:56:21PM +0530, Prabhakar Lad wrote:
> > Hi All,
> >
> > The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
> > B/Mg gain values.
> > Since these control can be re-usable I am planning to add the
> > following gain controls as part
> > of the framework:
> >
> > 1: V4L2_CID_GAIN_RED
> > 2: V4L2_CID_GAIN_GREEN_RED
> > 3: V4L2_CID_GAIN_GREEN_BLUE
> > 4: V4L2_CID_GAIN_BLUE
>
> One more thing: There's an analogue gain control already in the image source
> class. I think we should explicitly say that the gains are digital (vs.
> analogue).
Some sensors have per-component analog and digital gains :-)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-23 11:26 Gain controls in v4l2-ctrl framework Prabhakar Lad
` (2 preceding siblings ...)
2012-09-24 20:06 ` Sakari Ailus
@ 2012-09-26 6:44 ` Prabhakar Lad
2012-09-26 6:53 ` Chris MacGregor
2012-09-26 7:42 ` Sakari Ailus
3 siblings, 2 replies; 26+ messages in thread
From: Prabhakar Lad @ 2012-09-26 6:44 UTC (permalink / raw)
To: Hans Verkuil, Sakari Ailus, Laurent Pinchart,
Guennadi Liakhovetski, Sylwester Nawrocki, Hans de Goede
Cc: dlos, linux-media, Prabhakar Lad, Manjunath Hadli
Hi All,
On Sun, Sep 23, 2012 at 4:56 PM, Prabhakar Lad
<prabhakar.csengg@gmail.com> wrote:
> Hi All,
>
> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
> B/Mg gain values.
> Since these control can be re-usable I am planning to add the
> following gain controls as part
> of the framework:
>
> 1: V4L2_CID_GAIN_RED
> 2: V4L2_CID_GAIN_GREEN_RED
> 3: V4L2_CID_GAIN_GREEN_BLUE
> 4: V4L2_CID_GAIN_BLUE
> 5: V4L2_CID_GAIN_OFFSET
>
> I need your opinion's to get moving to add them.
>
I am listing out the gain controls which is the outcome of above discussion:-
1: V4L2_CID_GAIN_RED
2: V4L2_CID_GAIN_GREEN_RED
3: V4L2_CID_GAIN_GREEN_BLUE
4: V4L2_CID_GAIN_BLUE
5: V4L2_CID_GAIN_OFFSET
6: V4L2_CID_BLUE_OFFSET
7: V4L2_CID_RED_OFFSET
8: V4L2_CID_GREEN_OFFSET
Please let me know for any addition/deletion.
Regards,
--Prabhakar Lad
> Thanks and Regards,
> --Prabhakar Lad
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-26 6:44 ` Prabhakar Lad
@ 2012-09-26 6:53 ` Chris MacGregor
2012-09-26 7:01 ` Prabhakar Lad
2012-09-26 7:42 ` Sakari Ailus
1 sibling, 1 reply; 26+ messages in thread
From: Chris MacGregor @ 2012-09-26 6:53 UTC (permalink / raw)
To: Prabhakar Lad
Cc: Hans Verkuil, Sakari Ailus, Laurent Pinchart,
Guennadi Liakhovetski, Sylwester Nawrocki, Hans de Goede, dlos,
linux-media, Prabhakar Lad, Manjunath Hadli
Hi All.
On 09/25/2012 11:44 PM, Prabhakar Lad wrote:
> Hi All,
>
> On Sun, Sep 23, 2012 at 4:56 PM, Prabhakar Lad
> <prabhakar.csengg@gmail.com> wrote:
>> Hi All,
>>
>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
>> B/Mg gain values.
>> Since these control can be re-usable I am planning to add the
>> following gain controls as part
>> of the framework:
>>
>> 1: V4L2_CID_GAIN_RED
>> 2: V4L2_CID_GAIN_GREEN_RED
>> 3: V4L2_CID_GAIN_GREEN_BLUE
>> 4: V4L2_CID_GAIN_BLUE
>> 5: V4L2_CID_GAIN_OFFSET
>>
>> I need your opinion's to get moving to add them.
>>
> I am listing out the gain controls which is the outcome of above discussion:-
>
> 1: V4L2_CID_GAIN_RED
> 2: V4L2_CID_GAIN_GREEN_RED
> 3: V4L2_CID_GAIN_GREEN_BLUE
> 4: V4L2_CID_GAIN_BLUE
> 5: V4L2_CID_GAIN_OFFSET
> 6: V4L2_CID_BLUE_OFFSET
> 7: V4L2_CID_RED_OFFSET
> 8: V4L2_CID_GREEN_OFFSET
>
> Please let me know for any addition/deletion.
I thought the consensus was that we would also need a
V4L2_CID_GAIN_GREEN, to handle devices for which there are not two
separate greens.
Also, should there be a V4L2_CID_GREEN_RED_OFFSET and
V4L2_CID_GREEN_BLUE_OFFSET, for consistency and to handle hardware that
has such offsets?
(Perhaps I missed an email in this thread, but I thought I caught them all.)
> Regards,
> --Prabhakar Lad
Cheers,
Chris MacGregor (the Seattle one)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-26 6:53 ` Chris MacGregor
@ 2012-09-26 7:01 ` Prabhakar Lad
0 siblings, 0 replies; 26+ messages in thread
From: Prabhakar Lad @ 2012-09-26 7:01 UTC (permalink / raw)
To: Chris MacGregor
Cc: Hans Verkuil, Sakari Ailus, Laurent Pinchart,
Guennadi Liakhovetski, Sylwester Nawrocki, Hans de Goede, dlos,
linux-media, Prabhakar Lad, Manjunath Hadli
Hi Chris,
On Wed, Sep 26, 2012 at 12:23 PM, Chris MacGregor <chris@cybermato.com> wrote:
> Hi All.
>
>
> On 09/25/2012 11:44 PM, Prabhakar Lad wrote:
>>
>> Hi All,
>>
>> On Sun, Sep 23, 2012 at 4:56 PM, Prabhakar Lad
>> <prabhakar.csengg@gmail.com> wrote:
>>>
>>> Hi All,
>>>
>>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
>>> B/Mg gain values.
>>> Since these control can be re-usable I am planning to add the
>>> following gain controls as part
>>> of the framework:
>>>
>>> 1: V4L2_CID_GAIN_RED
>>> 2: V4L2_CID_GAIN_GREEN_RED
>>> 3: V4L2_CID_GAIN_GREEN_BLUE
>>> 4: V4L2_CID_GAIN_BLUE
>>> 5: V4L2_CID_GAIN_OFFSET
>>>
>>> I need your opinion's to get moving to add them.
>>>
>> I am listing out the gain controls which is the outcome of above
>> discussion:-
>>
>> 1: V4L2_CID_GAIN_RED
>> 2: V4L2_CID_GAIN_GREEN_RED
>> 3: V4L2_CID_GAIN_GREEN_BLUE
>> 4: V4L2_CID_GAIN_BLUE
>> 5: V4L2_CID_GAIN_OFFSET
>> 6: V4L2_CID_BLUE_OFFSET
>> 7: V4L2_CID_RED_OFFSET
>> 8: V4L2_CID_GREEN_OFFSET
>>
>> Please let me know for any addition/deletion.
>
>
> I thought the consensus was that we would also need a V4L2_CID_GAIN_GREEN,
> to handle devices for which there are not two separate greens.
>
Ok, I'll add it too.
> Also, should there be a V4L2_CID_GREEN_RED_OFFSET and
> V4L2_CID_GREEN_BLUE_OFFSET, for consistency and to handle hardware that has
> such offsets?
>
+1 (But I would like opinions form others too for these control)
> (Perhaps I missed an email in this thread, but I thought I caught them all.)
>
May be I missed out :(
Thanks And Regards,
--Prabhakar Lad
>> Regards,
>> --Prabhakar Lad
>
>
> Cheers,
> Chris MacGregor (the Seattle one)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-26 6:44 ` Prabhakar Lad
2012-09-26 6:53 ` Chris MacGregor
@ 2012-09-26 7:42 ` Sakari Ailus
2012-09-26 7:46 ` Prabhakar Lad
2012-09-26 14:42 ` Chris MacGregor
1 sibling, 2 replies; 26+ messages in thread
From: Sakari Ailus @ 2012-09-26 7:42 UTC (permalink / raw)
To: Prabhakar Lad
Cc: Hans Verkuil, Laurent Pinchart, Guennadi Liakhovetski,
Sylwester Nawrocki, Hans de Goede, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli
On Wed, Sep 26, 2012 at 12:14:36PM +0530, Prabhakar Lad wrote:
> Hi All,
>
> On Sun, Sep 23, 2012 at 4:56 PM, Prabhakar Lad
> <prabhakar.csengg@gmail.com> wrote:
> > Hi All,
> >
> > The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
> > B/Mg gain values.
> > Since these control can be re-usable I am planning to add the
> > following gain controls as part
> > of the framework:
> >
> > 1: V4L2_CID_GAIN_RED
> > 2: V4L2_CID_GAIN_GREEN_RED
> > 3: V4L2_CID_GAIN_GREEN_BLUE
> > 4: V4L2_CID_GAIN_BLUE
> > 5: V4L2_CID_GAIN_OFFSET
> >
> > I need your opinion's to get moving to add them.
> >
>
> I am listing out the gain controls which is the outcome of above discussion:-
>
> 1: V4L2_CID_GAIN_RED
> 2: V4L2_CID_GAIN_GREEN_RED
> 3: V4L2_CID_GAIN_GREEN_BLUE
> 4: V4L2_CID_GAIN_BLUE
> 5: V4L2_CID_GAIN_OFFSET
> 6: V4L2_CID_BLUE_OFFSET
> 7: V4L2_CID_RED_OFFSET
> 8: V4L2_CID_GREEN_OFFSET
Hi Prabhakar,
As these are low level controls, I wonder whether it would make sense to
make a difference between digital and analogue gain. I admit I'm not quite
as certain whether there's such a large difference as there is for global
gains for the camera control algorithms.
Which ones do you need now?
Kind regards,
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-26 7:42 ` Sakari Ailus
@ 2012-09-26 7:46 ` Prabhakar Lad
2012-09-26 7:54 ` Sakari Ailus
2012-09-26 14:42 ` Chris MacGregor
1 sibling, 1 reply; 26+ messages in thread
From: Prabhakar Lad @ 2012-09-26 7:46 UTC (permalink / raw)
To: Sakari Ailus
Cc: Hans Verkuil, Laurent Pinchart, Guennadi Liakhovetski,
Sylwester Nawrocki, Hans de Goede, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli, Chris MacGregor
Hi Sakari,
On Wed, Sep 26, 2012 at 1:12 PM, Sakari Ailus <sakari.ailus@iki.fi> wrote:
> On Wed, Sep 26, 2012 at 12:14:36PM +0530, Prabhakar Lad wrote:
>> Hi All,
>>
>> On Sun, Sep 23, 2012 at 4:56 PM, Prabhakar Lad
>> <prabhakar.csengg@gmail.com> wrote:
>> > Hi All,
>> >
>> > The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
>> > B/Mg gain values.
>> > Since these control can be re-usable I am planning to add the
>> > following gain controls as part
>> > of the framework:
>> >
>> > 1: V4L2_CID_GAIN_RED
>> > 2: V4L2_CID_GAIN_GREEN_RED
>> > 3: V4L2_CID_GAIN_GREEN_BLUE
>> > 4: V4L2_CID_GAIN_BLUE
>> > 5: V4L2_CID_GAIN_OFFSET
>> >
>> > I need your opinion's to get moving to add them.
>> >
>>
>> I am listing out the gain controls which is the outcome of above discussion:-
>>
>> 1: V4L2_CID_GAIN_RED
>> 2: V4L2_CID_GAIN_GREEN_RED
>> 3: V4L2_CID_GAIN_GREEN_BLUE
>> 4: V4L2_CID_GAIN_BLUE
>> 5: V4L2_CID_GAIN_OFFSET
>> 6: V4L2_CID_BLUE_OFFSET
>> 7: V4L2_CID_RED_OFFSET
>> 8: V4L2_CID_GREEN_OFFSET
>
> Hi Prabhakar,
>
> As these are low level controls, I wonder whether it would make sense to
> make a difference between digital and analogue gain. I admit I'm not quite
> as certain whether there's such a large difference as there is for global
> gains for the camera control algorithms.
>
> Which ones do you need now?
>
Currently I am need of following,
1: V4L2_CID_GAIN_RED
2: V4L2_CID_GAIN_GREEN_RED
3: V4L2_CID_GAIN_GREEN_BLUE
4: V4L2_CID_GAIN_BLUE
5: V4L2_CID_GAIN_OFFSET
Regards,
--Prabhakar Lad
> Kind regards,
>
> --
> Sakari Ailus
> e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-26 7:46 ` Prabhakar Lad
@ 2012-09-26 7:54 ` Sakari Ailus
2012-09-26 8:06 ` Prabhakar Lad
0 siblings, 1 reply; 26+ messages in thread
From: Sakari Ailus @ 2012-09-26 7:54 UTC (permalink / raw)
To: Prabhakar Lad
Cc: Hans Verkuil, Laurent Pinchart, Guennadi Liakhovetski,
Sylwester Nawrocki, Hans de Goede, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli, Chris MacGregor
On Wed, Sep 26, 2012 at 01:16:08PM +0530, Prabhakar Lad wrote:
...
> Currently I am need of following,
>
> 1: V4L2_CID_GAIN_RED
> 2: V4L2_CID_GAIN_GREEN_RED
> 3: V4L2_CID_GAIN_GREEN_BLUE
> 4: V4L2_CID_GAIN_BLUE
> 5: V4L2_CID_GAIN_OFFSET
Are they analogue or digital?
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-26 7:54 ` Sakari Ailus
@ 2012-09-26 8:06 ` Prabhakar Lad
0 siblings, 0 replies; 26+ messages in thread
From: Prabhakar Lad @ 2012-09-26 8:06 UTC (permalink / raw)
To: Sakari Ailus
Cc: Hans Verkuil, Laurent Pinchart, Guennadi Liakhovetski,
Sylwester Nawrocki, Hans de Goede, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli, Chris MacGregor
On Wed, Sep 26, 2012 at 1:24 PM, Sakari Ailus <sakari.ailus@iki.fi> wrote:
> On Wed, Sep 26, 2012 at 01:16:08PM +0530, Prabhakar Lad wrote:
> ...
>> Currently I am need of following,
>>
>> 1: V4L2_CID_GAIN_RED
>> 2: V4L2_CID_GAIN_GREEN_RED
>> 3: V4L2_CID_GAIN_GREEN_BLUE
>> 4: V4L2_CID_GAIN_BLUE
>> 5: V4L2_CID_GAIN_OFFSET
>
> Are they analogue or digital?
>
digital
Regards,
--Prabhakar
> --
> Sakari Ailus
> e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-26 7:42 ` Sakari Ailus
2012-09-26 7:46 ` Prabhakar Lad
@ 2012-09-26 14:42 ` Chris MacGregor
2012-09-26 15:23 ` Laurent Pinchart
1 sibling, 1 reply; 26+ messages in thread
From: Chris MacGregor @ 2012-09-26 14:42 UTC (permalink / raw)
To: Sakari Ailus, Prabhakar Lad
Cc: Hans Verkuil, Laurent Pinchart, Guennadi Liakhovetski,
Sylwester Nawrocki, Hans de Goede, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli
Hi.
On 09/26/2012 12:42 AM, Sakari Ailus wrote:
> On Wed, Sep 26, 2012 at 12:14:36PM +0530, Prabhakar Lad wrote:
>> Hi All,
>>
>> On Sun, Sep 23, 2012 at 4:56 PM, Prabhakar Lad
>> <prabhakar.csengg@gmail.com> wrote:
>>> Hi All,
>>>
>>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
>>> B/Mg gain values.
>>> Since these control can be re-usable I am planning to add the
>>> following gain controls as part
>>> of the framework:
>>>
>>> 1: V4L2_CID_GAIN_RED
>>> 2: V4L2_CID_GAIN_GREEN_RED
>>> 3: V4L2_CID_GAIN_GREEN_BLUE
>>> 4: V4L2_CID_GAIN_BLUE
>>> 5: V4L2_CID_GAIN_OFFSET
>>>
>>> I need your opinion's to get moving to add them.
>>>
>> I am listing out the gain controls which is the outcome of above discussion:-
>>
>> 1: V4L2_CID_GAIN_RED
>> 2: V4L2_CID_GAIN_GREEN_RED
>> 3: V4L2_CID_GAIN_GREEN_BLUE
>> 4: V4L2_CID_GAIN_BLUE
>> 5: V4L2_CID_GAIN_OFFSET
>> 6: V4L2_CID_BLUE_OFFSET
>> 7: V4L2_CID_RED_OFFSET
>> 8: V4L2_CID_GREEN_OFFSET
> Hi Prabhakar,
>
> As these are low level controls, I wonder whether it would make sense to
> make a difference between digital and analogue gain. I admit I'm not quite
> as certain whether there's such a large difference as there is for global
> gains for the camera control algorithms.
Sorry to make this more complicated, but the Aptina MT9P031, for
instance (datasheet at
http://www.aptina.com/assets/downloadDocument.do?id=865 - see page 35),
has Digital Gain, an Analog Multiplier, and Analog Gain (for each of R,
Gr, Gb, and B). For each color channel, there is one register, with the
bits divided up into the three gain types. Furthermore, the different
gain types have different units (increments).
Currently (at least in the last version I've used), the driver hides all
this and provides a single gain control, and prioritizes which gain
types are adjusted at different user-level gain settings in accordance
with the datasheet recommendations (e.g. keep the analog gain between 1
and 4 for best noise performance, and use the multiplier for gains
between 4 and 8). This seems very sensible. If we try to distinguish
between analog and digital gains in the control definitions, what should
this driver do? And what about the multiplier? I suppose it could be
"hidden" by the driver as part of the analog gain, as the driver
currently does for the entire gain...
Cheers,
Chris
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-26 14:42 ` Chris MacGregor
@ 2012-09-26 15:23 ` Laurent Pinchart
2012-09-26 19:23 ` Sakari Ailus
0 siblings, 1 reply; 26+ messages in thread
From: Laurent Pinchart @ 2012-09-26 15:23 UTC (permalink / raw)
To: Chris MacGregor
Cc: Sakari Ailus, Prabhakar Lad, Hans Verkuil, Guennadi Liakhovetski,
Sylwester Nawrocki, Hans de Goede, dlos, linux-media,
Prabhakar Lad, Manjunath Hadli
Hi Chris,
On Wednesday 26 September 2012 07:42:41 Chris MacGregor wrote:
> On 09/26/2012 12:42 AM, Sakari Ailus wrote:
> > On Wed, Sep 26, 2012 at 12:14:36PM +0530, Prabhakar Lad wrote:
> >> On Sun, Sep 23, 2012 at 4:56 PM, Prabhakar Lad wrote:
> >>> Hi All,
> >>>
> >>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
> >>> B/Mg gain values.
> >>> Since these control can be re-usable I am planning to add the
> >>> following gain controls as part
> >>> of the framework:
> >>>
> >>> 1: V4L2_CID_GAIN_RED
> >>> 2: V4L2_CID_GAIN_GREEN_RED
> >>> 3: V4L2_CID_GAIN_GREEN_BLUE
> >>> 4: V4L2_CID_GAIN_BLUE
> >>> 5: V4L2_CID_GAIN_OFFSET
> >>>
> >>> I need your opinion's to get moving to add them.
> >>
> >> I am listing out the gain controls which is the outcome of above
> >> discussion:-
> >>
> >> 1: V4L2_CID_GAIN_RED
> >> 2: V4L2_CID_GAIN_GREEN_RED
> >> 3: V4L2_CID_GAIN_GREEN_BLUE
> >> 4: V4L2_CID_GAIN_BLUE
> >> 5: V4L2_CID_GAIN_OFFSET
> >> 6: V4L2_CID_BLUE_OFFSET
> >> 7: V4L2_CID_RED_OFFSET
> >> 8: V4L2_CID_GREEN_OFFSET
> >
> > Hi Prabhakar,
> >
> > As these are low level controls, I wonder whether it would make sense to
> > make a difference between digital and analogue gain. I admit I'm not quite
> > as certain whether there's such a large difference as there is for global
> > gains for the camera control algorithms.
>
> Sorry to make this more complicated, but the Aptina MT9P031, for
> instance (datasheet at
> http://www.aptina.com/assets/downloadDocument.do?id=865 - see page 35),
> has Digital Gain, an Analog Multiplier, and Analog Gain (for each of R,
> Gr, Gb, and B). For each color channel, there is one register, with the
> bits divided up into the three gain types. Furthermore, the different
> gain types have different units (increments).
>
> Currently (at least in the last version I've used), the driver hides all
> this and provides a single gain control, and prioritizes which gain
> types are adjusted at different user-level gain settings in accordance
> with the datasheet recommendations (e.g. keep the analog gain between 1
> and 4 for best noise performance, and use the multiplier for gains
> between 4 and 8). This seems very sensible.
I think it should be fine for now. If we later find out that a user space
application really needs to control the analog and digital gains individually
and precisely we can always split the controls then. For now I think a single
gain control (per channel) that groups analog and digital gains should be
enough.
> If we try to distinguish between analog and digital gains in the control
> definitions, what should this driver do? And what about the multiplier? I
> suppose it could be "hidden" by the driver as part of the analog gain, as
> the driver currently does for the entire gain...
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Gain controls in v4l2-ctrl framework
2012-09-26 15:23 ` Laurent Pinchart
@ 2012-09-26 19:23 ` Sakari Ailus
0 siblings, 0 replies; 26+ messages in thread
From: Sakari Ailus @ 2012-09-26 19:23 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Chris MacGregor, Prabhakar Lad, Hans Verkuil,
Guennadi Liakhovetski, Sylwester Nawrocki, Hans de Goede, dlos,
linux-media, Prabhakar Lad, Manjunath Hadli
Hi Laurent and Chris,
Laurent Pinchart wrote:
> On Wednesday 26 September 2012 07:42:41 Chris MacGregor wrote:
...
>> Sorry to make this more complicated, but the Aptina MT9P031, for
>> instance (datasheet at
>> http://www.aptina.com/assets/downloadDocument.do?id=865 - see page 35),
>> has Digital Gain, an Analog Multiplier, and Analog Gain (for each of R,
>> Gr, Gb, and B). For each color channel, there is one register, with the
>> bits divided up into the three gain types. Furthermore, the different
>> gain types have different units (increments).
>>
>> Currently (at least in the last version I've used), the driver hides all
>> this and provides a single gain control, and prioritizes which gain
>> types are adjusted at different user-level gain settings in accordance
>> with the datasheet recommendations (e.g. keep the analog gain between 1
>> and 4 for best noise performance, and use the multiplier for gains
>> between 4 and 8). This seems very sensible.
>
> I think it should be fine for now. If we later find out that a user space
> application really needs to control the analog and digital gains individually
> and precisely we can always split the controls then. For now I think a single
> gain control (per channel) that groups analog and digital gains should be
> enough.
Agreed. I think there's much less reason to keep them separate for
per-colour controls (compared to global gain), so little it's probably
not worth it.
Cheers,
--
Sakari Ailus
sakari.ailus@iki.fi
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2012-09-26 19:23 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-23 11:26 Gain controls in v4l2-ctrl framework Prabhakar Lad
2012-09-23 13:20 ` Sakari Ailus
2012-09-23 16:17 ` Laurent Pinchart
2012-09-23 16:27 ` Sakari Ailus
2012-09-24 11:05 ` Laurent Pinchart
2012-09-24 10:55 ` Hans de Goede
2012-09-24 11:00 ` Laurent Pinchart
2012-09-24 11:04 ` Hans de Goede
2012-09-24 14:42 ` Prabhakar Lad
2012-09-24 17:17 ` Chris MacGregor
2012-09-24 18:46 ` Hans de Goede
2012-09-24 19:16 ` Chris MacGregor
2012-09-24 20:12 ` Sakari Ailus
2012-09-24 20:27 ` Laurent Pinchart
2012-09-24 20:06 ` Sakari Ailus
2012-09-24 20:42 ` Laurent Pinchart
2012-09-26 6:44 ` Prabhakar Lad
2012-09-26 6:53 ` Chris MacGregor
2012-09-26 7:01 ` Prabhakar Lad
2012-09-26 7:42 ` Sakari Ailus
2012-09-26 7:46 ` Prabhakar Lad
2012-09-26 7:54 ` Sakari Ailus
2012-09-26 8:06 ` Prabhakar Lad
2012-09-26 14:42 ` Chris MacGregor
2012-09-26 15:23 ` Laurent Pinchart
2012-09-26 19:23 ` Sakari Ailus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).