[{"id":34085,"web_url":"https://patchwork.libcamera.org/comment/34085/","msgid":"<4xfu7tn3oqalklww4mezmcidtezxhzjqso3mmbj5m7agcd6lio@x5rbhsw5v2od>","date":"2025-04-30T09:36:00","subject":"Re: [PATCH 1/1] libipa: Allow disabling algorithms via the tuning\n\tfile","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Isaac,\n\nThank you for the patch. \n\nOn Tue, Apr 29, 2025 at 01:48:06PM +0100, Isaac Scott wrote:\n> Allows the user to add \"disabled\" as a parameter in their tuning file,\n> which lets them test disabling algorithms without having to delete them.\n\nI think such a property would be useful. Ideally I'd like to toggle that\nat runtime also, but that is for later.\n\nOne suggestion though: Can we call the property \"enabled\" with a boolean\nvalue?\n\nBest regards,\nStefan\n\n> \n> Usage example:\n> \n> version: 1\n> algorithms:\n>   - Agc:\n>       disabled:\n>       AeMeteringMode:\n>         MeteringCentreWeighted: [ 0, 0, 0, 0, 0, 0, 6, 8, 6, 0, 0, 8, 16, 8, 0, 0, 6, 8, 6, 0, 0, 0, 0, 0, 0 ]\n>         MeteringSpot: [ 0, 0, 0, 0, 0, 0, 2, 4, 2, 0, 0, 4, 16, 4, 0, 0, 2, 4, 2, 0, 0, 0, 0, 0, 0 ]\n>         MeteringMatrix: [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n>       AeExposureMode:\n> \n> This example will disable the Agc algorithm.\n> \n> Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>\n> ---\n>  src/ipa/libipa/module.h | 7 +++++++\n>  1 file changed, 7 insertions(+)\n> \n> diff --git a/src/ipa/libipa/module.h b/src/ipa/libipa/module.h\n> index 0fb51916..86cc382b 100644\n> --- a/src/ipa/libipa/module.h\n> +++ b/src/ipa/libipa/module.h\n> @@ -74,6 +74,13 @@ private:\n>  \tint createAlgorithm(Context &context, const YamlObject &data)\n>  \t{\n>  \t\tconst auto &[name, algoData] = *data.asDict().begin();\n> +\t\tif (algoData.contains(\"disabled\")) {\n> +\t\t\tLOG(IPAModuleAlgo, Debug)\n> +\t\t\t\t<< \"Algorithm \" << name << \" is disabled\"\n> +\t\t\t\t<< \" in the tuning file!\";\n> +\t\t\t/* If we return an error code, the IPA does not work */\n> +\t\t\treturn 0;\n> +\t\t}\n>  \t\tstd::unique_ptr<Algorithm<Module>> algo = createAlgorithm(name);\n>  \t\tif (!algo) {\n>  \t\t\tLOG(IPAModuleAlgo, Error)\n> -- \n> 2.43.0\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 E58AEBE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 30 Apr 2025 09:36:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B628168AD5;\n\tWed, 30 Apr 2025 11:36:05 +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 C3E3F617DE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Apr 2025 11:36:04 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:25b5:b5c1:f5dd:79f5])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5C7B2564;\n\tWed, 30 Apr 2025 11:35:58 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"JpdezAz/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1746005758;\n\tbh=csYM/wELQ/yw8VBbuJrUydTM/7jna7kCxdhrBq1wy3M=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=JpdezAz/gZSAMM+XwBr5YXZDlR7Okxv0a2vHT+a/IiFZFfqd92MtJ3GMAc2fnt+B7\n\tW0yrqJdNAPCE0F9gfTFqW0K0nYY9RY2jDaI5Br6+LMdeOtEPqgqc5KXKsGMVv4eZvZ\n\tun2f+BBm/LQT0lWHnYD0n2njFMd4bonJm8/PJNLc=","Date":"Wed, 30 Apr 2025 11:36:00 +0200","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"Isaac Scott <isaac.scott@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Subject":"Re: [PATCH 1/1] libipa: Allow disabling algorithms via the tuning\n\tfile","Message-ID":"<4xfu7tn3oqalklww4mezmcidtezxhzjqso3mmbj5m7agcd6lio@x5rbhsw5v2od>","References":"<20250429124806.138056-1-isaac.scott@ideasonboard.com>\n\t<20250429124806.138056-2-isaac.scott@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20250429124806.138056-2-isaac.scott@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":34212,"web_url":"https://patchwork.libcamera.org/comment/34212/","msgid":"<174709410808.233090.10276815304572792630@pyrite.rasen.tech>","date":"2025-05-12T23:55:08","subject":"Re: [PATCH 1/1] libipa: Allow disabling algorithms via the tuning\n\tfile","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Stefan Klug (2025-04-30 11:36:00)\n> Hi Isaac,\n> \n> Thank you for the patch. \n> \n> On Tue, Apr 29, 2025 at 01:48:06PM +0100, Isaac Scott wrote:\n> > Allows the user to add \"disabled\" as a parameter in their tuning file,\n> > which lets them test disabling algorithms without having to delete them.\n> \n> I think such a property would be useful. Ideally I'd like to toggle that\n> at runtime also, but that is for later.\n> \n> One suggestion though: Can we call the property \"enabled\" with a boolean\n> value?\n\nI think I'm in this camp too. Even though the default is \"existence of the algo\nin the tuning file = enabled\", I think \"enabled: false\" is nicer than an empty\n\"disabled:\" entry.\n\nPaul\n\n> \n> Best regards,\n> Stefan\n> \n> > \n> > Usage example:\n> > \n> > version: 1\n> > algorithms:\n> >   - Agc:\n> >       disabled:\n> >       AeMeteringMode:\n> >         MeteringCentreWeighted: [ 0, 0, 0, 0, 0, 0, 6, 8, 6, 0, 0, 8, 16, 8, 0, 0, 6, 8, 6, 0, 0, 0, 0, 0, 0 ]\n> >         MeteringSpot: [ 0, 0, 0, 0, 0, 0, 2, 4, 2, 0, 0, 4, 16, 4, 0, 0, 2, 4, 2, 0, 0, 0, 0, 0, 0 ]\n> >         MeteringMatrix: [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> >       AeExposureMode:\n> > \n> > This example will disable the Agc algorithm.\n> > \n> > Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>\n> > ---\n> >  src/ipa/libipa/module.h | 7 +++++++\n> >  1 file changed, 7 insertions(+)\n> > \n> > diff --git a/src/ipa/libipa/module.h b/src/ipa/libipa/module.h\n> > index 0fb51916..86cc382b 100644\n> > --- a/src/ipa/libipa/module.h\n> > +++ b/src/ipa/libipa/module.h\n> > @@ -74,6 +74,13 @@ private:\n> >       int createAlgorithm(Context &context, const YamlObject &data)\n> >       {\n> >               const auto &[name, algoData] = *data.asDict().begin();\n> > +             if (algoData.contains(\"disabled\")) {\n> > +                     LOG(IPAModuleAlgo, Debug)\n> > +                             << \"Algorithm \" << name << \" is disabled\"\n> > +                             << \" in the tuning file!\";\n> > +                     /* If we return an error code, the IPA does not work */\n> > +                     return 0;\n> > +             }\n> >               std::unique_ptr<Algorithm<Module>> algo = createAlgorithm(name);\n> >               if (!algo) {\n> >                       LOG(IPAModuleAlgo, Error)\n> > -- \n> > 2.43.0\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 AF5C6C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 12 May 2025 23:55:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DDCBF68B40;\n\tTue, 13 May 2025 01:55: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 27A816175B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 May 2025 01:55:12 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2a01:cb16:207c:d42d:582a:8fec:5220:cfc6])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 78E6C353;\n\tTue, 13 May 2025 01:54:56 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"jAiQ1ODl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1747094096;\n\tbh=iMs1yqRysFreLclAKYOYZov7/o9k00x3zE9UsQoaUXA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=jAiQ1ODlxIqkGPppkfT7GgqqlXMIXOV7mb3uyCc69WnziYB/DBSyYqa5DrGL1KwRA\n\timxor7Iuu4UbrdiEhmfGgGWNtmTWdqo/igipszlJjujdAK0MdJaxTa6OzNqUEQb301\n\tce0IvdtQAnbJlW9R7fboFPpyGewXnIzCBlYaump8=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<4xfu7tn3oqalklww4mezmcidtezxhzjqso3mmbj5m7agcd6lio@x5rbhsw5v2od>","References":"<20250429124806.138056-1-isaac.scott@ideasonboard.com>\n\t<20250429124806.138056-2-isaac.scott@ideasonboard.com>\n\t<4xfu7tn3oqalklww4mezmcidtezxhzjqso3mmbj5m7agcd6lio@x5rbhsw5v2od>","Subject":"Re: [PATCH 1/1] libipa: Allow disabling algorithms via the tuning\n\tfile","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","To":"Isaac Scott <isaac.scott@ideasonboard.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>","Date":"Tue, 13 May 2025 01:55:08 +0200","Message-ID":"<174709410808.233090.10276815304572792630@pyrite.rasen.tech>","User-Agent":"alot/0.0.0","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]