[{"id":27807,"web_url":"https://patchwork.libcamera.org/comment/27807/","msgid":"<CAEmqJPp4875-e+rhmf9nKfoYrqS7BYRvrSoSqsGcNzCy2dMjng@mail.gmail.com>","date":"2023-09-18T07:53:57","subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","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 this work.\n\nOn Tue, 12 Sept 2023 at 15:23, David Plowman via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> The IqUnstable metadata can be used by IPAs to indicate to an\n> application that they have not settled sufficiently to produce\n> reliable image quality. Applications would be advised to avoid using\n> frames flagged in this way.\n>\n> One example would be when the camera starts, when the AEC/AGC might\n> oscillate for a few frames.\n>\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n\nI do like this term better than the more generic startup frames we used before.\nFYI, I have implemented this control in the RPi pipeline handler that\nfolks can peek at here:\nhttps://github.com/naushir/libcamera/tree/iq_stability\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n> ---\n>  src/libcamera/control_ids.yaml | 20 ++++++++++++++++++++\n>  1 file changed, 20 insertions(+)\n>\n> diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\n> index f2e542f4..b96e1272 100644\n> --- a/src/libcamera/control_ids.yaml\n> +++ b/src/libcamera/control_ids.yaml\n> @@ -774,6 +774,26 @@ controls:\n>              Continuous AF is paused. No further state changes or lens movements\n>              will occur until the AfPauseResume control is sent.\n>\n> +  - IqUnstable:\n> +      type: bool\n> +      description: |\n> +        The value true indicates that the camera algorithms have not settled\n> +        sufficiently to generate images of reliable quality. The application\n> +        receiving this frame is advised to drop it and wait for a frame where\n> +        this metadata reports false (or is absent).\n> +\n> +        One example of this would be when the camera system starts. It may be\n> +        trying to adapt very quickly to the ambient conditions, resulting in a\n> +        few frames where the image brightness may be subject to unusually\n> +        extreme oscillations.\n> +\n> +        The control may report true at other times, for example when an HDR mode\n> +        is enabled. Here too there may be a few frames of unpredictable exposure\n> +        until the algorithms have settled.\n> +\n> +        The value false (or absence of the control) indicates that this is a\n> +        normal frame.\n> +\n>    # ----------------------------------------------------------------------------\n>    # Draft controls section\n>\n> --\n> 2.30.2\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 83442C326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 18 Sep 2023 07:54:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D84B66293B;\n\tMon, 18 Sep 2023 09:54:35 +0200 (CEST)","from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com\n\t[IPv6:2607:f8b0:4864:20::112c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5C7DB61DEC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Sep 2023 09:54:34 +0200 (CEST)","by mail-yw1-x112c.google.com with SMTP id\n\t00721157ae682-59c0d002081so25930267b3.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Sep 2023 00:54:34 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1695023675;\n\tbh=5T7iHENug3o5Bjodr9cG7lUjfGLxJlttXOBFcsKl+D0=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=ENzojMRkWDroSc889bdjSxnwhwfCinHk7mnUY2ZWbJH8YmWSEfXsKkZDl5o/r/vTA\n\t46EYvUziQzEYco2oHKxfCSyrFBjLZlq9vRs+rjhr7dVy7HTNm6f01Rd6JaaGE2RVFF\n\tL3l0F4NbVL5UgGH9ckPMjRAZtDO5LZPn/vFz7k1lEA26DyQzFW+FhYAvRJ+y2MOvc3\n\tNxFDm3qExS5nyGYXL49J6Xv/sEPtqDJ47CuuGUmo5oAQDehqt9YjVuS3b5j/iC8fXA\n\t9NHyiRet1P6Vz+SRUR2gEiscwS936vJ2CUiewo4wZOzUih8UW1gddgfTDNsvhEQXUF\n\tBedCbf4o8ZvSA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1695023673; x=1695628473;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=CyxCUHCr2OaMVslhdizqIHyq9sX24iXNDlebtq2A+zo=;\n\tb=g7Bn4wF+xCHnhVK5KTB5RA7JbaOP91XiP6Vn6BsIgbMXiXOZuQwz5LHt3CAcaIWXRr\n\tOCjdPXbcsk0xQpXXNJQEx8LE3xep7orE0KyeG9JU46KAr9z8iCD/ILIys6bB8jUyM5BB\n\tarTfvIxBnESaLNKzILkthD0OYV2zikHbMBWBKBsWG6rzdcyaR0LjGZsCPRQbQSKhKfb5\n\tF5/IIoxPhLfqOKHSkMTNlDk/+3noju9oHTSBUF5TXPxJb9tmp/ix8k8DX1ltprGvlAxJ\n\t0lUgJfOYILvsN14OAFkjQuRkiSmXBEnGIf8n8W0d0aMASeBvP3iDbIqIcXbPkbuaugVM\n\t08FA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"g7Bn4wF+\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1695023673; x=1695628473;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=CyxCUHCr2OaMVslhdizqIHyq9sX24iXNDlebtq2A+zo=;\n\tb=cdyVmhyKfD7Q6QzNJrBnykNdvmcn8o6gaffBZ5cz2vm4ZaaWrbxDJlPs0+3VMwAgPo\n\tjgLM+sQbBVrhoOaKP9jfM4NCKsP/ZTObaeeiVZNmIjpwCPs3HNrRst6f4eOsNkJfYl69\n\th9D8iRNiZ91Zp8g0N3HiRnr+jnjBOqtEuiXz0w6Wh6Qp0/PeHj6vt3yFAukIDPcLNZUQ\n\tEk1RK/e2pq9GCoRUQEP1YTHzOLRLMzmf/1LlSQw3emqQ1NxEwsQgwWuFsYw8rqkvFq9c\n\trVc6C/UmAU5gwL7LW47mq6YWYTifZ+T8LSt1yhy2K3U6uZyNL9TRjOYJN29Xvn5kQb3e\n\tPd6Q==","X-Gm-Message-State":"AOJu0Yx65y+dDsGjZUjlwjH5lq2fVHjNL9cxmuIeLDhR3rOjs7Vki1rx\n\tr/2aU2RNe6xIL544GSJcl10RDHRCiSY7sIffu2MOCw==","X-Google-Smtp-Source":"AGHT+IHWB3HeUdaXU2FbwA49eR0pC3cJzndkiiL49Koa44uKuLgiVzMR7reYYJfNKOVOyjZa2mxQRpKTc6mgxF537aI=","X-Received":"by 2002:a0d:c806:0:b0:595:9770:6914 with SMTP id\n\tk6-20020a0dc806000000b0059597706914mr9227427ywd.35.1695023672981;\n\tMon, 18 Sep 2023 00:54:32 -0700 (PDT)","MIME-Version":"1.0","References":"<20230912142309.170720-1-david.plowman@raspberrypi.com>\n\t<20230912142309.170720-2-david.plowman@raspberrypi.com>","In-Reply-To":"<20230912142309.170720-2-david.plowman@raspberrypi.com>","Date":"Mon, 18 Sep 2023 08:53:57 +0100","Message-ID":"<CAEmqJPp4875-e+rhmf9nKfoYrqS7BYRvrSoSqsGcNzCy2dMjng@mail.gmail.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27931,"web_url":"https://patchwork.libcamera.org/comment/27931/","msgid":"<169702202730.3973464.16764169615163706869@ping.linuxembedded.co.uk>","date":"2023-10-11T11:00:27","subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck via libcamera-devel (2023-09-18 08:53:57)\n> Hi David,\n> \n> Thank you for this work.\n> \n> On Tue, 12 Sept 2023 at 15:23, David Plowman via libcamera-devel\n> <libcamera-devel@lists.libcamera.org> wrote:\n> >\n> > The IqUnstable metadata can be used by IPAs to indicate to an\n> > application that they have not settled sufficiently to produce\n> > reliable image quality. Applications would be advised to avoid using\n> > frames flagged in this way.\n> >\n> > One example would be when the camera starts, when the AEC/AGC might\n> > oscillate for a few frames.\n> >\n> > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> \n> I do like this term better than the more generic startup frames we used before.\n> FYI, I have implemented this control in the RPi pipeline handler that\n> folks can peek at here:\n> https://github.com/naushir/libcamera/tree/iq_stability\n> \n> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> \n> > ---\n> >  src/libcamera/control_ids.yaml | 20 ++++++++++++++++++++\n> >  1 file changed, 20 insertions(+)\n> >\n> > diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\n> > index f2e542f4..b96e1272 100644\n> > --- a/src/libcamera/control_ids.yaml\n> > +++ b/src/libcamera/control_ids.yaml\n> > @@ -774,6 +774,26 @@ controls:\n> >              Continuous AF is paused. No further state changes or lens movements\n> >              will occur until the AfPauseResume control is sent.\n> >\n> > +  - IqUnstable:\n> > +      type: bool\n> > +      description: |\n> > +        The value true indicates that the camera algorithms have not settled\n> > +        sufficiently to generate images of reliable quality. The application\n> > +        receiving this frame is advised to drop it and wait for a frame where\n> > +        this metadata reports false (or is absent).\n> > +\n> > +        One example of this would be when the camera system starts. It may be\n> > +        trying to adapt very quickly to the ambient conditions, resulting in a\n> > +        few frames where the image brightness may be subject to unusually\n> > +        extreme oscillations.\n> > +\n> > +        The control may report true at other times, for example when an HDR mode\n> > +        is enabled. Here too there may be a few frames of unpredictable exposure\n> > +        until the algorithms have settled.\n> > +\n> > +        The value false (or absence of the control) indicates that this is a\n> > +        normal frame.\n> > +\n\nIt sounds like this is a flag that tells the application to look at\nother aspects too. (Or just ignore or drop the frame).\n\nI.e. the setting of this IqUnstable flag might be because any of the\nAWB/AEGC/AF/HDR state machines are not reporting a converged state.\n\nDo the controls for those algorithms already have a way to report their\nstate? \n\nI do think a global 'this flag means you need to check things' could\nmake sense in this instance, but I'm keen to clarify the relationship of\nwhat an application should do here.\n\nIt also feels like this could be set 'automatically' by a common layer\nthat processes metadata before it gets back to the application and would\nset it for all pipeline handlers if one of AWB/AEGC/AF/HDR reports an\nincorrect state?\n\n\n\n> >    # ----------------------------------------------------------------------------\n> >    # Draft controls section\n> >\n> > --\n> > 2.30.2\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 CE729BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Oct 2023 11:00:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2ECA662964;\n\tWed, 11 Oct 2023 13:00:32 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6CD7161DDA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Oct 2023 13:00:30 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D1F3547C;\n\tWed, 11 Oct 2023 13:00:27 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697022032;\n\tbh=Nqi62nZDWN2fc/L0snv6A7DIs51TLRaaXz4BnpZBn/k=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=CaCZ9TXwwxbWMv0IrlpH8ARKNn0WyPN7MNVAg+QYkD90F3/cARkTQy5MAS5nPH8RM\n\tLOUzL5IIe7iht+85Q4AqhDa+nq/puvQp7Ajr12t4WX4gohg7GMypTLGFd+0a77/Ahm\n\tRk/EwX9nPXfI8vr18rb7Fky7iEhphZqivMUlUvjf12FL8EhmWvR/b4Bf0yhKC7ewVF\n\tC9zoySbHt2uw2IGpUl/a0p5W00ZneSYthq89AHpQGuY0wp9tOZ+UeIGv+kIwgHHciA\n\tofqUsTzMFEElLJCJyuUXRzRKg69BMCl6X8KLvjhd8H6gfttd7WxQ9i55zg5DgvEFWX\n\tiOKy1KrnxRJoA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1697022027;\n\tbh=Nqi62nZDWN2fc/L0snv6A7DIs51TLRaaXz4BnpZBn/k=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=deOROn+wl0z6GBbOC85EfRjsLRfO5tbaY6l2rnIDWyctZZLU7OpX0LOPCBqibIfnB\n\tec+narTPuk+Q05OThCzo+cPSY/+1EMfMbe3MXd8FI9JFfdL34RzJwzj/ZGJFZJSMdz\n\tfQJc9SVMpXlrjWDo3mLEeW4FRXEqBIDdikWpuHqU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"deOROn+w\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<CAEmqJPp4875-e+rhmf9nKfoYrqS7BYRvrSoSqsGcNzCy2dMjng@mail.gmail.com>","References":"<20230912142309.170720-1-david.plowman@raspberrypi.com>\n\t<20230912142309.170720-2-david.plowman@raspberrypi.com>\n\t<CAEmqJPp4875-e+rhmf9nKfoYrqS7BYRvrSoSqsGcNzCy2dMjng@mail.gmail.com>","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>,\n\tNaushir Patuck via libcamera-devel <libcamera-devel@lists.libcamera.org>","Date":"Wed, 11 Oct 2023 12:00:27 +0100","Message-ID":"<169702202730.3973464.16764169615163706869@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27932,"web_url":"https://patchwork.libcamera.org/comment/27932/","msgid":"<CAEmqJPqaJk-94=FA0R-O9gtqPMMH3_ke=r=uv=nys8Awm1ei3Q@mail.gmail.com>","date":"2023-10-11T11:42:48","subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Kieran,\n\nOn Wed, 11 Oct 2023 at 12:00, Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Quoting Naushir Patuck via libcamera-devel (2023-09-18 08:53:57)\n> > Hi David,\n> >\n> > Thank you for this work.\n> >\n> > On Tue, 12 Sept 2023 at 15:23, David Plowman via libcamera-devel\n> > <libcamera-devel@lists.libcamera.org> wrote:\n> > >\n> > > The IqUnstable metadata can be used by IPAs to indicate to an\n> > > application that they have not settled sufficiently to produce\n> > > reliable image quality. Applications would be advised to avoid using\n> > > frames flagged in this way.\n> > >\n> > > One example would be when the camera starts, when the AEC/AGC might\n> > > oscillate for a few frames.\n> > >\n> > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> >\n> > I do like this term better than the more generic startup frames we used before.\n> > FYI, I have implemented this control in the RPi pipeline handler that\n> > folks can peek at here:\n> > https://github.com/naushir/libcamera/tree/iq_stability\n> >\n> > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> >\n> > > ---\n> > >  src/libcamera/control_ids.yaml | 20 ++++++++++++++++++++\n> > >  1 file changed, 20 insertions(+)\n> > >\n> > > diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\n> > > index f2e542f4..b96e1272 100644\n> > > --- a/src/libcamera/control_ids.yaml\n> > > +++ b/src/libcamera/control_ids.yaml\n> > > @@ -774,6 +774,26 @@ controls:\n> > >              Continuous AF is paused. No further state changes or lens movements\n> > >              will occur until the AfPauseResume control is sent.\n> > >\n> > > +  - IqUnstable:\n> > > +      type: bool\n> > > +      description: |\n> > > +        The value true indicates that the camera algorithms have not settled\n> > > +        sufficiently to generate images of reliable quality. The application\n> > > +        receiving this frame is advised to drop it and wait for a frame where\n> > > +        this metadata reports false (or is absent).\n> > > +\n> > > +        One example of this would be when the camera system starts. It may be\n> > > +        trying to adapt very quickly to the ambient conditions, resulting in a\n> > > +        few frames where the image brightness may be subject to unusually\n> > > +        extreme oscillations.\n> > > +\n> > > +        The control may report true at other times, for example when an HDR mode\n> > > +        is enabled. Here too there may be a few frames of unpredictable exposure\n> > > +        until the algorithms have settled.\n> > > +\n> > > +        The value false (or absence of the control) indicates that this is a\n> > > +        normal frame.\n> > > +\n>\n> It sounds like this is a flag that tells the application to look at\n> other aspects too. (Or just ignore or drop the frame).\n>\n> I.e. the setting of this IqUnstable flag might be because any of the\n> AWB/AEGC/AF/HDR state machines are not reporting a converged state.\n\nI've mentioned this before, but this control is not meant to be used\nfor reporting AWB/AE convergence state.  We have separate controls\n(AeLocked and AwbLocked) for that.  There is a subtle but important\ndistinction between IqStability and the *Locked controls.  The former\ninforms the application that the output frame should not be consumed\nbecause the IQ could be entirely wrong and/or very unstable because\nthe algorithms are in an undetermined state (e.g. on first startup or\na transition from non-hdr to hdr mode).  The latter controls are used\nwhen the algorithms are running in a stable state (i.e. the frames are\nperfectly valid to consume), but the AE/AWB has not reached its final\ntarget due to filtering or a scene change (so, for example, best to\navoid taking a still capture just yet).\n\n>\n> Do the controls for those algorithms already have a way to report their\n> state?\n\nYes, see above.\n\n>\n> I do think a global 'this flag means you need to check things' could\n> make sense in this instance, but I'm keen to clarify the relationship of\n> what an application should do here.\n>\n> It also feels like this could be set 'automatically' by a common layer\n> that processes metadata before it gets back to the application and would\n> set it for all pipeline handlers if one of AWB/AEGC/AF/HDR reports an\n> incorrect state?\n\nGiven my above understanding of what this control is trying to convey\nto the application, it is not related in any way to the other\nalgorithms locked state.  So I don't think we can set this in a common\nlayer based on the state of other controls.\n\nHope that makes sense!\n\nNaush\n\n\n>\n>\n>\n> > >    # ----------------------------------------------------------------------------\n> > >    # Draft controls section\n> > >\n> > > --\n> > > 2.30.2\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 5EED3C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Oct 2023 11:43:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A8FEE62964;\n\tWed, 11 Oct 2023 13:43:19 +0200 (CEST)","from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com\n\t[IPv6:2607:f8b0:4864:20::b35])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 034EB61DDA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Oct 2023 13:43:17 +0200 (CEST)","by mail-yb1-xb35.google.com with SMTP id\n\t3f1490d57ef6-d9a50ac5eabso2310348276.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Oct 2023 04:43:17 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697024599;\n\tbh=CweHLQ9fDR7ATaQm29PFcTWGLp1djrUkAGl09A38rW8=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Qblflm8LSJAIB/V8J0Hxv7/dLiflWk0sPozoq7DNiFgTgEcneIjPqAdTNRnyWUq4f\n\tps4DOXOejrgYpiWQCMvsXiqbVpVOjW9GS21XDzCnBJo1+td2+JvktmZEdZkCn5qB7y\n\tKK5JySMP4HkV9RjoQ3OYLbMjQ8ggCSkH+oGfidZMkkIRZRJPGvhmR/X4iFOZyz4kG1\n\t5NrwL7as93AM5q2nijazDVr9VDYAgSIQ/whkX7KBVLxeCL94ITEZc8maND7cs9TX43\n\twJhHJlt2faOpXm78qicSNjXqcIlaRrMBXs+gJvNdS3YAN8wJf8DDuH0HuHFRJm1pY5\n\t1Rk3ppidxEyxA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1697024596; x=1697629396;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=aES5R3cGLJoIytiKQR+4bGDoHxz3TIRxbT3fo5QjoVA=;\n\tb=DspMGbAucTu68NiBdbctM256ehcQszpn8rxTdSxWSHys7DjeyxDQM6a14EtwlMwLaZ\n\txv5w2kLVfNZbfnv2mJT9gz71HN3HJb684ld4jZuyvchCcV8e5YWp+h12ohnrRzZjxrHx\n\tKsCneAf5t94HVb9ykNPQa8uD6qiNVKBc+5FoaEZTUa7mvU2SyFhQXxKCeJfwiWslKaLW\n\tOpK8vgyUWDye3Uylt+AE/+B8DOfJQSpxVYEfTkzFIYDQat9K1vGG8YJT24sQaXJpkVrI\n\te8b04Dr5s8T3qceNRkNvKHRK530TbX2GE/ps0TRQmcWuK+84zg8RQ0FTxB42ExasazGC\n\t7HDQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"DspMGbAu\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1697024596; x=1697629396;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=aES5R3cGLJoIytiKQR+4bGDoHxz3TIRxbT3fo5QjoVA=;\n\tb=Zno/5qiEiaWeLT5TNR1Gax0+ceHFya/vscIeu3FG05zoRmye2GYZw/+R47e+u9hkY7\n\tKY6DyP3NhXQu5smXBAIoS09OhhADCRi2CAHb4cKXRLtbSM/bOHsru4sn0F7f/1DCmHLQ\n\twUxPoIZnW/EuOpv2zf37dYCAFDzz6Bfx+zML4LwGo3QhNbB4iVkviTfOk4AqWVXFkfNp\n\tb3e5oMsFPgTvgBOGuP3XqeU8Sqko9uTKwz3ZXYvDBMQKEYMDbSlMvrl5KUZxAIvJLm1D\n\tFR7NeCi/8OYF+3/TVW2utbA2l1ee1xTGe6/hdV8yhXoVLDY/5uotsxuwRMOxa9YPTAme\n\t9ZAg==","X-Gm-Message-State":"AOJu0YykTHFXDqclF5IirUO3l4xYWwQeshR8AYJvdEklnE2Qo/0p4VeZ\n\tBPmd8NyoICxmEOpMhgq87f5/dplLImKttdex6QuPSQ==","X-Google-Smtp-Source":"AGHT+IFHAi5jnqGZ2ICdYfPIM756nhlj01mTQSIYAaXM6BPWR7t3791YURNHmAOS71nvQhEoatOJ0OemY7DFDbzu0ww=","X-Received":"by 2002:a25:7302:0:b0:d85:bc17:eba5 with SMTP id\n\to2-20020a257302000000b00d85bc17eba5mr18141567ybc.43.1697024596664;\n\tWed, 11 Oct 2023 04:43:16 -0700 (PDT)","MIME-Version":"1.0","References":"<20230912142309.170720-1-david.plowman@raspberrypi.com>\n\t<20230912142309.170720-2-david.plowman@raspberrypi.com>\n\t<CAEmqJPp4875-e+rhmf9nKfoYrqS7BYRvrSoSqsGcNzCy2dMjng@mail.gmail.com>\n\t<169702202730.3973464.16764169615163706869@ping.linuxembedded.co.uk>","In-Reply-To":"<169702202730.3973464.16764169615163706869@ping.linuxembedded.co.uk>","Date":"Wed, 11 Oct 2023 12:42:48 +0100","Message-ID":"<CAEmqJPqaJk-94=FA0R-O9gtqPMMH3_ke=r=uv=nys8Awm1ei3Q@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Naushir Patuck via libcamera-devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27933,"web_url":"https://patchwork.libcamera.org/comment/27933/","msgid":"<169702572996.3973464.17133331652018970039@ping.linuxembedded.co.uk>","date":"2023-10-11T12:02:09","subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck (2023-10-11 12:42:48)\n> Hi Kieran,\n> \n> On Wed, 11 Oct 2023 at 12:00, Kieran Bingham\n> <kieran.bingham@ideasonboard.com> wrote:\n> >\n> > Quoting Naushir Patuck via libcamera-devel (2023-09-18 08:53:57)\n> > > Hi David,\n> > >\n> > > Thank you for this work.\n> > >\n> > > On Tue, 12 Sept 2023 at 15:23, David Plowman via libcamera-devel\n> > > <libcamera-devel@lists.libcamera.org> wrote:\n> > > >\n> > > > The IqUnstable metadata can be used by IPAs to indicate to an\n> > > > application that they have not settled sufficiently to produce\n> > > > reliable image quality. Applications would be advised to avoid using\n> > > > frames flagged in this way.\n> > > >\n> > > > One example would be when the camera starts, when the AEC/AGC might\n> > > > oscillate for a few frames.\n> > > >\n> > > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > >\n> > > I do like this term better than the more generic startup frames we used before.\n> > > FYI, I have implemented this control in the RPi pipeline handler that\n> > > folks can peek at here:\n> > > https://github.com/naushir/libcamera/tree/iq_stability\n> > >\n> > > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> > >\n> > > > ---\n> > > >  src/libcamera/control_ids.yaml | 20 ++++++++++++++++++++\n> > > >  1 file changed, 20 insertions(+)\n> > > >\n> > > > diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\n> > > > index f2e542f4..b96e1272 100644\n> > > > --- a/src/libcamera/control_ids.yaml\n> > > > +++ b/src/libcamera/control_ids.yaml\n> > > > @@ -774,6 +774,26 @@ controls:\n> > > >              Continuous AF is paused. No further state changes or lens movements\n> > > >              will occur until the AfPauseResume control is sent.\n> > > >\n> > > > +  - IqUnstable:\n> > > > +      type: bool\n> > > > +      description: |\n> > > > +        The value true indicates that the camera algorithms have not settled\n> > > > +        sufficiently to generate images of reliable quality. The application\n> > > > +        receiving this frame is advised to drop it and wait for a frame where\n> > > > +        this metadata reports false (or is absent).\n> > > > +\n> > > > +        One example of this would be when the camera system starts. It may be\n> > > > +        trying to adapt very quickly to the ambient conditions, resulting in a\n> > > > +        few frames where the image brightness may be subject to unusually\n> > > > +        extreme oscillations.\n> > > > +\n> > > > +        The control may report true at other times, for example when an HDR mode\n> > > > +        is enabled. Here too there may be a few frames of unpredictable exposure\n> > > > +        until the algorithms have settled.\n> > > > +\n> > > > +        The value false (or absence of the control) indicates that this is a\n> > > > +        normal frame.\n> > > > +\n> >\n> > It sounds like this is a flag that tells the application to look at\n> > other aspects too. (Or just ignore or drop the frame).\n> >\n> > I.e. the setting of this IqUnstable flag might be because any of the\n> > AWB/AEGC/AF/HDR state machines are not reporting a converged state.\n> \n> I've mentioned this before, but this control is not meant to be used\n> for reporting AWB/AE convergence state.  We have separate controls\n> (AeLocked and AwbLocked) for that.  There is a subtle but important\n\nBut it 'is' reporting *not convergence* state. Therefore the lack of\nthis flag could be implied to mean Iq 'stable' (converged).\n\n\n> distinction between IqStability and the *Locked controls.  The former\n> informs the application that the output frame should not be consumed\n> because the IQ could be entirely wrong and/or very unstable because\n> the algorithms are in an undetermined state (e.g. on first startup or\n> a transition from non-hdr to hdr mode).  The latter controls are used\n> when the algorithms are running in a stable state (i.e. the frames are\n> perfectly valid to consume), but the AE/AWB has not reached its final\n> target due to filtering or a scene change (so, for example, best to\n> avoid taking a still capture just yet).\n\nperhaps it sounds like some of that should be captured in the control\ndocumentation?\n\n\n> \n> >\n> > Do the controls for those algorithms already have a way to report their\n> > state?\n> \n> Yes, see above.\n> \n> >\n> > I do think a global 'this flag means you need to check things' could\n> > make sense in this instance, but I'm keen to clarify the relationship of\n> > what an application should do here.\n> >\n> > It also feels like this could be set 'automatically' by a common layer\n> > that processes metadata before it gets back to the application and would\n> > set it for all pipeline handlers if one of AWB/AEGC/AF/HDR reports an\n> > incorrect state?\n> \n> Given my above understanding of what this control is trying to convey\n> to the application, it is not related in any way to the other\n> algorithms locked state.  So I don't think we can set this in a common\n> layer based on the state of other controls.\n\nI'm still stuck at the logic of:\n\n '(!IqUnstable) == Stable image quality == Converged Algorithms'\n\n> Hope that makes sense!\n> \n> Naush\n> \n> \n> >\n> >\n> >\n> > > >    # ----------------------------------------------------------------------------\n> > > >    # Draft controls section\n> > > >\n> > > > --\n> > > > 2.30.2\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 0ADE3BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Oct 2023 12:02:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 82C0262964;\n\tWed, 11 Oct 2023 14:02:13 +0200 (CEST)","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 5B27261DDA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Oct 2023 14:02:12 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C947836E;\n\tWed, 11 Oct 2023 14:02:09 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697025733;\n\tbh=Z57zarziyysIsjqIP+OvREKvMa2aiLe5/HwP1aqsees=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=wP3tlYvblR5dFz0wH2RDJ5AW692hxC0HySN/plaD+ytA9LN0grWlt/eGkEWy4jzQ6\n\t1+hjQmUFuUjB3JP4l47BvapzTIfKIw8gqDdBEN6uGF6Y1fWjRAW+4xrGr8qcangPje\n\tl/WW1OriEXGJp6KWG7POTAcHaXZHQq6twmMcvm9tpAA1NwHp8MW9KdqLox/JreP83Z\n\tYsKpw7uUzCJsRcJ3z8P5BdIsUmjziBxbaWM/WQx70vS9w0P2n7v7R3HOuIdKSGxC0w\n\tasTKJAnPQ/sRh9nSHZytQZBdW+kah7PqZal+j50mCqL/6QUbReGsT1ELqFm6ECg8PF\n\trtTSG6ZeG8/Lw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1697025729;\n\tbh=Z57zarziyysIsjqIP+OvREKvMa2aiLe5/HwP1aqsees=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=qOBpbm8X3wciTkM0bIAKp+bCmKblSqxCCUVcVk9OMSbi7Fi4IlL9FMn33oCjxu1sK\n\tSpR+p0XOnlQ0vPCWfUDUoTfY2s5/YWVsdZMBY1voKzztoI5RI6iGrF2fzOug1Uz3Q/\n\t6nswXhBw9tlrMC3iIlcX94tBHiWYqVmcQy9ZtXWo="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"qOBpbm8X\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<CAEmqJPqaJk-94=FA0R-O9gtqPMMH3_ke=r=uv=nys8Awm1ei3Q@mail.gmail.com>","References":"<20230912142309.170720-1-david.plowman@raspberrypi.com>\n\t<20230912142309.170720-2-david.plowman@raspberrypi.com>\n\t<CAEmqJPp4875-e+rhmf9nKfoYrqS7BYRvrSoSqsGcNzCy2dMjng@mail.gmail.com>\n\t<169702202730.3973464.16764169615163706869@ping.linuxembedded.co.uk>\n\t<CAEmqJPqaJk-94=FA0R-O9gtqPMMH3_ke=r=uv=nys8Awm1ei3Q@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Date":"Wed, 11 Oct 2023 13:02:09 +0100","Message-ID":"<169702572996.3973464.17133331652018970039@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Naushir Patuck via libcamera-devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27934,"web_url":"https://patchwork.libcamera.org/comment/27934/","msgid":"<CAEmqJPqxznkyaueU4Y0A8vF-+c141nvtBQPSgr_0wcrrjfW2_g@mail.gmail.com>","date":"2023-10-11T12:27:04","subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"On Wed, 11 Oct 2023 at 13:02, Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Quoting Naushir Patuck (2023-10-11 12:42:48)\n> > Hi Kieran,\n> >\n> > On Wed, 11 Oct 2023 at 12:00, Kieran Bingham\n> > <kieran.bingham@ideasonboard.com> wrote:\n> > >\n> > > Quoting Naushir Patuck via libcamera-devel (2023-09-18 08:53:57)\n> > > > Hi David,\n> > > >\n> > > > Thank you for this work.\n> > > >\n> > > > On Tue, 12 Sept 2023 at 15:23, David Plowman via libcamera-devel\n> > > > <libcamera-devel@lists.libcamera.org> wrote:\n> > > > >\n> > > > > The IqUnstable metadata can be used by IPAs to indicate to an\n> > > > > application that they have not settled sufficiently to produce\n> > > > > reliable image quality. Applications would be advised to avoid using\n> > > > > frames flagged in this way.\n> > > > >\n> > > > > One example would be when the camera starts, when the AEC/AGC might\n> > > > > oscillate for a few frames.\n> > > > >\n> > > > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > > >\n> > > > I do like this term better than the more generic startup frames we used before.\n> > > > FYI, I have implemented this control in the RPi pipeline handler that\n> > > > folks can peek at here:\n> > > > https://github.com/naushir/libcamera/tree/iq_stability\n> > > >\n> > > > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> > > >\n> > > > > ---\n> > > > >  src/libcamera/control_ids.yaml | 20 ++++++++++++++++++++\n> > > > >  1 file changed, 20 insertions(+)\n> > > > >\n> > > > > diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\n> > > > > index f2e542f4..b96e1272 100644\n> > > > > --- a/src/libcamera/control_ids.yaml\n> > > > > +++ b/src/libcamera/control_ids.yaml\n> > > > > @@ -774,6 +774,26 @@ controls:\n> > > > >              Continuous AF is paused. No further state changes or lens movements\n> > > > >              will occur until the AfPauseResume control is sent.\n> > > > >\n> > > > > +  - IqUnstable:\n> > > > > +      type: bool\n> > > > > +      description: |\n> > > > > +        The value true indicates that the camera algorithms have not settled\n> > > > > +        sufficiently to generate images of reliable quality. The application\n> > > > > +        receiving this frame is advised to drop it and wait for a frame where\n> > > > > +        this metadata reports false (or is absent).\n> > > > > +\n> > > > > +        One example of this would be when the camera system starts. It may be\n> > > > > +        trying to adapt very quickly to the ambient conditions, resulting in a\n> > > > > +        few frames where the image brightness may be subject to unusually\n> > > > > +        extreme oscillations.\n> > > > > +\n> > > > > +        The control may report true at other times, for example when an HDR mode\n> > > > > +        is enabled. Here too there may be a few frames of unpredictable exposure\n> > > > > +        until the algorithms have settled.\n> > > > > +\n> > > > > +        The value false (or absence of the control) indicates that this is a\n> > > > > +        normal frame.\n> > > > > +\n> > >\n> > > It sounds like this is a flag that tells the application to look at\n> > > other aspects too. (Or just ignore or drop the frame).\n> > >\n> > > I.e. the setting of this IqUnstable flag might be because any of the\n> > > AWB/AEGC/AF/HDR state machines are not reporting a converged state.\n> >\n> > I've mentioned this before, but this control is not meant to be used\n> > for reporting AWB/AE convergence state.  We have separate controls\n> > (AeLocked and AwbLocked) for that.  There is a subtle but important\n>\n> But it 'is' reporting *not convergence* state. Therefore the lack of\n> this flag could be implied to mean Iq 'stable' (converged).\n>\n>\n> > distinction between IqStability and the *Locked controls.  The former\n> > informs the application that the output frame should not be consumed\n> > because the IQ could be entirely wrong and/or very unstable because\n> > the algorithms are in an undetermined state (e.g. on first startup or\n> > a transition from non-hdr to hdr mode).  The latter controls are used\n> > when the algorithms are running in a stable state (i.e. the frames are\n> > perfectly valid to consume), but the AE/AWB has not reached its final\n> > target due to filtering or a scene change (so, for example, best to\n> > avoid taking a still capture just yet).\n>\n> perhaps it sounds like some of that should be captured in the control\n> documentation?\n>\n>\n> >\n> > >\n> > > Do the controls for those algorithms already have a way to report their\n> > > state?\n> >\n> > Yes, see above.\n> >\n> > >\n> > > I do think a global 'this flag means you need to check things' could\n> > > make sense in this instance, but I'm keen to clarify the relationship of\n> > > what an application should do here.\n> > >\n> > > It also feels like this could be set 'automatically' by a common layer\n> > > that processes metadata before it gets back to the application and would\n> > > set it for all pipeline handlers if one of AWB/AEGC/AF/HDR reports an\n> > > incorrect state?\n> >\n> > Given my above understanding of what this control is trying to convey\n> > to the application, it is not related in any way to the other\n> > algorithms locked state.  So I don't think we can set this in a common\n> > layer based on the state of other controls.\n>\n> I'm still stuck at the logic of:\n>\n>  '(!IqUnstable) == Stable image quality == Converged Algorithms'\n\niqunstable != unconverged\n\nYou can have iqunstable == false and converged == true or false.\nBut of course, if iqunstable == true, it implies converged == false\nbased on the definition above.\n\nSo...\n\n'(!IqUnstable) == Stable algorithm state but does not necessarily ==\nConverged Algorithms'\n\nThe full truth table of states is thus as follows:\n\niqunstable | converged | App behaviour\n0          | 0         | Display viewfinder but don't capture JPEG\n0          | 1         | Display viewfinder and capture JPEG\n1          | 0         | Do not use frame at all\n\nThat probably does not clear things up... :)\n\n\n>\n> > Hope that makes sense!\n> >\n> > Naush\n> >\n> >\n> > >\n> > >\n> > >\n> > > > >    # ----------------------------------------------------------------------------\n> > > > >    # Draft controls section\n> > > > >\n> > > > > --\n> > > > > 2.30.2\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 5058EC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Oct 2023 12:27:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C1D4362964;\n\tWed, 11 Oct 2023 14:27:35 +0200 (CEST)","from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com\n\t[IPv6:2607:f8b0:4864:20::b29])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C043661DDA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Oct 2023 14:27:33 +0200 (CEST)","by mail-yb1-xb29.google.com with SMTP id\n\t3f1490d57ef6-d89ba259964so7411445276.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Oct 2023 05:27:33 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697027255;\n\tbh=9JEapp/UswDPpI10ejw1Aa/xkcetwoI4FwMC6zyzHOQ=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Ly5SfaFLX19bMpm802QjxnwmsCL3bltU4AinQs7TfpQAoIm2KJ3xHYgQeSScenHJa\n\tOxjWFXlT9KIlF3FjlYbQjazcLD8t7FApLMXjjM3os/Cy9DkDZn2+cTzDfV4mmxcyEn\n\ttltclu/fPXHrUwd1WukwOZAXALL0XXNlerCod4nmtT+8Ir7fQxGDJjZfX9gECeo7tV\n\tRWsMPJVieami9nwpdBu6mCl9mkEHP5SbPEIkGJoPO2o1lRJGsxxUoGGcbW8g8sG/Ma\n\tV2+ZExychTWVW5qkOm4FDvGuV5rWAI9FQLg2nBnF41TbPnW3PzYpL3K0l3U+oAUAQ5\n\tmZNkRrK8UH8Bg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1697027252; x=1697632052;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=Yy3biCWwhGp/oQ/oI5zW1VnmCb49J00s+ATdZQn28gA=;\n\tb=WpFkzn5JTDrKunAU4qptqgkPwtS7qGZTlFfSbsdv7/f4c77VJktavM/AuaIKDXOEHh\n\tkLcqnxQbJWkOQEFeGkmhNH6/O5+VVH1fK7gIL7G+NAbO5rgqG91sumYlfRfqVcVy8r7S\n\tpY3cxSEJ3neuN6je5EqiO/6lDsdwdC+qhhul4X6v/MjjzOxHMtXk6QSrhSXtpS/odvcc\n\tRqsjU85cmreIel62gi5V/0+etYwf3Jt4Z2dzPOZOe6zYAW+2PMqrkPMKnI0RQv89pjjc\n\tYAGk2f3/5uNXKGoLmC29TSFhiUiQmXH3guX+/XqrAoYDFrBsbEHWyhgNWp8Wv9JDBIRN\n\tmQfA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"WpFkzn5J\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1697027252; x=1697632052;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=Yy3biCWwhGp/oQ/oI5zW1VnmCb49J00s+ATdZQn28gA=;\n\tb=MvIErAy383kIA/NY6PbQW7tUKLB3TXiYTSszJc5ankpPxGHabuplO0J2natMrZ504q\n\tp8NX0BEWvAqHD1GVmW1U3XyF15H1AUPmlgS96Z5kJ7uY3vZVL54IogBxFbAn2u2yAfBn\n\tSKzjm6pgKDtHON09lFoE1EyjdzDHRWUPvcLE/Mwa/8l/ARtA8SF3Fi6d//JvfCGzvTgi\n\tMFRmavlfktHWdkB4FoWN1xy/ddYrkjezP45xGLEQVgJbZgllwvquOHCTTgBsAw6kYbgh\n\tugFBr8PJI3Eh/T0OzUFkWgUhMXI3Me7a978SZ+1l+x1It/8lLJxiZ9uCXvreub7LUDSj\n\tL+6A==","X-Gm-Message-State":"AOJu0Yw2raRUVr7LS3Yl7FY8SU0NsU5YGAfQUsaN1loASv6TUZh47kGm\n\t3JTG0UA6nWOZTHCIk3AJ7KsBlgzdAgDBozisBo7YohwpHgrVM5dAT1AO8Q==","X-Google-Smtp-Source":"AGHT+IET1c15NdDmpQLFXLC08my7M6cM20n14lAIoC+UVyNt8jr2+/IIwp3BntRYQ45SWIE6GxgEBCmo+vp1SoHnu9E=","X-Received":"by 2002:a25:4048:0:b0:d9a:45d7:4eae with SMTP id\n\tn69-20020a254048000000b00d9a45d74eaemr5742842yba.62.1697027252529;\n\tWed, 11 Oct 2023 05:27:32 -0700 (PDT)","MIME-Version":"1.0","References":"<20230912142309.170720-1-david.plowman@raspberrypi.com>\n\t<20230912142309.170720-2-david.plowman@raspberrypi.com>\n\t<CAEmqJPp4875-e+rhmf9nKfoYrqS7BYRvrSoSqsGcNzCy2dMjng@mail.gmail.com>\n\t<169702202730.3973464.16764169615163706869@ping.linuxembedded.co.uk>\n\t<CAEmqJPqaJk-94=FA0R-O9gtqPMMH3_ke=r=uv=nys8Awm1ei3Q@mail.gmail.com>\n\t<169702572996.3973464.17133331652018970039@ping.linuxembedded.co.uk>","In-Reply-To":"<169702572996.3973464.17133331652018970039@ping.linuxembedded.co.uk>","Date":"Wed, 11 Oct 2023 13:27:04 +0100","Message-ID":"<CAEmqJPqxznkyaueU4Y0A8vF-+c141nvtBQPSgr_0wcrrjfW2_g@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Naushir Patuck via libcamera-devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27935,"web_url":"https://patchwork.libcamera.org/comment/27935/","msgid":"<169702873254.2427060.14952264893180192647@ping.linuxembedded.co.uk>","date":"2023-10-11T12:52:12","subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck (2023-10-11 13:27:04)\n> On Wed, 11 Oct 2023 at 13:02, Kieran Bingham\n> <kieran.bingham@ideasonboard.com> wrote:\n> >\n> > Quoting Naushir Patuck (2023-10-11 12:42:48)\n> > > Hi Kieran,\n> > >\n> > > On Wed, 11 Oct 2023 at 12:00, Kieran Bingham\n> > > <kieran.bingham@ideasonboard.com> wrote:\n> > > >\n> > > > Quoting Naushir Patuck via libcamera-devel (2023-09-18 08:53:57)\n> > > > > Hi David,\n> > > > >\n> > > > > Thank you for this work.\n> > > > >\n> > > > > On Tue, 12 Sept 2023 at 15:23, David Plowman via libcamera-devel\n> > > > > <libcamera-devel@lists.libcamera.org> wrote:\n> > > > > >\n> > > > > > The IqUnstable metadata can be used by IPAs to indicate to an\n> > > > > > application that they have not settled sufficiently to produce\n> > > > > > reliable image quality. Applications would be advised to avoid using\n> > > > > > frames flagged in this way.\n> > > > > >\n> > > > > > One example would be when the camera starts, when the AEC/AGC might\n> > > > > > oscillate for a few frames.\n> > > > > >\n> > > > > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > > > >\n> > > > > I do like this term better than the more generic startup frames we used before.\n> > > > > FYI, I have implemented this control in the RPi pipeline handler that\n> > > > > folks can peek at here:\n> > > > > https://github.com/naushir/libcamera/tree/iq_stability\n> > > > >\n> > > > > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> > > > >\n> > > > > > ---\n> > > > > >  src/libcamera/control_ids.yaml | 20 ++++++++++++++++++++\n> > > > > >  1 file changed, 20 insertions(+)\n> > > > > >\n> > > > > > diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\n> > > > > > index f2e542f4..b96e1272 100644\n> > > > > > --- a/src/libcamera/control_ids.yaml\n> > > > > > +++ b/src/libcamera/control_ids.yaml\n> > > > > > @@ -774,6 +774,26 @@ controls:\n> > > > > >              Continuous AF is paused. No further state changes or lens movements\n> > > > > >              will occur until the AfPauseResume control is sent.\n> > > > > >\n> > > > > > +  - IqUnstable:\n> > > > > > +      type: bool\n> > > > > > +      description: |\n> > > > > > +        The value true indicates that the camera algorithms have not settled\n> > > > > > +        sufficiently to generate images of reliable quality. The application\n> > > > > > +        receiving this frame is advised to drop it and wait for a frame where\n> > > > > > +        this metadata reports false (or is absent).\n> > > > > > +\n> > > > > > +        One example of this would be when the camera system starts. It may be\n> > > > > > +        trying to adapt very quickly to the ambient conditions, resulting in a\n> > > > > > +        few frames where the image brightness may be subject to unusually\n> > > > > > +        extreme oscillations.\n> > > > > > +\n> > > > > > +        The control may report true at other times, for example when an HDR mode\n> > > > > > +        is enabled. Here too there may be a few frames of unpredictable exposure\n> > > > > > +        until the algorithms have settled.\n> > > > > > +\n> > > > > > +        The value false (or absence of the control) indicates that this is a\n> > > > > > +        normal frame.\n> > > > > > +\n> > > >\n> > > > It sounds like this is a flag that tells the application to look at\n> > > > other aspects too. (Or just ignore or drop the frame).\n> > > >\n> > > > I.e. the setting of this IqUnstable flag might be because any of the\n> > > > AWB/AEGC/AF/HDR state machines are not reporting a converged state.\n> > >\n> > > I've mentioned this before, but this control is not meant to be used\n> > > for reporting AWB/AE convergence state.  We have separate controls\n> > > (AeLocked and AwbLocked) for that.  There is a subtle but important\n> >\n> > But it 'is' reporting *not convergence* state. Therefore the lack of\n> > this flag could be implied to mean Iq 'stable' (converged).\n> >\n> >\n> > > distinction between IqStability and the *Locked controls.  The former\n> > > informs the application that the output frame should not be consumed\n> > > because the IQ could be entirely wrong and/or very unstable because\n> > > the algorithms are in an undetermined state (e.g. on first startup or\n> > > a transition from non-hdr to hdr mode).  The latter controls are used\n> > > when the algorithms are running in a stable state (i.e. the frames are\n> > > perfectly valid to consume), but the AE/AWB has not reached its final\n> > > target due to filtering or a scene change (so, for example, best to\n> > > avoid taking a still capture just yet).\n> >\n> > perhaps it sounds like some of that should be captured in the control\n> > documentation?\n> >\n> >\n> > >\n> > > >\n> > > > Do the controls for those algorithms already have a way to report their\n> > > > state?\n> > >\n> > > Yes, see above.\n> > >\n> > > >\n> > > > I do think a global 'this flag means you need to check things' could\n> > > > make sense in this instance, but I'm keen to clarify the relationship of\n> > > > what an application should do here.\n> > > >\n> > > > It also feels like this could be set 'automatically' by a common layer\n> > > > that processes metadata before it gets back to the application and would\n> > > > set it for all pipeline handlers if one of AWB/AEGC/AF/HDR reports an\n> > > > incorrect state?\n> > >\n> > > Given my above understanding of what this control is trying to convey\n> > > to the application, it is not related in any way to the other\n> > > algorithms locked state.  So I don't think we can set this in a common\n> > > layer based on the state of other controls.\n> >\n> > I'm still stuck at the logic of:\n> >\n> >  '(!IqUnstable) == Stable image quality == Converged Algorithms'\n> \n> iqunstable != unconverged\n> \n> You can have iqunstable == false and converged == true or false.\n> But of course, if iqunstable == true, it implies converged == false\n> based on the definition above.\n> \n> So...\n> \n> '(!IqUnstable) == Stable algorithm state but does not necessarily ==\n> Converged Algorithms'\n> \n> The full truth table of states is thus as follows:\n> \n> iqunstable | converged | App behaviour\n> 0          | 0         | Display viewfinder but don't capture JPEG\n> 0          | 1         | Display viewfinder and capture JPEG\n> 1          | 0         | Do not use frame at all\n> \n> That probably does not clear things up... :)\n\nIt sort of does... It tells me that IqUnstable tells the application if\nthe image is worthy of a viewfinder display, while converged tells the\napp if it's worthy of being a captured still image (or part of a\nrecording perhaps?)\n\nHow do we make that clearer in the documentation? I didnt' get it from\nabove until this discussion.\n\n--\nKieran\n\n\n> > > Hope that makes sense!\n> > >\n> > > Naush\n> > >\n> > >\n> > > >\n> > > >\n> > > >\n> > > > > >    # ----------------------------------------------------------------------------\n> > > > > >    # Draft controls section\n> > > > > >\n> > > > > > --\n> > > > > > 2.30.2\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 DC9BEBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Oct 2023 12:52:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0977C62970;\n\tWed, 11 Oct 2023 14:52:17 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E51AB61DDA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Oct 2023 14:52:15 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3C134512;\n\tWed, 11 Oct 2023 14:52:13 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697028737;\n\tbh=uRFzb9pNB2qpSYYGLTLT4XNR2YpS7rJWAGkiGh4Co24=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=KSn4wtw7oe/pKh5VGVBRV88R21pDWToX3cdqdKe087QJtLTSNivGaOpytMPEhRBPp\n\tQ/GEuP2ImysKC7Wj4aCZS9+9H6fkkHLmpuEFxvvmp7bKBvEyh2ML0d8GlOhh0kaFWg\n\t3/uM5zuMdUymEnen3a8bMgjISq+23mdXMk/3woe/4WVz317d6ErLoZ+WTZH3rpdE36\n\tg85Uv89GwOePXR0BMve+Jmy0+7LHZyv+MIZrHXcmGoy8oYVa9ZH+sO7Y3AM5LJvD7N\n\tssf4olUEGJkuQzzIR9s5xs+SmqBoOh6y818MFbckDbMQfVgeUT7lfZ7HBTpq8FFPK1\n\taJ8l+DD490RbA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1697028733;\n\tbh=uRFzb9pNB2qpSYYGLTLT4XNR2YpS7rJWAGkiGh4Co24=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=KKjmR62pPtDMhFKH8Phn2n1c+lwYaHtg8Rg7zfuDhn0KOd2uYLNNz3QdD4nVUd2YB\n\tKjET1Bzcpx2BhogaXF/EzIBmyeOXnBpvmpx0hcziQyD71s44/qCXuhxEnWStC69Rk+\n\tA3u930cYb41/Fob+2CCFI1IGXYoIXG16cwNmerCc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"KKjmR62p\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<CAEmqJPqxznkyaueU4Y0A8vF-+c141nvtBQPSgr_0wcrrjfW2_g@mail.gmail.com>","References":"<20230912142309.170720-1-david.plowman@raspberrypi.com>\n\t<20230912142309.170720-2-david.plowman@raspberrypi.com>\n\t<CAEmqJPp4875-e+rhmf9nKfoYrqS7BYRvrSoSqsGcNzCy2dMjng@mail.gmail.com>\n\t<169702202730.3973464.16764169615163706869@ping.linuxembedded.co.uk>\n\t<CAEmqJPqaJk-94=FA0R-O9gtqPMMH3_ke=r=uv=nys8Awm1ei3Q@mail.gmail.com>\n\t<169702572996.3973464.17133331652018970039@ping.linuxembedded.co.uk>\n\t<CAEmqJPqxznkyaueU4Y0A8vF-+c141nvtBQPSgr_0wcrrjfW2_g@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Date":"Wed, 11 Oct 2023 13:52:12 +0100","Message-ID":"<169702873254.2427060.14952264893180192647@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Naushir Patuck via libcamera-devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27936,"web_url":"https://patchwork.libcamera.org/comment/27936/","msgid":"<CAEmqJPruruN5f9yXtkpwztvYMAc5PwrzA4_UAEH69ddAQe2jQA@mail.gmail.com>","date":"2023-10-11T13:14:37","subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"On Wed, 11 Oct 2023 at 13:52, Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Quoting Naushir Patuck (2023-10-11 13:27:04)\n> > On Wed, 11 Oct 2023 at 13:02, Kieran Bingham\n> > <kieran.bingham@ideasonboard.com> wrote:\n> > >\n> > > Quoting Naushir Patuck (2023-10-11 12:42:48)\n> > > > Hi Kieran,\n> > > >\n> > > > On Wed, 11 Oct 2023 at 12:00, Kieran Bingham\n> > > > <kieran.bingham@ideasonboard.com> wrote:\n> > > > >\n> > > > > Quoting Naushir Patuck via libcamera-devel (2023-09-18 08:53:57)\n> > > > > > Hi David,\n> > > > > >\n> > > > > > Thank you for this work.\n> > > > > >\n> > > > > > On Tue, 12 Sept 2023 at 15:23, David Plowman via libcamera-devel\n> > > > > > <libcamera-devel@lists.libcamera.org> wrote:\n> > > > > > >\n> > > > > > > The IqUnstable metadata can be used by IPAs to indicate to an\n> > > > > > > application that they have not settled sufficiently to produce\n> > > > > > > reliable image quality. Applications would be advised to avoid using\n> > > > > > > frames flagged in this way.\n> > > > > > >\n> > > > > > > One example would be when the camera starts, when the AEC/AGC might\n> > > > > > > oscillate for a few frames.\n> > > > > > >\n> > > > > > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > > > > >\n> > > > > > I do like this term better than the more generic startup frames we used before.\n> > > > > > FYI, I have implemented this control in the RPi pipeline handler that\n> > > > > > folks can peek at here:\n> > > > > > https://github.com/naushir/libcamera/tree/iq_stability\n> > > > > >\n> > > > > > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> > > > > >\n> > > > > > > ---\n> > > > > > >  src/libcamera/control_ids.yaml | 20 ++++++++++++++++++++\n> > > > > > >  1 file changed, 20 insertions(+)\n> > > > > > >\n> > > > > > > diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\n> > > > > > > index f2e542f4..b96e1272 100644\n> > > > > > > --- a/src/libcamera/control_ids.yaml\n> > > > > > > +++ b/src/libcamera/control_ids.yaml\n> > > > > > > @@ -774,6 +774,26 @@ controls:\n> > > > > > >              Continuous AF is paused. No further state changes or lens movements\n> > > > > > >              will occur until the AfPauseResume control is sent.\n> > > > > > >\n> > > > > > > +  - IqUnstable:\n> > > > > > > +      type: bool\n> > > > > > > +      description: |\n> > > > > > > +        The value true indicates that the camera algorithms have not settled\n> > > > > > > +        sufficiently to generate images of reliable quality. The application\n> > > > > > > +        receiving this frame is advised to drop it and wait for a frame where\n> > > > > > > +        this metadata reports false (or is absent).\n> > > > > > > +\n> > > > > > > +        One example of this would be when the camera system starts. It may be\n> > > > > > > +        trying to adapt very quickly to the ambient conditions, resulting in a\n> > > > > > > +        few frames where the image brightness may be subject to unusually\n> > > > > > > +        extreme oscillations.\n> > > > > > > +\n> > > > > > > +        The control may report true at other times, for example when an HDR mode\n> > > > > > > +        is enabled. Here too there may be a few frames of unpredictable exposure\n> > > > > > > +        until the algorithms have settled.\n> > > > > > > +\n> > > > > > > +        The value false (or absence of the control) indicates that this is a\n> > > > > > > +        normal frame.\n> > > > > > > +\n> > > > >\n> > > > > It sounds like this is a flag that tells the application to look at\n> > > > > other aspects too. (Or just ignore or drop the frame).\n> > > > >\n> > > > > I.e. the setting of this IqUnstable flag might be because any of the\n> > > > > AWB/AEGC/AF/HDR state machines are not reporting a converged state.\n> > > >\n> > > > I've mentioned this before, but this control is not meant to be used\n> > > > for reporting AWB/AE convergence state.  We have separate controls\n> > > > (AeLocked and AwbLocked) for that.  There is a subtle but important\n> > >\n> > > But it 'is' reporting *not convergence* state. Therefore the lack of\n> > > this flag could be implied to mean Iq 'stable' (converged).\n> > >\n> > >\n> > > > distinction between IqStability and the *Locked controls.  The former\n> > > > informs the application that the output frame should not be consumed\n> > > > because the IQ could be entirely wrong and/or very unstable because\n> > > > the algorithms are in an undetermined state (e.g. on first startup or\n> > > > a transition from non-hdr to hdr mode).  The latter controls are used\n> > > > when the algorithms are running in a stable state (i.e. the frames are\n> > > > perfectly valid to consume), but the AE/AWB has not reached its final\n> > > > target due to filtering or a scene change (so, for example, best to\n> > > > avoid taking a still capture just yet).\n> > >\n> > > perhaps it sounds like some of that should be captured in the control\n> > > documentation?\n> > >\n> > >\n> > > >\n> > > > >\n> > > > > Do the controls for those algorithms already have a way to report their\n> > > > > state?\n> > > >\n> > > > Yes, see above.\n> > > >\n> > > > >\n> > > > > I do think a global 'this flag means you need to check things' could\n> > > > > make sense in this instance, but I'm keen to clarify the relationship of\n> > > > > what an application should do here.\n> > > > >\n> > > > > It also feels like this could be set 'automatically' by a common layer\n> > > > > that processes metadata before it gets back to the application and would\n> > > > > set it for all pipeline handlers if one of AWB/AEGC/AF/HDR reports an\n> > > > > incorrect state?\n> > > >\n> > > > Given my above understanding of what this control is trying to convey\n> > > > to the application, it is not related in any way to the other\n> > > > algorithms locked state.  So I don't think we can set this in a common\n> > > > layer based on the state of other controls.\n> > >\n> > > I'm still stuck at the logic of:\n> > >\n> > >  '(!IqUnstable) == Stable image quality == Converged Algorithms'\n> >\n> > iqunstable != unconverged\n> >\n> > You can have iqunstable == false and converged == true or false.\n> > But of course, if iqunstable == true, it implies converged == false\n> > based on the definition above.\n> >\n> > So...\n> >\n> > '(!IqUnstable) == Stable algorithm state but does not necessarily ==\n> > Converged Algorithms'\n> >\n> > The full truth table of states is thus as follows:\n> >\n> > iqunstable | converged | App behaviour\n> > 0          | 0         | Display viewfinder but don't capture JPEG\n> > 0          | 1         | Display viewfinder and capture JPEG\n> > 1          | 0         | Do not use frame at all\n> >\n> > That probably does not clear things up... :)\n>\n> It sort of does... It tells me that IqUnstable tells the application if\n> the image is worthy of a viewfinder display, while converged tells the\n> app if it's worthy of being a captured still image (or part of a\n> recording perhaps?)\n>\n> How do we make that clearer in the documentation? I didnt' get it from\n> above until this discussion.\n\nHow about a paragraph tagged to the end of the control description\ngoing something like\n\nThe IqUnstable status is orthogonal to the algorithm convergence\nstatus controls like AeState and AwbState.\nA false value in IqUnstable (or if the control is missing from\nmetadata) implies that the algorithms are in a stable state, but may\nstill be converging due a filtering operation or a scene change.  In\nsuch cases the application may still consume the frames if necessary\nfor viewfinder or video recording use cases.\n\n?\n\n>\n> --\n> Kieran\n>\n>\n> > > > Hope that makes sense!\n> > > >\n> > > > Naush\n> > > >\n> > > >\n> > > > >\n> > > > >\n> > > > >\n> > > > > > >    # ----------------------------------------------------------------------------\n> > > > > > >    # Draft controls section\n> > > > > > >\n> > > > > > > --\n> > > > > > > 2.30.2\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 EA63EC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Oct 2023 13:15:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 58D2562964;\n\tWed, 11 Oct 2023 15:15:17 +0200 (CEST)","from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com\n\t[IPv6:2607:f8b0:4864:20::b2d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 736F261DDA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Oct 2023 15:15:15 +0200 (CEST)","by mail-yb1-xb2d.google.com with SMTP id\n\t3f1490d57ef6-d84c24a810dso7711587276.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Oct 2023 06:15:15 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697030117;\n\tbh=Tia25tmqB19rUyJ3gTPkG7rjW8YSX1MgvIifnqmthiU=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=IYRkN+yd51Hzg9ImzcV44tfiMyBqUpkx5ku+Yt0fidVZ5Fgw9sjS13o/tGHe4iYBQ\n\tCh+3g/JJG5Wf7kFmD1GgFQu7WZrAj8HgRsL9o28q+ebnE994Y7TzDg9m+8t90eqUdy\n\tDCEdN8TYv/mPD3oIQw+Zk642ffR8uNfI+B7IrFq/wUnTMMRHSG92lCPGSY07TB/8Yd\n\tvTjqhH7u9fA5iJoZFe+cjE06+Dme99xleYDyGZRJ3u/xzEHoEu0E34aXvubjf5KkjO\n\tgh7QMRS8fbe/Nj9dUU83HhluoKxM/IcPeEBhHGZe+E1lKE1sGLVeZtCopO3H3sghdc\n\tnq6Q3i5MfzN+w==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1697030114; x=1697634914;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=e2lRiWEl84NVdsDs7WigNxzbMOausAlDNl2/kPUnKXo=;\n\tb=ebMz+I8irsQOpSLK5wxBWSY/xaedOr/gisjPeoVwMDrOxSWAUzM8cZMWJX/A68DE4E\n\tYOftc+wvRAixsfSnRr86yjATGwj2YCG63yv5Tl+m0gMg3LHSbYHyLVcpHCvWLL3NmCne\n\tynJ/RQvo9DgFZyxzmt/1FYKLbqwb1B4cNZYG6+cl88+2yMywSEO7e+aykRSYHIDC1J0P\n\t0MWesDF6kfJAOph27Q5jtV7ubV+gUhT5edeaXS8M6KMg+roEOetCdV0irebvXkMrC8yw\n\tmG+KPy84e9hu1Ou7VQWk1ZgJbS+KzmPksmB9E46TZm5fdm7PbAv/+L2c8YAu/T2IzZoY\n\tWASg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"ebMz+I8i\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1697030114; x=1697634914;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=e2lRiWEl84NVdsDs7WigNxzbMOausAlDNl2/kPUnKXo=;\n\tb=WstKhfDUXnRlyryqLhDnE+JoqRRZ5obczYNPKa+JQ/sbUC+wjmpQ8gHziyFm7Pe4bZ\n\tXzTfjYvnDVfA7duDj4PpPR84B+pQjFtYCNNqY1OSywTpXcIiYVWfgFaMmN8OwvUtHpvP\n\t/NXfPUJcCesUwl1joyoSwGjLxVRa8BWmJ3yCutiI8Nn1tJJEEzcmofKMI6LBSnSAe/cC\n\tSPL24M7dw5Fr6AHzsG1KzzGpwK7m/3dfD4/1iAkYtbR1BaHl94Y9EJXYCQvVkkdWHrr2\n\tdOgtxalDTZ9BfeRq1IFCSJNQAAhIBWDBfsQ5VnsOOQD9h9G5MTa+pmYNu3lwy9eq4cra\n\tX+ug==","X-Gm-Message-State":"AOJu0YzrW7EHHTMWWXZ0VaE35wskH/Qa/gA16DlNrWgEckfmOWBf91ED\n\tkQp5DR9PUcHYIeLkf05BJVlWSkiSdfIh1C4gyCcb0A==","X-Google-Smtp-Source":"AGHT+IFrbb58TaFnHUTcYd1imaNexxQSopJ6mj2JEDyeQuR5jPQDktzPSZt7w+YNOrDRfruCFimpjHV3mrewHponick=","X-Received":"by 2002:a25:6a42:0:b0:d7f:3e2:dd99 with SMTP id\n\tf63-20020a256a42000000b00d7f03e2dd99mr17323621ybc.0.1697030114150;\n\tWed, 11 Oct 2023 06:15:14 -0700 (PDT)","MIME-Version":"1.0","References":"<20230912142309.170720-1-david.plowman@raspberrypi.com>\n\t<20230912142309.170720-2-david.plowman@raspberrypi.com>\n\t<CAEmqJPp4875-e+rhmf9nKfoYrqS7BYRvrSoSqsGcNzCy2dMjng@mail.gmail.com>\n\t<169702202730.3973464.16764169615163706869@ping.linuxembedded.co.uk>\n\t<CAEmqJPqaJk-94=FA0R-O9gtqPMMH3_ke=r=uv=nys8Awm1ei3Q@mail.gmail.com>\n\t<169702572996.3973464.17133331652018970039@ping.linuxembedded.co.uk>\n\t<CAEmqJPqxznkyaueU4Y0A8vF-+c141nvtBQPSgr_0wcrrjfW2_g@mail.gmail.com>\n\t<169702873254.2427060.14952264893180192647@ping.linuxembedded.co.uk>","In-Reply-To":"<169702873254.2427060.14952264893180192647@ping.linuxembedded.co.uk>","Date":"Wed, 11 Oct 2023 14:14:37 +0100","Message-ID":"<CAEmqJPruruN5f9yXtkpwztvYMAc5PwrzA4_UAEH69ddAQe2jQA@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 1/1] libcamera: controls: Add a\n\tcontrol for IQ stability","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Naushir Patuck via libcamera-devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]