Power & Source of Big Ideas

Camera 2 api not working

Moderators: chensy, FATechsupport

We are trying to access one or two cameras via the Android Camera2 and NDK.
We are using the FriendlyElec OV13850 modules.

After unsuccessful tries (no camera image showing) with the "delivered" Android 8 logCat shows a message saying that the connected camera is not a camera2 device, we changed

./hardware/rockchip/camera/Config/rk32xx_camera.mk from Camera2.portability.force_api=1 -> 2
./device/rockchip/common/system.prop from Camera2.portability.force_api=1 -> 2

and
/frameworks/ex/camera2/portability/src/com/android/ex/camera2/portability/CameraAgentFactory.java from
private static final String API_LEVEL_OVERRIDE_VALUE =
SystemProperties.get(API_LEVEL_OVERRIDE_KEY, API_LEVEL_OVERRIDE_API1); to
private static final String API_LEVEL_OVERRIDE_VALUE =
SystemProperties.get(API_LEVEL_OVERRIDE_KEY, API_LEVEL_OVERRIDE_API2);

and rebuilt Android. This results in the standard camera app, delivered with android to stop working. (no issue so far, as it might be using standard camera api and not camera2)

But the android basic camera NDK sample app, and also our own app still fail.

It looks like the board does not support camera2 via NDK......
This is pretty bad. Anyone an idea ? :-)
No, because if you use the google camera2 NDK sample code it iterates through the camera instances and checks their characteristics. Only if it is compatible, it will start to grab the images. Here is the result when iterating:

Even with both identical cameras connected one returns Legacy 0 and the other one Legacy 2

Facing 1:
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY, returns 0 --- !!
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL, returns 4
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED, returns 0
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL, returns 1
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_3 returns 3

Facing 0:
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY, returns 2 --- !!
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL, returns 4
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED, returns 0
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL, returns 1
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_3 returns 3

Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 6 guests