[v6,22/24] ipa: libipa: agc: Do not run faster than 30 fps by default
diff mbox series

Message ID 20261102101610.877390-23-barnabas.pocze@ideasonboard.com
State Superseded
Headers show
Series
  • ipa: libipa: agc: Take exposure margin into account
Related show

Commit Message

Barnabás Pőcze Nov. 2, 2026, 10:16 a.m. UTC
In auto mode, by default the camera should not run faster than 30fps
unless the user explicitly adjusts `FrameDurationLimits`. This matches
the behaviour of the raspberry pi agc algorithm.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/ipa/libipa/agc.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Stefan Klug Nov. 5, 2026, 10:58 a.m. UTC | #1
Hi Barnabás,

Quoting Barnabás Pőcze (2026-11-02 11:16:08)
> In auto mode, by default the camera should not run faster than 30fps
> unless the user explicitly adjusts `FrameDurationLimits`. This matches
> the behaviour of the raspberry pi agc algorithm.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---
>  src/ipa/libipa/agc.cpp | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp
> index 9610d5b39a..d7c1faedd9 100644
> --- a/src/ipa/libipa/agc.cpp
> +++ b/src/ipa/libipa/agc.cpp
> @@ -779,6 +779,13 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state,
>                 },
>         }, impl_);
>  
> +       if (session.autoAllowed) {
> +               /* By default do not run faster than 30fps. */
> +               state.minFrameDuration = std::clamp(
> +                       utils::Duration(1.0s / 30),
> +                       session.minFrameDuration, session.maxFrameDuration);
> +       }
> +

To be honest, I don't like this change very much. Having cameras that
need manual adjustments to show their performance feels odd. For webcam
use cases this seems reasonable, for everything else I'd expect the
camera by default to run as fast as possible.

Would it make sense to put that in the tuning file so that it can be
defaulted for cameras that are known to be webcams?

Best regards,
Stefan

>         /* \todo Move this to the `Camera` class. */
>         config.ctrlMap[&controls::AeEnable] = ControlInfo{
>                 false, session.autoAllowed, session.autoAllowed
> -- 
> 2.56.0
>

Patch
diff mbox series

diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp
index 9610d5b39a..d7c1faedd9 100644
--- a/src/ipa/libipa/agc.cpp
+++ b/src/ipa/libipa/agc.cpp
@@ -779,6 +779,13 @@  int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state,
 		},
 	}, impl_);
 
+	if (session.autoAllowed) {
+		/* By default do not run faster than 30fps. */
+		state.minFrameDuration = std::clamp(
+			utils::Duration(1.0s / 30),
+			session.minFrameDuration, session.maxFrameDuration);
+	}
+
 	/* \todo Move this to the `Camera` class. */
 	config.ctrlMap[&controls::AeEnable] = ControlInfo{
 		false, session.autoAllowed, session.autoAllowed