[{"id":13968,"web_url":"https://patchwork.libcamera.org/comment/13968/","msgid":"<925c1d81-e726-c29e-7236-c5175d32e33c@ideasonboard.com>","date":"2020-11-30T10:47:07","subject":"Re: [libcamera-devel] [PATCH v2 4/4] src: ipa: raspberrypi: Fix\n\tinitial AGC oscillation for imx219 sensor","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi David,\n\nOn 26/11/2020 12:32, David Plowman wrote:\n> The exposure times in the exposure modes were causing AGC oscillations\n> because the algorithm was demanding long unachievable exposure times\n> but, without working sensor metadata, thought it was getting them when\n> actually it was not. We fix it by making the exposure profile request\n> only achievable exposure times, as we do for the ov5647 tuning.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/raspberrypi/data/imx219.json | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/ipa/raspberrypi/data/imx219.json b/src/ipa/raspberrypi/data/imx219.json\n> index b03a7beb..212f8b9a 100644\n> --- a/src/ipa/raspberrypi/data/imx219.json\n> +++ b/src/ipa/raspberrypi/data/imx219.json\n> @@ -133,7 +133,7 @@\n>              {\n>                  \"shutter\":\n>                  [\n> -                    100, 10000, 30000, 60000, 120000\n> +                    100, 10000, 30000, 30000, 30000\n\nGiven the existing repetition, I assume an extra 30000 isn't an issue,\nand it looks like this is just setting the shutter time on the modes array.\n\nI also see shutter values of 120000 on the imx477, and in 'uncalibrated'.\n\nI am going to wildly presume the imx477 is a better sensor, so it's more\nappropriate there, or simply hasn't been considered yet (which isn't a\nproblem as this patch directly addresses the imx219).\n\nI'm also curious about the high value in uncalibrated though. Should it\nstay high, and as it's uncalibrated, it doesn't matter, as it's up to\nthe user to define and calibrate specific sensors?\n\nI assume yes and those are only discussions so:\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>                  ],\n>                  \"gain\":\n>                  [\n> @@ -144,7 +144,7 @@\n>              {\n>                  \"shutter\":\n>                  [\n> -                    100, 5000, 10000, 20000, 120000\n> +                    100, 5000, 10000, 20000, 30000\n>                  ],\n>                  \"gain\":\n>                  [\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 97C72BE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 30 Nov 2020 10:47:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BCAF163497;\n\tMon, 30 Nov 2020 11:47:12 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3667B6346B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Nov 2020 11:47:11 +0100 (CET)","from [192.168.0.217]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B2753B26;\n\tMon, 30 Nov 2020 11:47:10 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"nuoBoHrN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1606733230;\n\tbh=f4Dipr0dK6B9M1z6HvTFPRVJbGtzxcMjTkCQ+tYbGD0=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=nuoBoHrNzdjux/GArrWa4gf5BYnP7EC/bVkJWne15PmlWgvNa221MzC+PyEV9k9O1\n\tEq27zpBdWf/K4g8e86RR8ZaGdmPk8MWa/Wj1274eLQ1oy80jCfctBLoUSNOsgkmsTN\n\tfJy1fpKIYlMYClaEVbcrWPUrmftxp9tMOZ7n/XTY=","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20201126123203.19105-1-david.plowman@raspberrypi.com>\n\t<20201126123203.19105-5-david.plowman@raspberrypi.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ\n\tcSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf\n\tKr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/OBd+8Ptgt1pDRyOBzL8\n\tRXa8ZqRf0Mwg75D+dKntZeJHzPRJyrlfQokngAAs4PaFt6UfS+ypMAF37T6CeDArQC41V3ko\n\tlPn1yMsVD0p+6i3DPvA/GPIksDC4owjnzVX9kM8Zc5Cx+XoAN0w5Eqo4t6qEVbuettxx55gq\n\t8K8FieAjgjMSxngo/HST8TpFeqI5nVeq0/lqtBRQKumuIqDg+Bkr4L1V/PSB6XgQcOdh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54qdxrVDaK+6jIAuo8JiRWctP16KjzUM7MO0/+4zllM8EY57rXrj48j\n\tsbEYX0YQnzaj+jO6kJtoZsIaYR7rMMq9aUAjyiaEZpmP1qF/2sYenDx0Fg2BSlLvLvXM0vU8\n\tpQk3kgDu7kb/7PRYrZvBsr21EIQoIjXbZxDz/o7z95frkP71EaICttZ6k9q5oxxA5WC6sTXc\n\tMW8zs8avFNuA9VpXt0YupJd2ijtZy2mpZNG02fFVXhIn4G807G7+9mhuC4XG5rKlBBUXTvPU\n\tAfYnB4JBDLmLzBFavQfvonSfbitgXwCG3vS+9HEwAjU30Bar1PEOmIbiAoMzuKeRm2LVpmq4\n\tWZw01QYHU/GUV/zHJSFk","Organization":"Ideas on Board","Message-ID":"<925c1d81-e726-c29e-7236-c5175d32e33c@ideasonboard.com>","Date":"Mon, 30 Nov 2020 10:47:07 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101\n\tThunderbird/68.10.0","MIME-Version":"1.0","In-Reply-To":"<20201126123203.19105-5-david.plowman@raspberrypi.com>","Content-Language":"en-GB","Subject":"Re: [libcamera-devel] [PATCH v2 4/4] src: ipa: raspberrypi: Fix\n\tinitial AGC oscillation for imx219 sensor","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>","Reply-To":"kieran.bingham@ideasonboard.com","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>"}},{"id":13974,"web_url":"https://patchwork.libcamera.org/comment/13974/","msgid":"<CAHW6GYLCVtf8wkpxPe4Yk08A-=8z2GcqG6g5P5LphgtSgjf43g@mail.gmail.com>","date":"2020-11-30T11:15:37","subject":"Re: [libcamera-devel] [PATCH v2 4/4] src: ipa: raspberrypi: Fix\n\tinitial AGC oscillation for imx219 sensor","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Kieran\n\nJust to answer briefly... yes there is stuff that needs addressing\nthere, but that's coming in Naush's next patch set (after\nCamera::start).\n\nThere are currently some problems when the AGC/AEC requests exposure\ntimes (or analogue gains) that the sensor can't deliver. If a sensor\nreports the metadata correctly (like imx477) things still work OK,\nbecause the AGC/AEC isn't being lied to. So you can ask for long\nexposures and if you get them - great, if not - it manages without.\n\nOur other sensors (ov5647 and imx219) aren't reporting metadata\ncorrectly. For these, we end up assuming the sensor gives us what we\nasked for, and if it didn't, the AGC gets lied to. This tends to cause\noscillations.\n\nFor now, we can prevent the oscillations by not asking for anything\nthat's unachievable (hence this particular patch). But it's not the\nideal solution - Naush's next patch set addresses all this!\n\nBest regards\nDavid\n\nOn Mon, 30 Nov 2020 at 10:47, Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Hi David,\n>\n> On 26/11/2020 12:32, David Plowman wrote:\n> > The exposure times in the exposure modes were causing AGC oscillations\n> > because the algorithm was demanding long unachievable exposure times\n> > but, without working sensor metadata, thought it was getting them when\n> > actually it was not. We fix it by making the exposure profile request\n> > only achievable exposure times, as we do for the ov5647 tuning.\n> >\n> > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  src/ipa/raspberrypi/data/imx219.json | 4 ++--\n> >  1 file changed, 2 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/src/ipa/raspberrypi/data/imx219.json b/src/ipa/raspberrypi/data/imx219.json\n> > index b03a7beb..212f8b9a 100644\n> > --- a/src/ipa/raspberrypi/data/imx219.json\n> > +++ b/src/ipa/raspberrypi/data/imx219.json\n> > @@ -133,7 +133,7 @@\n> >              {\n> >                  \"shutter\":\n> >                  [\n> > -                    100, 10000, 30000, 60000, 120000\n> > +                    100, 10000, 30000, 30000, 30000\n>\n> Given the existing repetition, I assume an extra 30000 isn't an issue,\n> and it looks like this is just setting the shutter time on the modes array.\n>\n> I also see shutter values of 120000 on the imx477, and in 'uncalibrated'.\n>\n> I am going to wildly presume the imx477 is a better sensor, so it's more\n> appropriate there, or simply hasn't been considered yet (which isn't a\n> problem as this patch directly addresses the imx219).\n>\n> I'm also curious about the high value in uncalibrated though. Should it\n> stay high, and as it's uncalibrated, it doesn't matter, as it's up to\n> the user to define and calibrate specific sensors?\n>\n> I assume yes and those are only discussions so:\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n> >                  ],\n> >                  \"gain\":\n> >                  [\n> > @@ -144,7 +144,7 @@\n> >              {\n> >                  \"shutter\":\n> >                  [\n> > -                    100, 5000, 10000, 20000, 120000\n> > +                    100, 5000, 10000, 20000, 30000\n> >                  ],\n> >                  \"gain\":\n> >                  [\n> >\n>\n> --\n> Regards\n> --\n> Kieran","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 64915BE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 30 Nov 2020 11:15:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EB743634A0;\n\tMon, 30 Nov 2020 12:15:51 +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 743BF63320\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Nov 2020 12:15:50 +0100 (CET)","by mail-ot1-x343.google.com with SMTP id f48so2392901otf.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Nov 2020 03:15:50 -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=\"suhiMOf+\"; 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=Fmpjg3hlKiNQAcpCxoD5kyGKPooWXOf4E3cvAcNV8sU=;\n\tb=suhiMOf+r9BVCjTcHGxtVWIfdvX6m/xggsBXWtMNnxZijUXeDVuMNtAjpVDqrJZYGt\n\tBntotAGwwhm7jpJaXE2QyY1VrQ35zZUWMDxWhGv8yt5EpJiIzwE3rqsTYBmoNXey/crq\n\tfN3bKpyN9QY6R6v3/Eh5OJ/vkLUd4lvbPZhOhE+xzLptPmUxlxLdSeB8B95+D3boLDn2\n\tLgNHDlX6Ai13E2bbo7wkmBuVD785eEwDQQk/iPzyBTfZh9XIfnFUuaM2VgxxvZHC7rjH\n\t/reNvyBlje2AJTWUqFqoDLEbUn/jfIs/EwbcNoppQNL1ZeQUUCqrD8nOBokrTTNMtpxW\n\tBMIQ==","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=Fmpjg3hlKiNQAcpCxoD5kyGKPooWXOf4E3cvAcNV8sU=;\n\tb=EVigYALXurwScJm21tmNvuSHl1dzJB+n+xGsxVPM83Zy/qxk1zEkaWVWUtzoU9CDr/\n\t6YkP7gnBnKE8jU0Uw3WhaefAz3DepOYow8g4k0PK+LfiO5u57KXjiYGjZEDQ6pRAie5h\n\tN8MOlhsY9rf+YFZhs9MomsnRbnmqUJwMc+hKbhV7mjfcmg5HWO36ogeL1Xy/9xCLFG5+\n\twJq05ySE4uoDCeMvEqN93Tsc7Y0amZIhVX+/UGdhafKOTABtMN/iCISFppcOSprFUOGn\n\tJbreDBzwZeSP+LZuj+P/vSPR7VXQffz7ykrR4OqnKOcn41kf7a3Gxve18rUxQ2G+zzwr\n\trmZQ==","X-Gm-Message-State":"AOAM533DVHKh/NWeyvy5R2qj/zOn79kiqrdr0lvADRFK6F/mANg5939P\n\tlsY33c1vLRPXpy6iHsTlCNgsG59rkKbMTCPqmIc+Kg==","X-Google-Smtp-Source":"ABdhPJyRwOoKQ5x9aVPAbve/PeDdV2mSI5KCsWWytzoCw4vupBNCvpwbEmRBwrs12Ps+5SgL9cWgFCgV8J93vngW6K4=","X-Received":"by 2002:a05:6830:18ee:: with SMTP id\n\td14mr15746694otf.317.1606734949090; \n\tMon, 30 Nov 2020 03:15:49 -0800 (PST)","MIME-Version":"1.0","References":"<20201126123203.19105-1-david.plowman@raspberrypi.com>\n\t<20201126123203.19105-5-david.plowman@raspberrypi.com>\n\t<925c1d81-e726-c29e-7236-c5175d32e33c@ideasonboard.com>","In-Reply-To":"<925c1d81-e726-c29e-7236-c5175d32e33c@ideasonboard.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Mon, 30 Nov 2020 11:15:37 +0000","Message-ID":"<CAHW6GYLCVtf8wkpxPe4Yk08A-=8z2GcqG6g5P5LphgtSgjf43g@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 4/4] src: ipa: raspberrypi: Fix\n\tinitial AGC oscillation for imx219 sensor","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>"}},{"id":13975,"web_url":"https://patchwork.libcamera.org/comment/13975/","msgid":"<8e217f0c-e0ac-6d8d-4c10-4c93296e57d2@ideasonboard.com>","date":"2020-11-30T11:35:09","subject":"Re: [libcamera-devel] [PATCH v2 4/4] src: ipa: raspberrypi: Fix\n\tinitial AGC oscillation for imx219 sensor","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi David,\n\nOn 30/11/2020 11:15, David Plowman wrote:\n> Hi Kieran\n> \n> Just to answer briefly... yes there is stuff that needs addressing\n> there, but that's coming in Naush's next patch set (after\n> Camera::start).\n\nOk, no problem, understood - and I don't think this series is blocked.\n\n> There are currently some problems when the AGC/AEC requests exposure\n> times (or analogue gains) that the sensor can't deliver. If a sensor\n> reports the metadata correctly (like imx477) things still work OK,\n> because the AGC/AEC isn't being lied to. So you can ask for long\n> exposures and if you get them - great, if not - it manages without.\n> \n> Our other sensors (ov5647 and imx219) aren't reporting metadata\n> correctly. For these, we end up assuming the sensor gives us what we\n> asked for, and if it didn't, the AGC gets lied to. This tends to cause\n> oscillations.\n> \n> For now, we can prevent the oscillations by not asking for anything\n> that's unachievable (hence this particular patch). But it's not the\n> ideal solution - Naush's next patch set addresses all this!\n\nThanks, I'll chase up where we are with start() again.\nI hope everyone has had enough time to mull things over on that by now.\n\n--\nKieran\n\n> Best regards\n> David\n> \n> On Mon, 30 Nov 2020 at 10:47, Kieran Bingham\n> <kieran.bingham@ideasonboard.com> wrote:\n>>\n>> Hi David,\n>>\n>> On 26/11/2020 12:32, David Plowman wrote:\n>>> The exposure times in the exposure modes were causing AGC oscillations\n>>> because the algorithm was demanding long unachievable exposure times\n>>> but, without working sensor metadata, thought it was getting them when\n>>> actually it was not. We fix it by making the exposure profile request\n>>> only achievable exposure times, as we do for the ov5647 tuning.\n>>>\n>>> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n>>> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n>>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>>> ---\n>>>  src/ipa/raspberrypi/data/imx219.json | 4 ++--\n>>>  1 file changed, 2 insertions(+), 2 deletions(-)\n>>>\n>>> diff --git a/src/ipa/raspberrypi/data/imx219.json b/src/ipa/raspberrypi/data/imx219.json\n>>> index b03a7beb..212f8b9a 100644\n>>> --- a/src/ipa/raspberrypi/data/imx219.json\n>>> +++ b/src/ipa/raspberrypi/data/imx219.json\n>>> @@ -133,7 +133,7 @@\n>>>              {\n>>>                  \"shutter\":\n>>>                  [\n>>> -                    100, 10000, 30000, 60000, 120000\n>>> +                    100, 10000, 30000, 30000, 30000\n>>\n>> Given the existing repetition, I assume an extra 30000 isn't an issue,\n>> and it looks like this is just setting the shutter time on the modes array.\n>>\n>> I also see shutter values of 120000 on the imx477, and in 'uncalibrated'.\n>>\n>> I am going to wildly presume the imx477 is a better sensor, so it's more\n>> appropriate there, or simply hasn't been considered yet (which isn't a\n>> problem as this patch directly addresses the imx219).\n>>\n>> I'm also curious about the high value in uncalibrated though. Should it\n>> stay high, and as it's uncalibrated, it doesn't matter, as it's up to\n>> the user to define and calibrate specific sensors?\n>>\n>> I assume yes and those are only discussions so:\n>>\n>> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>>\n>>>                  ],\n>>>                  \"gain\":\n>>>                  [\n>>> @@ -144,7 +144,7 @@\n>>>              {\n>>>                  \"shutter\":\n>>>                  [\n>>> -                    100, 5000, 10000, 20000, 120000\n>>> +                    100, 5000, 10000, 20000, 30000\n>>>                  ],\n>>>                  \"gain\":\n>>>                  [\n>>>\n>>\n>> --\n>> Regards\n>> --\n>> Kieran","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 9C460BE177\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 30 Nov 2020 11:35:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 29748634A1;\n\tMon, 30 Nov 2020 12:35:13 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C953763320\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Nov 2020 12:35:11 +0100 (CET)","from [192.168.0.217]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 38B2AB26;\n\tMon, 30 Nov 2020 12:35:11 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ExCZ/aFQ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1606736111;\n\tbh=6ULGSQMNUp5jbTXJikRCID8CkLDuKntzeVe2ZleJpz0=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=ExCZ/aFQjx64h3LC4IRSVWQmVGiyHieCZ/kAQyRLOwHwGd9PxLq/nb3Xs55XTyXpo\n\tQsvhqZBRS2u/OJXnsFNI8jVJapVnOL6aaZMIzzXx1SavfiGLFDWhZ3ta7Z2za8tv8V\n\t75U+OrPNJQ1qCkD0yZB3JN1ILJmZ+/vPFeD/Epd0=","To":"David Plowman <david.plowman@raspberrypi.com>","References":"<20201126123203.19105-1-david.plowman@raspberrypi.com>\n\t<20201126123203.19105-5-david.plowman@raspberrypi.com>\n\t<925c1d81-e726-c29e-7236-c5175d32e33c@ideasonboard.com>\n\t<CAHW6GYLCVtf8wkpxPe4Yk08A-=8z2GcqG6g5P5LphgtSgjf43g@mail.gmail.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ\n\tcSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf\n\tKr2EAbc6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lSaBPclcPGYrTwCt0YWPU2TgGgJrVhYT20ierN8LUvj\n\t6qOPTd+Uk7NFzL65qkh80ZKNBFddx1AabQpSVQKbdcLb8OFs85kuSvFdgqZwgxA1vl4TFhNz\n\tPZ79NAmXLackAx3sOVFhk4WQaKRshCB7cSl+RIng5S/ThOBlwNlcKG7j7W2MC06BlTbdEkUp\n\tECzuuRBv8wX4OQl+hbWbB/VKIx5HKlLu1eypen/5lNVzSqMMIYkkZcjV2SWQyUGxSwq0O/sx\n\tS0A8/atCHUXOboUsn54qdxrVDaK+6jIAuo8JiRWctP16KjzUM7MO0/+4zllM8EY57rXrj48j\n\tsbEYX0YQnzaj+jO6kJtoZsIaYR7rMMq9aUAjyiaEZpmP1qF/2sYenDx0Fg2BSlLvLvXM0vU8\n\tpQk3kgDu7kb/7PRYrZvBsr21EIQoIjXbZxDz/o7z95frkP71EaICttZ6k9q5oxxA5WC6sTXc\n\tMW8zs8avFNuA9VpXt0YupJd2ijtZy2mpZNG02fFVXhIn4G807G7+9mhuC4XG5rKlBBUXTvPU\n\tAfYnB4JBDLmLzBFavQfvonSfbitgXwCG3vS+9HEwAjU30Bar1PEOmIbiAoMzuKeRm2LVpmq4\n\tWZw01QYHU/GUV/zHJSFk","Organization":"Ideas on Board","Message-ID":"<8e217f0c-e0ac-6d8d-4c10-4c93296e57d2@ideasonboard.com>","Date":"Mon, 30 Nov 2020 11:35:09 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101\n\tThunderbird/68.10.0","MIME-Version":"1.0","In-Reply-To":"<CAHW6GYLCVtf8wkpxPe4Yk08A-=8z2GcqG6g5P5LphgtSgjf43g@mail.gmail.com>","Content-Language":"en-GB","Subject":"Re: [libcamera-devel] [PATCH v2 4/4] src: ipa: raspberrypi: Fix\n\tinitial AGC oscillation for imx219 sensor","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>","Reply-To":"kieran.bingham@ideasonboard.com","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>"}}]