public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Andy Walls <awalls@radix.net>,
	Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>,
	hverkuil@xs4all.nl,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: Chroma gain configuration
Date: Mon, 22 Feb 2010 10:40:09 -0300	[thread overview]
Message-ID: <4B828939.4040708@redhat.com> (raw)
In-Reply-To: <829197381002220510v64f6e948pfb73ebe4fcc180af@mail.gmail.com>

Devin Heitmueller wrote:
> Thanks everybody for the feedback.
> 
> On Mon, Feb 22, 2010 at 7:15 AM, Mauro Carvalho Chehab
> <mchehab@redhat.com> wrote:
>> The issue with cx88 chips is that, with some video input sources, the
>> AGC over-saturates the color pattern. So, depending on the analog video
>> standard and the quality of the source (TV or Composite/Svideo), it gives
>> more reallistic colors with different AGC/saturation configuration.
> 
> I'm actually having the same issue with the saa7113.  I have a
> specific input source where I am getting too much chroma gain via the
> AGC, and need to disable it and manually turn it down a bit.
> 
> While I can use the V4L2_CID_CHROMA_AGC to disable the AGC, I still
> need to then adjust the value of the gain.  I guess I *could* reuse
> the saturation control, this time controlling the chroma gain register
> instead of the saturation register, it would seem to make more sense
> to have an explicit control, since the controls correspond to
> different registers and in theory could be controlled independently.
> 
> I guess at this point, I have three options:
> 
> 1.   Introduce a new user control
> 
> 2.  Use a private control
> 
> 3.  Reuse the saturation control (hacking the driver such that the
> saturation control pokes different registers depending on whether the
> AGC is enabled).

I don't like (2). 

That's said, we really need to take a closer look on those color gain
controls. We have already several controls that change color gain:

#define V4L2_CID_SATURATION             (V4L2_CID_BASE+2)
#define V4L2_CID_AUTOGAIN               (V4L2_CID_BASE+18)
#define V4L2_CID_GAIN                   (V4L2_CID_BASE+19)
#define V4L2_CID_CHROMA_AGC                     (V4L2_CID_BASE+29)
#define V4L2_CID_AUTO_WHITE_BALANCE     (V4L2_CID_BASE+12)
#define V4L2_CID_DO_WHITE_BALANCE       (V4L2_CID_BASE+13)
#define V4L2_CID_RED_BALANCE            (V4L2_CID_BASE+14)
#define V4L2_CID_BLUE_BALANCE           (V4L2_CID_BASE+15)
#define V4L2_CID_WHITE_BALANCE_TEMPERATURE      (V4L2_CID_BASE+26)

The map of the above controls are not uniform along the drivers, and the API
is not clear enough about what is expected on each of the above controls.

For example, on some drivers (mostly webcam ones), the red/blue balance as used as 
"red/blue gain", and not as balance.

I remember we've started some discussions about this with some DaVinci patches,
but we never finished those discussions.

I think that the control you want is V4L2_CID_GAIN.
> 
> On a related note, has anyone noticed that the v4l2-dbg tool appears
> to always insist on using the "extended controls ioctl" for any
> attempts to set private controls?  This doesn't seem right to me.

I agree.

> I believe there probably are cases where extended controls are required,
> but I believe just a general user control based on
> V4L2_CID_PRIVATE_BASE should probably be able to work even with the
> generic VIDIOC_S_CTRL
> 
> I'm just asking because it would mean in order for v4l2-dbg to work
> with my solution i would have to add support for extended controls in
> general to the saa7115 driver, which shouldn't be necessary.

The end objective is to have everybody implementing extended controls and
removing the old controls, letting the V4L2 ioctl2 to convert a call to a
simple control into an extended control callback. So, I think it would
be worthy to implement extended control on saa7115.


Cheers,
Mauro

  reply	other threads:[~2010-02-22 13:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22  4:07 Chroma gain configuration Devin Heitmueller
2010-02-22 11:04 ` Frej Drejhammar
2010-02-22 11:40 ` Andy Walls
2010-02-22 12:15   ` Mauro Carvalho Chehab
2010-02-22 13:10     ` Devin Heitmueller
2010-02-22 13:40       ` Mauro Carvalho Chehab [this message]
2010-02-22 13:47         ` Devin Heitmueller
2010-02-22 13:58           ` Mauro Carvalho Chehab
2010-02-22 21:17             ` Devin Heitmueller
2010-02-22 21:32               ` Mauro Carvalho Chehab
2010-02-22 21:38                 ` Devin Heitmueller
2010-02-22 21:47                   ` Hans Verkuil
2010-02-22 21:41               ` Hans Verkuil
2010-02-22 21:43                 ` Devin Heitmueller
2010-02-22 21:54                   ` Hans Verkuil
2010-02-22 22:00                     ` Devin Heitmueller
2010-02-23  7:53                       ` Hans Verkuil
2010-02-23 14:20                         ` Andy Walls
2010-02-23 14:41                           ` Hans Verkuil
2010-02-23 15:33                             ` Andy Walls
2010-02-23 15:41                               ` Andy Walls
2010-02-23 18:11                               ` My TV's standard video controls (Re: Chroma gain configuration) Andy Walls
2010-02-23 15:15                         ` Chroma gain configuration Devin Heitmueller
2010-02-25  4:39                         ` Devin Heitmueller
2010-02-22 23:50   ` Sakari Ailus

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=4B828939.4040708@redhat.com \
    --to=mchehab@redhat.com \
    --cc=awalls@radix.net \
    --cc=dheitmueller@kernellabs.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@maxwell.research.nokia.com \
    /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