[RFC,v4,01/23] libcamera: controls: AeExposureMode: Add ExposureMaximize
diff mbox series

Message ID 20261026132045.269007-2-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 Oct. 26, 2026, 1:20 p.m. UTC
Add a new exposure mode that is intended to make the full capabilities
of a sensor available for applications, potentially allowing multi-second
exposure times and maximal analogue gain.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/libcamera/control_ids_core.yaml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Jacopo Mondi Oct. 27, 2026, 8:06 a.m. UTC | #1
Hi Barnabás

On Mon, Oct 26, 2026 at 02:20:23PM +0100, Barnabás Pőcze wrote:
> Add a new exposure mode that is intended to make the full capabilities
> of a sensor available for applications, potentially allowing multi-second
> exposure times and maximal analogue gain.
>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
>  src/libcamera/control_ids_core.yaml | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml
> index 89991d03d7..acd8ffd85a 100644
> --- a/src/libcamera/control_ids_core.yaml
> +++ b/src/libcamera/control_ids_core.yaml
> @@ -188,6 +188,25 @@ controls:
>          - name: ExposureCustom
>            value: 3
>            description: Custom exposure mode.
> +        - name: ExposureMaximize
> +          value: 4
> +          description: |
> +            Exposure mode allowing very large exposure times and gains.

Honestly, I would simply

               Exposure mode allowing very large exposure times and gains, up to
               sensor maximum capabilities.

and not delve into further details.

> +
> +            This mode is intended to make the full capabilities of the sensor
> +            available. In practice this allows multi-second exposures and
> +            maximum available analogue gain. In contrast to other modes,
> +            it is generally expected that the exposure time is maximized first,

I'm not sure, as a user if I read "generally expected" I would wonder
in which case it is not.

> +            and only then is gain used to achieve the target exposure. Note,
> +            that this mode can be customized in tuning files, thus the behaviour
> +            might differ slightly.

Doesn't this apply to all modes, through the definition of stages ?

> +
> +            Such behaviour can be useful for mostly static scenes where the
> +            lighting changes drastically over a period of time (e.g. capturing
> +            the sky 24 hours a day).

Meh, that really depends on the sensor's capabilities, doesn't it ?

> +
> +            Be aware that FrameDurationLimits will always apply, potentially reducing
> +            the maximum achievable exposure time.

Likewise, applies to all modes ?

>
>    - ExposureValue:
>        type: float
> --
> 2.56.0
>
Barnabás Pőcze Oct. 27, 2026, 8:20 a.m. UTC | #2
2026. 10. 27. 9:06 keltezéssel, Jacopo Mondi írta:
> Hi Barnabás
> 
> On Mon, Oct 26, 2026 at 02:20:23PM +0100, Barnabás Pőcze wrote:
>> Add a new exposure mode that is intended to make the full capabilities
>> of a sensor available for applications, potentially allowing multi-second
>> exposure times and maximal analogue gain.
>>
>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
>> ---
>>   src/libcamera/control_ids_core.yaml | 19 +++++++++++++++++++
>>   1 file changed, 19 insertions(+)
>>
>> diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml
>> index 89991d03d7..acd8ffd85a 100644
>> --- a/src/libcamera/control_ids_core.yaml
>> +++ b/src/libcamera/control_ids_core.yaml
>> @@ -188,6 +188,25 @@ controls:
>>           - name: ExposureCustom
>>             value: 3
>>             description: Custom exposure mode.
>> +        - name: ExposureMaximize
>> +          value: 4
>> +          description: |
>> +            Exposure mode allowing very large exposure times and gains.
> 
> Honestly, I would simply
> 
>                 Exposure mode allowing very large exposure times and gains, up to
>                 sensor maximum capabilities.
> 
> and not delve into further details.
> 
>> +
>> +            This mode is intended to make the full capabilities of the sensor
>> +            available. In practice this allows multi-second exposures and
>> +            maximum available analogue gain. In contrast to other modes,
>> +            it is generally expected that the exposure time is maximized first,
> 
> I'm not sure, as a user if I read "generally expected" I would wonder
> in which case it is not.
> 
>> +            and only then is gain used to achieve the target exposure. Note,
>> +            that this mode can be customized in tuning files, thus the behaviour
>> +            might differ slightly.
> 
> Doesn't this apply to all modes, through the definition of stages ?

Well, yes, and that's exactly why I wrote "generally". It's customizable, so
there is no hard-coded behaviour like in v3. So I stated what's the expected
behaviour in general, but as far as I recall we have agreed that the actual
behaviour might be different, if the tuning file creator so wishes.

But I think I'll just use your suggestion from above.

> 
>> +
>> +            Such behaviour can be useful for mostly static scenes where the
>> +            lighting changes drastically over a period of time (e.g. capturing
>> +            the sky 24 hours a day).
> 
> Meh, that really depends on the sensor's capabilities, doesn't it ?

Well, yes.


> 
>> +
>> +            Be aware that FrameDurationLimits will always apply, potentially reducing
>> +            the maximum achievable exposure time.
> 
> Likewise, applies to all modes ?

Yes, but due to the previous paragraphs, I felt it was useful to mention this explicitly.


> 
>>
>>     - ExposureValue:
>>         type: float
>> --
>> 2.56.0
>>

Patch
diff mbox series

diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml
index 89991d03d7..acd8ffd85a 100644
--- a/src/libcamera/control_ids_core.yaml
+++ b/src/libcamera/control_ids_core.yaml
@@ -188,6 +188,25 @@  controls:
         - name: ExposureCustom
           value: 3
           description: Custom exposure mode.
+        - name: ExposureMaximize
+          value: 4
+          description: |
+            Exposure mode allowing very large exposure times and gains.
+
+            This mode is intended to make the full capabilities of the sensor
+            available. In practice this allows multi-second exposures and
+            maximum available analogue gain. In contrast to other modes,
+            it is generally expected that the exposure time is maximized first,
+            and only then is gain used to achieve the target exposure. Note,
+            that this mode can be customized in tuning files, thus the behaviour
+            might differ slightly.
+
+            Such behaviour can be useful for mostly static scenes where the
+            lighting changes drastically over a period of time (e.g. capturing
+            the sky 24 hours a day).
+
+            Be aware that FrameDurationLimits will always apply, potentially reducing
+            the maximum achievable exposure time.
 
   - ExposureValue:
       type: float