All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: ov2685: Not delay latch for gain
@ 2018-03-01  8:44 Shunqian Zheng
  2018-03-01  8:53 ` Tomasz Figa
  0 siblings, 1 reply; 4+ messages in thread
From: Shunqian Zheng @ 2018-03-01  8:44 UTC (permalink / raw)
  To: sakari.ailus, mchehab; +Cc: linux-media, tfiga, Shunqian Zheng

Update the register 0x3503 to use 'no delay latch' for gain.
This makes sensor to output the first frame as normal rather
than a very dark one.

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
---
 drivers/media/i2c/ov2685.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c
index 9ac702e..83c55e8 100644
--- a/drivers/media/i2c/ov2685.c
+++ b/drivers/media/i2c/ov2685.c
@@ -119,7 +119,7 @@ struct ov2685 {
 	{0x3087, 0x00},
 	{0x3501, 0x4e},
 	{0x3502, 0xe0},
-	{0x3503, 0x07},
+	{0x3503, 0x27},
 	{0x350b, 0x36},
 	{0x3600, 0xb4},
 	{0x3603, 0x35},
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: ov2685: Not delay latch for gain
  2018-03-01  8:44 [PATCH] media: ov2685: Not delay latch for gain Shunqian Zheng
@ 2018-03-01  8:53 ` Tomasz Figa
  2018-03-01 10:14   ` Shunqian Zheng
  0 siblings, 1 reply; 4+ messages in thread
From: Tomasz Figa @ 2018-03-01  8:53 UTC (permalink / raw)
  To: Shunqian Zheng
  Cc: Sakari Ailus, Mauro Carvalho Chehab, Linux Media Mailing List

Hi Shunqian,

On Thu, Mar 1, 2018 at 5:44 PM, Shunqian Zheng <zhengsq@rock-chips.com> wrote:
> Update the register 0x3503 to use 'no delay latch' for gain.
> This makes sensor to output the first frame as normal rather
> than a very dark one.

I'm not 100% sure on how this setting works, but wouldn't it mean that
setting the gain mid-frame would result in half of the frame having
old gain and another half new? Depending how this works, perhaps we
should set this during initial register settings, but reset after
streaming starts?

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: ov2685: Not delay latch for gain
  2018-03-01  8:53 ` Tomasz Figa
@ 2018-03-01 10:14   ` Shunqian Zheng
  2018-03-06  3:02     ` Tomasz Figa
  0 siblings, 1 reply; 4+ messages in thread
From: Shunqian Zheng @ 2018-03-01 10:14 UTC (permalink / raw)
  To: Tomasz Figa; +Cc: Sakari Ailus, Mauro Carvalho Chehab, Linux Media Mailing List

Hi Tomasz,


On 2018年03月01日 16:53, Tomasz Figa wrote:
> Hi Shunqian,
>
> On Thu, Mar 1, 2018 at 5:44 PM, Shunqian Zheng <zhengsq@rock-chips.com> wrote:
>> Update the register 0x3503 to use 'no delay latch' for gain.
>> This makes sensor to output the first frame as normal rather
>> than a very dark one.
> I'm not 100% sure on how this setting works, but wouldn't it mean that
> setting the gain mid-frame would result in half of the frame having
> old gain and another half new? Depending how this works, perhaps we
> should set this during initial register settings, but reset after
> streaming starts?
Thank you.

I'm not quite sure too. Then I try to change gain during capture by:
    capture_10_frames.sh & while sleep .01; do v4l2-ctl -d /dev/video4 
--set-ctrl=analogue_gain=54; sleep .01; v4l2-ctl -d /dev/video4 
--set-ctrl=analogue_gain=1024; done

The gain setting takes effect for every single frame, not in mid-frame 
from my test.

Best wishes,
- Shunqian
>
> Best regards,
> Tomasz
>
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: ov2685: Not delay latch for gain
  2018-03-01 10:14   ` Shunqian Zheng
@ 2018-03-06  3:02     ` Tomasz Figa
  0 siblings, 0 replies; 4+ messages in thread
From: Tomasz Figa @ 2018-03-06  3:02 UTC (permalink / raw)
  To: Shunqian Zheng
  Cc: Sakari Ailus, Mauro Carvalho Chehab, Linux Media Mailing List

On Thu, Mar 1, 2018 at 7:14 PM, Shunqian Zheng <zhengsq@rock-chips.com> wrote:
> Hi Tomasz,
>
>
> On 2018年03月01日 16:53, Tomasz Figa wrote:
>>
>> Hi Shunqian,
>>
>> On Thu, Mar 1, 2018 at 5:44 PM, Shunqian Zheng <zhengsq@rock-chips.com>
>> wrote:
>>>
>>> Update the register 0x3503 to use 'no delay latch' for gain.
>>> This makes sensor to output the first frame as normal rather
>>> than a very dark one.
>>
>> I'm not 100% sure on how this setting works, but wouldn't it mean that
>> setting the gain mid-frame would result in half of the frame having
>> old gain and another half new? Depending how this works, perhaps we
>> should set this during initial register settings, but reset after
>> streaming starts?
>
> Thank you.
>
> I'm not quite sure too. Then I try to change gain during capture by:
>    capture_10_frames.sh & while sleep .01; do v4l2-ctl -d /dev/video4
> --set-ctrl=analogue_gain=54; sleep .01; v4l2-ctl -d /dev/video4
> --set-ctrl=analogue_gain=1024; done
>
> The gain setting takes effect for every single frame, not in mid-frame from
> my test.

Alright. I wasn't able to confirm the exact meaning of this bit myself
unfortunately, but if that's the behavior you're seeing, we should be
fine.

Reviewed-by: Tomasz Figa <tfiga@chromium.org>

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-06  3:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01  8:44 [PATCH] media: ov2685: Not delay latch for gain Shunqian Zheng
2018-03-01  8:53 ` Tomasz Figa
2018-03-01 10:14   ` Shunqian Zheng
2018-03-06  3:02     ` Tomasz Figa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.