[{"id":37515,"web_url":"https://patchwork.libcamera.org/comment/37515/","msgid":"<fcb8ab07-3c87-41d9-ab4b-50e7f044fb8e@ideasonboard.com>","date":"2026-01-07T14:45:10","subject":"Re: [PATCH v2] libcamera: rpi: Make the controller min frame\n\tduration configurable","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2026. 01. 07. 12:05 keltezéssel, David Plowman írta:\n> The controller min frame duration is used to rate limit how often we\n> run IPAs. Historically this has been set to 33333us, meaning that the\n> algorithms effectively skip frames when the camera is running faster\n> than 30fps.\n> \n> This patch adds a small amount of plumbing that allows this value to\n> be set in the Raspberry Pi configuration file. Some applications or\n> platforms (such as Pi 5) are easily capable of running these more\n> often, should there be a need to do so.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>   include/libcamera/ipa/raspberrypi.mojom       |  1 +\n>   src/ipa/rpi/common/ipa_base.cpp               | 10 +++++++-\n>   src/ipa/rpi/common/ipa_base.h                 |  2 ++\n>   .../pipeline/rpi/common/pipeline_base.cpp     | 24 ++++++++++++++-----\n>   .../pipeline/rpi/common/pipeline_base.h       |  5 ++++\n>   .../pipeline/rpi/pisp/data/example.yaml       |  6 +++++\n>   .../pipeline/rpi/vc4/data/example.yaml        |  6 +++++\n>   7 files changed, 47 insertions(+), 7 deletions(-)\n> \n> [...]\n> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> index 14aba450..0a1fc0e9 100644\n> --- a/src/ipa/rpi/common/ipa_base.cpp\n> +++ b/src/ipa/rpi/common/ipa_base.cpp\n> @@ -184,6 +184,14 @@ int32_t IpaBase::init(const IPASettings &settings, const InitParams &params, Ini\n> \n>   \tresult->controlInfo = ControlInfoMap(std::move(ctrlMap), controls::controls);\n> \n> +\t/*\n> +\t * This determines the minimum allowable inter-frame duration to run the\n> +\t * controller algorithms. If the pipeline handler provider frames at a\n> +\t * rate higher than this, we rate-limit the controller Prepare() and\n> +\t * Process() calls to lower than or equal to this rate.\n> +\t */\n> +\tcontrollerMinFrameDuration_ = params.controllerMinFrameDurationUs * 1us;\n> +\n>   \treturn platformInit(params, result);\n>   }\n> \n> @@ -465,7 +473,7 @@ void IpaBase::prepareIsp(const PrepareParams &params)\n>   \t/* Allow a 10% margin on the comparison below. */\n>   \tDuration delta = (frameTimestamp - lastRunTimestamp_) * 1.0ns;\n>   \tif (lastRunTimestamp_ && frameCount_ > invalidCount_ &&\n> -\t    delta < controllerMinFrameDuration * 0.9 && !hdrChange) {\n> +\t    delta < controllerMinFrameDuration_ * 0.9 && !hdrChange) {\n\nI think the constant `controllerMinFrameDuration` in `ipa_base.cpp` can be removed, no?\n\n\nRegards,\nBarnabás Pőcze\n\n>   \t\t/*\n>   \t\t * Ensure we merge the previous frame's metadata with the current\n>   \t\t * frame. This will not overwrite exposure/gain values for the\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 50853BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Jan 2026 14:45:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8CDB961FA0;\n\tWed,  7 Jan 2026 15:45:15 +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 86D2061F84\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Jan 2026 15:45:13 +0100 (CET)","from [192.168.33.35] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C0EAB73B;\n\tWed,  7 Jan 2026 15:44:51 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"OVO+E3c5\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1767797091;\n\tbh=6AYgTKGIlPpQquxuaTYikEJA9out1dKSHjBIS23C/Mw=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=OVO+E3c55g1yoKa8zVPeC9V+xsFwGFXol117oUDXQIJgZTv4ZvFaWgllng/HBraGR\n\taRVDDPwXbZHEWoTrMMLZCbE7ITpHQ1AR73JYre/yLTbQ0pnWcDWF1hgslkhctYN76v\n\tnpXWZcakQqsah5OEi7nDpyG2BGgky22SGQeppdbU=","Message-ID":"<fcb8ab07-3c87-41d9-ab4b-50e7f044fb8e@ideasonboard.com>","Date":"Wed, 7 Jan 2026 15:45:10 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2] libcamera: rpi: Make the controller min frame\n\tduration configurable","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<dJEtaeKewvi6sT5GoB_CChkyh8ur2n5DfRBJHwFHqiOJgRfoBeEnzX_wgiDNfBhMY0bW9ODijzZBE3j8V8rFCQ==@protonmail.internalid>\n\t<20260107110544.16422-1-david.plowman@raspberrypi.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260107110544.16422-1-david.plowman@raspberrypi.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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":37516,"web_url":"https://patchwork.libcamera.org/comment/37516/","msgid":"<CAHW6GYJ8Sdk_O1hr_ZiRAVOt5bi45PiV=pOv0b96rZ=MFjKr6g@mail.gmail.com>","date":"2026-01-07T14:54:52","subject":"Re: [PATCH v2] libcamera: rpi: Make the controller min frame\n\tduration configurable","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Barnabas\n\nThanks for the review.\n\nOn Wed, 7 Jan 2026 at 14:45, Barnabás Pőcze\n<barnabas.pocze@ideasonboard.com> wrote:\n>\n> Hi\n>\n> 2026. 01. 07. 12:05 keltezéssel, David Plowman írta:\n> > The controller min frame duration is used to rate limit how often we\n> > run IPAs. Historically this has been set to 33333us, meaning that the\n> > algorithms effectively skip frames when the camera is running faster\n> > than 30fps.\n> >\n> > This patch adds a small amount of plumbing that allows this value to\n> > be set in the Raspberry Pi configuration file. Some applications or\n> > platforms (such as Pi 5) are easily capable of running these more\n> > often, should there be a need to do so.\n> >\n> > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > ---\n> >   include/libcamera/ipa/raspberrypi.mojom       |  1 +\n> >   src/ipa/rpi/common/ipa_base.cpp               | 10 +++++++-\n> >   src/ipa/rpi/common/ipa_base.h                 |  2 ++\n> >   .../pipeline/rpi/common/pipeline_base.cpp     | 24 ++++++++++++++-----\n> >   .../pipeline/rpi/common/pipeline_base.h       |  5 ++++\n> >   .../pipeline/rpi/pisp/data/example.yaml       |  6 +++++\n> >   .../pipeline/rpi/vc4/data/example.yaml        |  6 +++++\n> >   7 files changed, 47 insertions(+), 7 deletions(-)\n> >\n> > [...]\n> > diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> > index 14aba450..0a1fc0e9 100644\n> > --- a/src/ipa/rpi/common/ipa_base.cpp\n> > +++ b/src/ipa/rpi/common/ipa_base.cpp\n> > @@ -184,6 +184,14 @@ int32_t IpaBase::init(const IPASettings &settings, const InitParams &params, Ini\n> >\n> >       result->controlInfo = ControlInfoMap(std::move(ctrlMap), controls::controls);\n> >\n> > +     /*\n> > +      * This determines the minimum allowable inter-frame duration to run the\n> > +      * controller algorithms. If the pipeline handler provider frames at a\n> > +      * rate higher than this, we rate-limit the controller Prepare() and\n> > +      * Process() calls to lower than or equal to this rate.\n> > +      */\n> > +     controllerMinFrameDuration_ = params.controllerMinFrameDurationUs * 1us;\n> > +\n> >       return platformInit(params, result);\n> >   }\n> >\n> > @@ -465,7 +473,7 @@ void IpaBase::prepareIsp(const PrepareParams &params)\n> >       /* Allow a 10% margin on the comparison below. */\n> >       Duration delta = (frameTimestamp - lastRunTimestamp_) * 1.0ns;\n> >       if (lastRunTimestamp_ && frameCount_ > invalidCount_ &&\n> > -         delta < controllerMinFrameDuration * 0.9 && !hdrChange) {\n> > +         delta < controllerMinFrameDuration_ * 0.9 && !hdrChange) {\n>\n> I think the constant `controllerMinFrameDuration` in `ipa_base.cpp` can be removed, no?\n\nYes of course - thanks for spotting!\n\nDavid\n\n>\n>\n> Regards,\n> Barnabás Pőcze\n>\n> >               /*\n> >                * Ensure we merge the previous frame's metadata with the current\n> >                * frame. This will not overwrite exposure/gain values for the\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 9BD22BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Jan 2026 14:55:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C632F61FA0;\n\tWed,  7 Jan 2026 15:55:06 +0100 (CET)","from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com\n\t[IPv6:2607:f8b0:4864:20::f32])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C07C061F84\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Jan 2026 15:55:04 +0100 (CET)","by mail-qv1-xf32.google.com with SMTP id\n\t6a1803df08f44-88a3d2f3299so22313396d6.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 07 Jan 2026 06:55:04 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"PlYKFv5f\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1767797703; x=1768402503;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=zkkSfrpCfyuNaMIt1YZOmE4zdSSQuJpUzNvotELvIlA=;\n\tb=PlYKFv5fSXIcpuUIhTR+I4iX3C+7cKb0kNuKMdB1DhmqWbYSs9dmWgLPnmwM/tMXaH\n\tOmk1H7Kz4Nc5xMmQo6ouLXNHDzx7hLIC4fnAluQyhGEmicIWQ11bMKEmagF7w0Fkc3m0\n\tslH45ERYk4RDunVChYXLa0x0Uoyohq35Rck4uVZdDwCt3GkolaZ9ek9l86SaO7bbp8Ob\n\tE9aQLI3eKIxQIqDekRuDSMJ3iGkJTorJUEHW/hJlahm/Fji73EoPGpZWpM3PlDdXBvsN\n\tRw4uMOaP1jUoHD5toUkRY1IYmziHo80v84THHbra+DZvoJXp0pVyDYo072IVLPOC9/qh\n\t2Wkg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1767797703; x=1768402503;\n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=zkkSfrpCfyuNaMIt1YZOmE4zdSSQuJpUzNvotELvIlA=;\n\tb=Dd1XmzmXbPZqdU3iuEpUAJuRjOmw2a9l4CFw93T7iJjRgfDGyZ4os20pTABAIPglvX\n\trAh/4QKtgggYpgChe/LN7yvGUw8JBH4cH9WY/gclpS1lRvSPa2GAx1u5cagMcHFy56ZA\n\tPr+phhY3GBXAYfOVuvcOfLoP7DNUo9x+Qgw+00TSQdywFGxGlwyjswROzT1w4rnz/RtE\n\tdyP4tb6C8QRk8iTgHwkh9YnCJ+ykgYU/boRm/7fro4J78yD4Cfk0ZU7+dXZQaaOeyMXC\n\tDsYAwQCemwZDrSgvR1o8m5MJCcnZjHLIaISt8786tJSSOMr1hNssMISWEy++pUPrLRjZ\n\tJXqw==","X-Gm-Message-State":"AOJu0YxlRvpEnDRlcBjVpPDfpAIvBqH5zMswIvOuULIR7sR1/dAF6rV7\n\tPKeQqjIzPQqgBR/NofBDxm7x84ADSjvUwF4BVbsBR4SJBuEg+Q06e1+MkRLFXrh1rsRVQgZLkQX\n\tXsROcrqwzYGoocZylEeda3RlcsmusuBehYjdRLrX+bLwOLT/0DEUweu0=","X-Gm-Gg":"AY/fxX7b6eZIyNeq+OzJjEojnAVgQNjKM3MjY4OJ8ZoBgEtfSb9/4SO2YLdGPhTSMsT\n\tAvAN62pU4NrEol/T/+kzaSpOxp5wpwDB8EO/qmRqelbC6WsBWo/82dWGYg3AoGFH4AKxo6Ed4+q\n\tnJ5O9ALoUNZg+oGza71IXrH+6QQIazzWtHN+uJgQik7ehbjgMpZuzg6/rMgkR+w0CwrWDBNEvGJ\n\tBtzZPUVWiOofn9tQUujX/ZiSlg//IPQEHcL4pYD/ks6D0/mu75YsaI/IeIWSByEr2NdL+vIBMgc\n\tZnm4pPPMQDR3lgppSZnBK4xKrkGfcFD+hxU1VrEDz1CqlPrTIgQQhq0f06r3tGoE035UF2Ygxce\n\tP0t4BmmENN4njwDuuYc8ooRw=","X-Google-Smtp-Source":"AGHT+IFrRK1ltSTgqAq76+iP/NtUSJGr2nrYGwtIC1hjsJGxYBmwXKBptG6yCHjECFvE0wIsCToyw0M624cPym7W6WI=","X-Received":"by 2002:a05:6214:4a89:b0:86b:9167:b0e9 with SMTP id\n\t6a1803df08f44-89084179d74mr35333836d6.4.1767797703630;\n\tWed, 07 Jan 2026 06:55:03 -0800 (PST)","MIME-Version":"1.0","References":"<dJEtaeKewvi6sT5GoB_CChkyh8ur2n5DfRBJHwFHqiOJgRfoBeEnzX_wgiDNfBhMY0bW9ODijzZBE3j8V8rFCQ==@protonmail.internalid>\n\t<20260107110544.16422-1-david.plowman@raspberrypi.com>\n\t<fcb8ab07-3c87-41d9-ab4b-50e7f044fb8e@ideasonboard.com>","In-Reply-To":"<fcb8ab07-3c87-41d9-ab4b-50e7f044fb8e@ideasonboard.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Wed, 7 Jan 2026 14:54:52 +0000","X-Gm-Features":"AQt7F2rwyGjlWQZcy37lp8eZHSBhA-MyKocBSuYcGwUJPcv313EuOfM3dZiCNR4","Message-ID":"<CAHW6GYJ8Sdk_O1hr_ZiRAVOt5bi45PiV=pOv0b96rZ=MFjKr6g@mail.gmail.com>","Subject":"Re: [PATCH v2] libcamera: rpi: Make the controller min frame\n\tduration configurable","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","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>"}}]