Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Assistance Needed: Implementing Shutter Priority Mode with CameraX API

69 views
Skip to first unread message

Henil Chhipani

unread,
Sep 19, 2024, 6:56:53 AM9/19/24
to Android CameraX Discussion Group

Hi team,

I am working with the CameraX API and Camera2Interop to implement a shutter priority mode, where SENSOR_SENSITIVITY (ISO) is set to auto, and SENSOR_EXPOSURE_TIME (shutter speed) is manually configured. I have been using the following code:


CaptureRequestOptions.Builder()
    .setCaptureRequestOption(
        CaptureRequest.CONTROL_AE_MODE,
        CaptureRequest.CONTROL_AE_MODE_OFF)
    .setCaptureRequestOption(
        CaptureRequest.SENSOR_SENSITIVITY,
        if (SensorSensitivityMode) 0 // set 0 for automatically find value
        else SensorSensitivityValue)
    .setCaptureRequestOption(
        CaptureRequest.SENSOR_EXPOSURE_TIME,
        SensorExposureTime)

  This approach works well on devices like Redmi 9 and Poco M6+, where the ISO is correctly determined based on the shutter speed and light conditions. However, I am encountering issues on Samsung S24 and Samsung M31, where the expected behavior does not occur.  

Is there a way to achieve this functionality on all devices, or is there a specific configuration required for Samsung models? Does CameraX fully support this functionality across different devices?

Conclusion: I want to implement a shutter priority mode, where the ISO value is automatically determined based on the manually set shutter speed (exposure time). How can I achieve this functionality, and is there a workaround for Samsung devices where the current approach isn't working?

Best Regards,
Henil Chhipani

  

Eino-Ville Talvala

unread,
Sep 19, 2024, 12:20:54 PM9/19/24
to Henil Chhipani, Android CameraX Discussion Group
Hi Henil -

Unfortunately, Android has no standard API for shutter priority mode (or any other exposure priority mode).

It sounds like some manufacturers support it via some custom behavior (for Xiaomi, setting SENSOR_SENSITIVITY to 0), but that's entirely an extension by those manufacturer, and there's no reason to expect that to work with other manufacturers' devices.  You'd have to find out if Samsung's devices have some other way to enable shutter priority mode, and there's unfortunately no guarantee that future devices from any manufacturers would continue to support the existing methods to enable shutter priority.

Specifically, most OEMs implement these sorts of customizations for their own built-in camera app, and they can change them from device to device as their camera app evolves. Unless the OEM has documented an API and guaranteed support, using these sorts of customizations can be quite fragile over time.

- Eddy



--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/4fa8ecc9-0c07-47b8-b133-842be203de34n%40android.com.

Henil Chhipani

unread,
Sep 20, 2024, 12:43:04 AM9/20/24
to Android CameraX Discussion Group, etal...@google.com, Android CameraX Discussion Group, Henil Chhipani
Thanks, Eddy for the reply,

So I must devise a separate algorithm to find iso based on lightning and shutter speed. Any suggestions?

- Henil Chhipani
Reply all
Reply to author
Forward
0 new messages