Camera2 API Issue: Physical Camera fails via Logical Camera Flow but opens Directly on POCO X8 Pro (Android 16)


I found a Camera2 API issue on POCO X8 Pro (Android 16 / HyperOS) related to opening physical cameras from a logical multi-camera device.

Device camera configuration example

CameraManager.getCameraIdList() returns:

["0", "1"]

For logical camera "0":

CameraCharacteristics.getPhysicalCameraIds()

returns:

["2", "3"]

Expected behavior (according to Android Camera2 documentation)

Because physical camera IDs "2" and "3" are not returned by CameraManager.getCameraIdList(), they should only be used as part of logical camera "0".

Correct usage should be:

cameraManager.openCamera("0", stateCallback, handler)

Then during session creation:

val outputs = mutableListOf<OutputConfiguration>() outputs.add( OutputConfiguration(previewSurface).apply { setPhysicalCameraId("2") } ) val config = SessionConfiguration( SessionConfiguration.SESSION_REGULAR, outputs, executor, stateCallback ) cameraDevice.createCaptureSession(config)

Actual behavior on POCO X8 Pro

The session is created successfully and CameraCaptureSession.StateCallback.onConfigured() is called.

However, immediately after that, CameraDevice.StateCallback.onError() is called with:

ERROR_CAMERA_DEVICE

The camera then closes.

Unexpected behavior

If physical camera ID "2" is opened directly:

cameraManager.openCamera("2", stateCallback, handler)

it works correctly, even though "2" is not returned by CameraManager.getCameraIdList().

Problem summary

This appears inconsistent with Android Camera2 documentation.

If a physical camera ID is not listed in getCameraIdList(), it should normally be accessible only through the logical camera using setPhysicalCameraId().

On POCO X8 Pro:

  • Official logical + setPhysicalCameraId() flow fails with ERROR_CAMERA_DEVICE
  • Direct openCamera("2") works

Request for Xiaomi staff (if you see this)

Please check whether this is a Camera HAL / Camera2 metadata issue on POCO X8 Pro, and whether physical camera IDs should either:

  1. Be included in getCameraIdList() if directly openable, or
  2. Work correctly through the documented logical camera + setPhysicalCameraId() method.
2
Apr 25 at 11:39 PM
User Avataruser924
#android#android-camera2#xiaomi

No answer found for this question yet.