[{"id":14059,"web_url":"https://patchwork.libcamera.org/comment/14059/","msgid":"<CAEmqJPrd3iGMVzoOQGuH1d9BffKgyy75q6hHsFxw88nrn5M2ng@mail.gmail.com>","date":"2020-12-04T16:02:57","subject":"Re: [libcamera-devel] [PATCH 5/5] src: ipa: raspberrypi: Drop the\n\tcorrect number of frames on startup for ov5647","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi David,\n\nThank you for your patch.\n\nOn Wed, 2 Dec 2020 at 11:53, David Plowman <david.plowman@raspberrypi.com>\nwrote:\n\n> The ov5647 delivers two under-exposed frames at startup, even when\n> the exposure and gain are explicitly programmed. The system needs to\n> be told to drop these.\n>\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  src/ipa/raspberrypi/cam_helper_ov5647.cpp | 10 ++++++++++\n>  1 file changed, 10 insertions(+)\n>\n> diff --git a/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n> b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n> index dc5d8275..0b841cd1 100644\n> --- a/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n> +++ b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n> @@ -19,6 +19,7 @@ public:\n>         uint32_t GainCode(double gain) const override;\n>         double Gain(uint32_t gain_code) const override;\n>         void GetDelays(int &exposure_delay, int &gain_delay) const\n> override;\n> +       unsigned int HideFramesStartup() const override;\n>         unsigned int HideFramesModeSwitch() const override;\n>         unsigned int MistrustFramesStartup() const override;\n>         unsigned int MistrustFramesModeSwitch() const override;\n> @@ -54,6 +55,15 @@ void CamHelperOv5647::GetDelays(int &exposure_delay,\n> int &gain_delay) const\n>         gain_delay = 2;\n>  }\n>\n> +unsigned int CamHelperOv5647::HideFramesStartup() const\n> +{\n> +       /*\n> +        * On startup, we get a couple of under-exposed frames which\n> +        * we don't want shown.\n> +        */\n> +       return 2;\n> +}\n> +\n>\n\nAh, that might answer part of my question on patch 4/5.  But we still don't\naccount for AWB/LS convergence.  Maybe we don't care?\n\nRegards,\nNaush\n\n\n\n>  unsigned int CamHelperOv5647::HideFramesModeSwitch() const\n>  {\n>         /*\n> --\n> 2.20.1\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id ED5D7BE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  4 Dec 2020 16:03:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B620B635F0;\n\tFri,  4 Dec 2020 17:03:15 +0100 (CET)","from mail-lj1-x233.google.com (mail-lj1-x233.google.com\n\t[IPv6:2a00:1450:4864:20::233])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B17A3635D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  4 Dec 2020 17:03:14 +0100 (CET)","by mail-lj1-x233.google.com with SMTP id a1so5847219ljq.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 04 Dec 2020 08:03:14 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"XJlZCfvC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=uhIrpnoUAqMCIWvl4MWWJItlmva9AhFwmv9/WmLFi5Q=;\n\tb=XJlZCfvCnxeBhA7ZjbVJNI9jDF3Ea4rrm2K9iIJTu5Pb30Ynu2LWxDjxwHW646YeOp\n\tvW8YeIsFj/gDIUn1EjS1bIhRYApuu0NNtfZqGBxi5Qhdoy7Nw0/y0kCm5TUjnUHDXXJZ\n\t3KTxcOhkXNzUVCbA3ewpTOrzMS0a+7HRRmE3GNtLmQonRHFG6YFjxmcegwZvzOCaegAc\n\tbARSCddibH4AZh9G7P0Bkqr94UzCpCP50x8DVWVwAzvi5ZitCwakSK1DIojuoC0eFOgY\n\tEGQ4C7s4Zym15idw8JrMhRfKoLM8OEXI4v4oQmXBwIAX+NBc/HDoan757Alh2RpeLasl\n\tXXhg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=uhIrpnoUAqMCIWvl4MWWJItlmva9AhFwmv9/WmLFi5Q=;\n\tb=uRHn5fTXqjUyWtgjNoWsCB+o0bv4dkliulw4fjtvuZlHJkizzfkEYahRDI8i67k+kk\n\td5HyFZ1Vr9XmEVHaiLj4O9XSdDEw5mPws9AjMbvrw/Dammp3LkMe0ETgvn+Lg9sJLELx\n\tvVettXyrFBjAngJtmhvoZ4MiSn7iw6p5lm6lNWpPB/SXV62j2seuf9uzcfhPEIdflz7o\n\tknyEerIOZUOctWAK+8DXkkLou8U6fsaSweQ/WQvNs2v0Unz845Vl2lxBmhI1lcLeXaeh\n\teVa8kBiowD6FREY/k/0qlfvGj89sKaBc0Q8BFxl2lELXsEDLCC92iUt0f/5G0Ckeiz6x\n\tO7OQ==","X-Gm-Message-State":"AOAM531Y0icyVuOGzk6mdmabqXb077NsdCc/2fQfjd8LSC9+gX05trmu\n\tnmfevKjv3ulUMY6g8X1bFM6gNzlMZnFS8vIhf0F1lw==","X-Google-Smtp-Source":"ABdhPJybjF9QVgS8Qw9uhO1+VdfTSh4mKXyLnjmw3iCD/LJ6Fb6oDifTX5KEV5DlKbw9QsmDSSAje23eIIFkmpm5ZlQ=","X-Received":"by 2002:a2e:3310:: with SMTP id\n\td16mr3755860ljc.103.1607097794128; \n\tFri, 04 Dec 2020 08:03:14 -0800 (PST)","MIME-Version":"1.0","References":"<20201202115253.14705-1-david.plowman@raspberrypi.com>\n\t<20201202115253.14705-6-david.plowman@raspberrypi.com>","In-Reply-To":"<20201202115253.14705-6-david.plowman@raspberrypi.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Fri, 4 Dec 2020 16:02:57 +0000","Message-ID":"<CAEmqJPrd3iGMVzoOQGuH1d9BffKgyy75q6hHsFxw88nrn5M2ng@mail.gmail.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 5/5] src: ipa: raspberrypi: Drop the\n\tcorrect number of frames on startup for ov5647","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"multipart/mixed;\n\tboundary=\"===============3208454556649803713==\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":14063,"web_url":"https://patchwork.libcamera.org/comment/14063/","msgid":"<CAHW6GYLpNZ7w0p0Gx_PpMBWtar+oJcbDkuSO0Xp3P=7cUqD5Jw@mail.gmail.com>","date":"2020-12-04T16:55:14","subject":"Re: [libcamera-devel] [PATCH 5/5] src: ipa: raspberrypi: Drop the\n\tcorrect number of frames on startup for ov5647","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nYes, thanks for the feedback.\n\nOn Fri, 4 Dec 2020 at 16:03, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n> Hi David,\n>\n> Thank you for your patch.\n>\n> On Wed, 2 Dec 2020 at 11:53, David Plowman <david.plowman@raspberrypi.com> wrote:\n>>\n>> The ov5647 delivers two under-exposed frames at startup, even when\n>> the exposure and gain are explicitly programmed. The system needs to\n>> be told to drop these.\n>>\n>> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n>> ---\n>>  src/ipa/raspberrypi/cam_helper_ov5647.cpp | 10 ++++++++++\n>>  1 file changed, 10 insertions(+)\n>>\n>> diff --git a/src/ipa/raspberrypi/cam_helper_ov5647.cpp b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n>> index dc5d8275..0b841cd1 100644\n>> --- a/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n>> +++ b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n>> @@ -19,6 +19,7 @@ public:\n>>         uint32_t GainCode(double gain) const override;\n>>         double Gain(uint32_t gain_code) const override;\n>>         void GetDelays(int &exposure_delay, int &gain_delay) const override;\n>> +       unsigned int HideFramesStartup() const override;\n>>         unsigned int HideFramesModeSwitch() const override;\n>>         unsigned int MistrustFramesStartup() const override;\n>>         unsigned int MistrustFramesModeSwitch() const override;\n>> @@ -54,6 +55,15 @@ void CamHelperOv5647::GetDelays(int &exposure_delay, int &gain_delay) const\n>>         gain_delay = 2;\n>>  }\n>>\n>> +unsigned int CamHelperOv5647::HideFramesStartup() const\n>> +{\n>> +       /*\n>> +        * On startup, we get a couple of under-exposed frames which\n>> +        * we don't want shown.\n>> +        */\n>> +       return 2;\n>> +}\n>> +\n>\n>\n> Ah, that might answer part of my question on patch 4/5.  But we still don't account for AWB/LS convergence.  Maybe we don't care?\n\nAWB is a slight issue, I've wondered about that. Generally it's never\nas badly \"off\" as AGC can be, so I ended up not worrying about it. But\nthe symmetry of giving it the same method and checking both certainly\nappeals to me.\n\nALSC is an interesting one. It, too, is never as badly off as AGC, but\non reflection, if it knew the colour temperature it could produce a\npretty decent table right from the word go. Unfortunately there's no\nway to tell it! I wonder whether the AWB could, if it has fixed colour\ngains, *deduce* the colour temperature and then set that in the\nAwbStatus. Hmmm, that sounds quite cunning, I need to think about it.\n\nAnyway, thanks for the various ideas, I'll look into doing some of\nthese things (and the name change) and post another set early next\nweek.\n\nBest regards\nDavid\n\n>\n> Regards,\n> Naush\n>\n>\n>>\n>>  unsigned int CamHelperOv5647::HideFramesModeSwitch() const\n>>  {\n>>         /*\n>> --\n>> 2.20.1\n>>\n>> _______________________________________________\n>> libcamera-devel mailing list\n>> libcamera-devel@lists.libcamera.org\n>> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 9724BBE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  4 Dec 2020 16:55:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C5DD9635EF;\n\tFri,  4 Dec 2020 17:55:28 +0100 (CET)","from mail-ot1-x343.google.com (mail-ot1-x343.google.com\n\t[IPv6:2607:f8b0:4864:20::343])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CE089635D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  4 Dec 2020 17:55:26 +0100 (CET)","by mail-ot1-x343.google.com with SMTP id y24so5828595otk.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 04 Dec 2020 08:55:26 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"Cbm2E9hD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=8YD+CrBXUtRVnpr5Q2docsFJSVaOtzPy3A9bC7RNc2w=;\n\tb=Cbm2E9hD01GQnnw4RMGqdVtA+CwwqxML5A9qEVKSwmUdXA0xF2dTxiW3eGXGKE2Kgi\n\tPPgk1nK2mHTVMr0sBVrdYNhPSVRoXdghzGOcxN8GZ3MSQKYIvZ4LDyRXz1ZjYCFWXMV9\n\tmD2ENFDM/8/Ixc3MQCZIM0YP/uwugeVH1t699gGKFde88hJYjN42Eet+YdPtKZ90RFKn\n\t9az8qTaypK20l58wCQnG8Scz6ltBVH6CNl5/b1YTh9o6K4ARHVvaxe2IgGSHYo3VRXII\n\tkEYSIhM3y2neGNAcLYw2l0knoIJ9eSEBEts8OGYa876n50UWDh2FtHqQB/k8rgdbe4H9\n\t7TuQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=8YD+CrBXUtRVnpr5Q2docsFJSVaOtzPy3A9bC7RNc2w=;\n\tb=pJYo9c/ndmd16S+Wh5LAyRWZY6afM9226i7BwyGn7vY7YtlrhAefesLcdj8K1wbrrf\n\t3Jhe3rydJsrdkAhPNo/phE177RsmpF5U1VbyN1S+Wz5jEjT+avox14BHmFSIz1/LbfA0\n\tQa/LgFtmjKs6anJjOjBIbueZcS+YxGqXuluCuBnAYrz+tBvMytkM2OMrH0mHMbceccfT\n\ttntMi6RyYD8v0iyqqYfmwuBepleUkpEiMZbFEkezVxuOgn0nXZg5knfm/5X+y2TBqPak\n\tN/XpaQu7t7dCmDE1FQqcz39RejVS0qigPWdK1Fyu1ee+D83AtbwLEMB3Y61cfMXOP75+\n\tsVRA==","X-Gm-Message-State":"AOAM532E/r2sijBwrkJswEedE2YgaSi7tVCDAuRwKx2B7habsKNgD9gK\n\t6azQjUMFRLl/hEqboLY1wucSZloBlaNIyBihf+ZJmQ==","X-Google-Smtp-Source":"ABdhPJw5axaIVClgaGy4LIscoFkEl0RiN8+5YJWVqnvAmaBDOpDgvXxQKtBqBdXM4HUH+h3hbZS1Lo7SbS24qtu/S3o=","X-Received":"by 2002:a05:6830:18ee:: with SMTP id\n\td14mr4104973otf.317.1607100925482; \n\tFri, 04 Dec 2020 08:55:25 -0800 (PST)","MIME-Version":"1.0","References":"<20201202115253.14705-1-david.plowman@raspberrypi.com>\n\t<20201202115253.14705-6-david.plowman@raspberrypi.com>\n\t<CAEmqJPrd3iGMVzoOQGuH1d9BffKgyy75q6hHsFxw88nrn5M2ng@mail.gmail.com>","In-Reply-To":"<CAEmqJPrd3iGMVzoOQGuH1d9BffKgyy75q6hHsFxw88nrn5M2ng@mail.gmail.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Fri, 4 Dec 2020 16:55:14 +0000","Message-ID":"<CAHW6GYLpNZ7w0p0Gx_PpMBWtar+oJcbDkuSO0Xp3P=7cUqD5Jw@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 5/5] src: ipa: raspberrypi: Drop the\n\tcorrect number of frames on startup for ov5647","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]