How does vim4 android configure the camera to be rear-mounted?

@Lexus The code should default to the rear camera. If you want to change the front and rear cameras, try the following modifications:

packages/apps/Camera2$ git diff
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ac939893d..992705e4c 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -169,7 +169,7 @@
     <!-- Settings screen, camera selection dialog title. Users can select a camera from the phone (front-facing or back-facing). [CHAR LIMIT=20] -->
     <string name="pref_camera_id_title">Choose camera</string>
 
-    <string name="pref_camera_id_default" translatable="false">0</string>
+    <string name="pref_camera_id_default" translatable="false">1</string>
1 Like

Thank you very much!!!

Wow, I can’t open the app after verification according to your modification today!

logcat | grep  "CAM"                                           
02-05 02:59:34.779  3362  3362 V CAM_Profiler: [  0.000ms][ui] GUARD: CameraApp onCreate() - START
02-05 02:59:34.779  3362  3362 V CAM_Profiler: [  0.000ms][ui] GUARD: FirstRunDetector getTimeOfFirstRun - START
02-05 02:59:34.780  3362  3362 V CAM_Profiler: [  1.132ms][ui] GUARD: FirstRunDetector getTimeOfFirstRun - [ 1.132ms] PreferenceManager.getDefaultSharedPreferences
02-05 02:59:34.781  3362  3362 V CAM_Profiler: [  1.865ms][ui] GUARD: FirstRunDetector getTimeOfFirstRun - [ 0.732ms] preferences.getLong
02-05 02:59:34.781  3362  3362 V CAM_Profiler: [  2.065ms][ui] GUARD: FirstRunDetector getTimeOfFirstRun - STOP
02-05 02:59:34.781  3362  3362 V CAM_Profiler: [  3.410ms][ui] GUARD: CameraApp onCreate() - [ 3.410ms] initializeTimeOfFirstRun
02-05 02:59:34.781  3362  3362 V CAM_Profiler: [  3.704ms][ui] GUARD: CameraApp onCreate() - [ 0.295ms] UsageStatistics.initialize
02-05 02:59:34.782  3362  3362 V CAM_Profiler: [  4.597ms][ui] GUARD: CameraApp onCreate() - [ 0.893ms] clearNotifications
02-05 02:59:34.783  3362  3362 V CAM_Profiler: [  4.597ms][ui] GUARD: CameraApp onCreate() - STOP
02-05 02:59:34.800  3362  3362 V CAM_QuickActivity: START onCreate: Activity = com.android.camera.CameraActivity@4738277
02-05 02:59:34.801  3362  3362 V CAM_Profiler: [  0.000ms][ui] GUARD: CameraActivity.onCreateTasks - START
02-05 02:59:34.802  3362  3362 D CAM_LocationManager: Using LegacyLocationProvider
02-05 02:59:34.811  3362  3362 D CAM_MemoryManagerImpl: Max native memory: 268 MB
02-05 02:59:34.814  3362  3362 I CAM_OneCamFtrCnfgCrtr: CaptureModule? true
02-05 02:59:34.824  3362  3362 V CAM_Profiler: [ 22.815ms][ui] GUARD: CameraActivity.onCreateTasks - [ 8.632ms] Glide.setup
02-05 02:59:34.825  3362  3362 D CAM_Camera2OneCamMgr: Getting First BACK Camera
02-05 02:59:34.827   443   443 W ServiceManager: Permission failure: android.permission.CAMERA_OPEN_CLOSE_LISTENER from uid=10052 pid=3362
02-05 02:59:34.829  3362  3362 W CAM_Camera2OneCamMgr: No back-facing camera found.
02-05 02:59:34.829  3362  3362 W CAM_Camera2OneCamMgr: No external camera found.
02-05 02:59:34.829  3362  3362 D CAM_Camera2OneCamMgr: Getting First FRONT Camera
02-05 02:59:34.831  3362  3362 V CAM_Profiler: [ 29.310ms][ui] GUARD: CameraActivity.onCreateTasks - [ 6.495ms] OneCameraManager.get
02-05 02:59:34.837   443   443 W ServiceManager: Permission failure: android.permission.SYSTEM_CAMERA from uid=10052 pid=3362
02-05 02:59:34.840   443   443 W ServiceManager: Permission failure: android.permission.SYSTEM_CAMERA from uid=10052 pid=3362
02-05 02:59:34.842  3362  3362 V CAM_Profiler: [ 40.627ms][ui] GUARD: CameraActivity.onCreateTasks - [ 2.237ms] computePictureSizes
02-05 02:59:34.862  3362  3362 W CAM_Log : Tag RoundedThumbnailView is 1 chars longer than limit.
02-05 02:59:34.922  3362  3362 I CAM_Profiler: [120.511ms][ui] GUARD: CameraActivity.onCreateTasks - [76.129ms] setContentView()
02-05 02:59:34.936  3362  3362 V CAM_Profiler: [134.453ms][ui] GUARD: CameraActivity.onCreateTasks - [13.942ms] Configure Camera UI
02-05 02:59:34.946  3362  3362 V CAM_CameraController: Closing camera
02-05 02:59:34.947  3362  3387 W CAM2PORT_AndCamAgntImp: Releasing camera without any camera opened.
02-05 02:59:34.947  3362  3362 V CAM_ModulesInfo: EnableCaptureModule = true
02-05 02:59:34.948  3362  3362 V CAM_Profiler: [  0.000ms][ui] GUARD: new CaptureModule - START
02-05 02:59:34.949  3362  3362 V CAM_Profiler: [  1.359ms][ui] GUARD: new CaptureModule - STOP
02-05 02:59:34.949  3362  3362 V CAM_SettingsManager: listeners: [com.android.camera.app.CameraAppUI@475faa7]
02-05 02:59:34.953  3362  3362 V CAM_SettingsManager: listeners: [com.android.camera.app.CameraAppUI@475faa7, com.android.camera.ButtonManager@c4d48c0]
02-05 02:59:34.953  3362  3362 V CAM_SettingsManager: listeners: [com.android.camera.app.CameraAppUI@475faa7, com.android.camera.ButtonManager@c4d48c0, com.android.camera.widget.IndicatorIconController@6d26d3e]
02-05 02:59:34.954  3362  3362 V CAM_Profiler: [152.609ms][ui] GUARD: CameraActivity.onCreateTasks - [ 4.480ms] Init Current Module UI
02-05 02:59:34.954  3362  3362 V CAM_Profiler: [  0.000ms][ui] GUARD: CaptureModule.init - START
02-05 02:59:34.954  3362  3362 D CAM_CaptureModule: init UseAutotransformUiLayout = false
02-05 02:59:34.956  3362  3362 D CAM_Camera2OneCamMgr: Getting First BACK Camera
02-05 02:59:34.957  3362  3362 W CAM_Camera2OneCamMgr: No back-facing camera found.
02-05 02:59:34.957  3362  3362 W CAM_Camera2OneCamMgr: No external camera found.
02-05 02:59:34.957  3362  3362 D CAM_Camera2OneCamMgr: Getting First FRONT Camera
02-05 03:02:47.413  3989  3989 V CAM_Profiler: [  0.000ms][ui] GUARD: CameraApp onCreate() - START
02-05 03:02:47.413  3989  3989 V CAM_Profiler: [  0.000ms][ui] GUARD: FirstRunDetector getTimeOfFirstRun - START
02-05 03:02:47.414  3989  3989 V CAM_Profiler: [  0.797ms][ui] GUARD: FirstRunDetector getTimeOfFirstRun - [ 0.797ms] PreferenceManager.getDefaultSharedPreferences
02-05 03:02:47.415  3989  3989 V CAM_Profiler: [  1.690ms][ui] GUARD: FirstRunDetector getTimeOfFirstRun - [ 0.893ms] preferences.getLong
02-05 03:02:47.415  3989  3989 V CAM_Profiler: [  1.833ms][ui] GUARD: FirstRunDetector getTimeOfFirstRun - STOP
02-05 03:02:47.415  3989  3989 V CAM_Profiler: [  2.748ms][ui] GUARD: CameraApp onCreate() - [ 2.748ms] initializeTimeOfFirstRun
02-05 03:02:47.415  3989  3989 V CAM_Profiler: [  2.952ms][ui] GUARD: CameraApp onCreate() - [ 0.204ms] UsageStatistics.initialize
02-05 03:02:47.416  3989  3989 V CAM_Profiler: [  3.558ms][ui] GUARD: CameraApp onCreate() - [ 0.606ms] clearNotifications
02-05 03:02:47.416  3989  3989 V CAM_Profiler: [  3.558ms][ui] GUARD: CameraApp onCreate() - STOP
02-05 03:02:47.427  3989  3989 V CAM_QuickActivity: START onCreate: Activity = com.android.camera.CameraActivity@4738277
02-05 03:02:47.429  3989  3989 V CAM_Profiler: [  0.000ms][ui] GUARD: CameraActivity.onCreateTasks - START
02-05 03:02:47.429  3989  3989 D CAM_LocationManager: Using LegacyLocationProvider
02-05 03:02:47.433  3989  3989 D CAM_MemoryManagerImpl: Max native memory: 268 MB
02-05 03:02:47.435  3989  3989 I CAM_OneCamFtrCnfgCrtr: CaptureModule? true
02-05 03:02:47.440  3989  3989 V CAM_Profiler: [ 11.873ms][ui] GUARD: CameraActivity.onCreateTasks - [ 4.169ms] Glide.setup
02-05 03:02:47.441  3989  3989 D CAM_Camera2OneCamMgr: Getting First BACK Camera
02-05 03:02:47.442   443   443 W ServiceManager: Permission failure: android.permission.CAMERA_OPEN_CLOSE_LISTENER from uid=10052 pid=3989
02-05 03:02:47.443  3989  3989 W CAM_Camera2OneCamMgr: No back-facing camera found.
02-05 03:02:47.444  3989  3989 W CAM_Camera2OneCamMgr: No external camera found.
02-05 03:02:47.444  3989  3989 D CAM_Camera2OneCamMgr: Getting First FRONT Camera
02-05 03:02:47.445  3989  3989 V CAM_Profiler: [ 16.386ms][ui] GUARD: CameraActivity.onCreateTasks - [ 4.513ms] OneCameraManager.get
02-05 03:02:47.450   443   443 W ServiceManager: Permission failure: android.permission.SYSTEM_CAMERA from uid=10052 pid=3989
02-05 03:02:47.450   443   443 W ServiceManager: Permission failure: android.permission.SYSTEM_CAMERA from uid=10052 pid=3989
02-05 03:02:47.453   443   443 W ServiceManager: Permission failure: android.permission.SYSTEM_CAMERA from uid=10052 pid=3989
02-05 03:02:47.453   443   443 W ServiceManager: Permission failure: android.permission.SYSTEM_CAMERA from uid=10052 pid=3989
02-05 03:02:47.453   443  1022 W ServiceManager: Permission failure: android.permission.SYSTEM_CAMERA from uid=10052 pid=3989
02-05 03:02:47.453   443  1022 W ServiceManager: Permission failure: android.permission.SYSTEM_CAMERA from uid=10052 pid=3989
02-05 03:02:47.456  3989  3989 V CAM_Profiler: [ 27.211ms][ui] GUARD: CameraActivity.onCreateTasks - [ 3.531ms] computePictureSizes
02-05 03:02:47.472  3989  3989 W CAM_Log : Tag RoundedThumbnailView is 1 chars longer than limit.
02-05 03:02:47.525  3989  3989 I CAM_Profiler: [ 96.100ms][ui] GUARD: CameraActivity.onCreateTasks - [67.720ms] setContentView()
02-05 03:02:47.536  3989  3989 V CAM_Profiler: [106.976ms][ui] GUARD: CameraActivity.onCreateTasks - [10.876ms] Configure Camera UI
02-05 03:02:47.542  3989  3989 V CAM_CameraController: Closing camera
02-05 03:02:47.544  3989  4014 W CAM2PORT_AndCamAgntImp: Releasing camera without any camera opened.
02-05 03:02:47.544  3989  3989 V CAM_ModulesInfo: EnableCaptureModule = true
02-05 03:02:47.545  3989  3989 V CAM_Profiler: [  0.000ms][ui] GUARD: new CaptureModule - START
02-05 03:02:47.546  3989  3989 V CAM_Profiler: [  1.660ms][ui] GUARD: new CaptureModule - STOP
02-05 03:02:47.547  3989  3989 V CAM_SettingsManager: listeners: [com.android.camera.app.CameraAppUI@475faa7]
02-05 03:02:47.550  3989  3989 V CAM_SettingsManager: listeners: [com.android.camera.app.CameraAppUI@475faa7, com.android.camera.ButtonManager@c4d48c0]
02-05 03:02:47.551  3989  3989 V CAM_SettingsManager: listeners: [com.android.camera.app.CameraAppUI@475faa7, com.android.camera.ButtonManager@c4d48c0, com.android.camera.widget.IndicatorIconController@6d26d3e]
02-05 03:02:47.551  3989  3989 V CAM_Profiler: [122.710ms][ui] GUARD: CameraActivity.onCreateTasks - [ 4.687ms] Init Current Module UI
02-05 03:02:47.551  3989  3989 V CAM_Profiler: [  0.000ms][ui] GUARD: CaptureModule.init - START
02-05 03:02:47.551  3989  3989 D CAM_CaptureModule: init UseAutotransformUiLayout = false
02-05 03:02:47.552  3989  3989 D CAM_Camera2OneCamMgr: Getting First BACK Camera
02-05 03:02:47.553  3989  3989 W CAM_Camera2OneCamMgr: No back-facing camera found.
02-05 03:02:47.554  3989  3989 W CAM_Camera2OneCamMgr: No external camera found.
02-05 03:02:47.554  3989  3989 D CAM_Camera2OneCamMgr: Getting First FRONT Camera

hi,
I’m a usb camera!

nice day!!!

@Lexus Then restore the above changes. Then try to modify it as follows.

common$ git diff
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 7d60dd3b0bd8..4811e6ea45ff 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -616,6 +616,8 @@ static int uvc_ioctl_querycap(struct file *file, void *fh,
 
        strscpy(cap->driver, "uvcvideo", sizeof(cap->driver));
        strscpy(cap->card, vdev->name, sizeof(cap->card));
+       strcpy(cap->card,"back");//front
+       printk("======uvc_ioctl_querycap======");
        usb_make_path(stream->dev->udev, cap->bus_info, sizeof(cap->bus_info));
        cap->capabilities = V4L2_CAP_DEVICE_CAPS | V4L2_CAP_STREAMING
                          | chain->caps;

It has been changed, but how do I know that the upper layer has configured it as front or rear?

dmesg | grep "uvc_ioctl_querycap"                                  
[    4.917737] ======uvc_ioctl_querycap======
[    4.930710] ======uvc_ioctl_querycap======
[    8.460550] ======uvc_ioctl_querycap======
[    8.461282] ======uvc_ioctl_querycap======
[   15.440853] ======uvc_ioctl_querycap======
[   15.442885] ======uvc_ioctl_querycap======

@goenjoy ,hi
I checked the hal layer and plugged in my usb camera. The default selection of the printing system is:

else {
          // Default facing external using for cts
          ALOGE("support ANDROID_LENS_FACING_EXTERNAL!");
          lensFacing = ANDROID_LENS_FACING_EXTERNAL;
          mFacingBack = 0;
I tried to configure the system property ro.vendor.camera_ Usb. faceback=true, the result cannot be opened:
hardware/amlogic/camera/v3/EmulatedFakeCamera3.cpp
/*lens facing related camera feature*/
   /*camera feature setting in /device/amlogic/xxx/xxx.mk files*/
   /*in cdd , usb camera is external facing*/
   uint8_t lensFacing = ANDROID_LENS_FACING_BACK;
   switch (mSensorType) {
       case SENSOR_USB :
        property_get("ro.vendor.camera_usb.faceback", property, NULL);
        if (strstr(property, "true")) {
                ALOGE("support ANDROID_LENS_FACING_BACK!");
          lensFacing =  ANDROID_LENS_FACING_BACK;
          mFacingBack = 1;
        } else if (strstr(property, "false")) {
          ALOGE("support ANDROID_LENS_FACING_FRONT!");
          lensFacing = ANDROID_LENS_FACING_FRONT;
          mFacingBack = 0;
        } else {
          // Default facing external using for cts
          ALOGE("support ANDROID_LENS_FACING_EXTERNAL!");
          lensFacing = ANDROID_LENS_FACING_EXTERNAL;
          mFacingBack = 0;
        }
        break;
     case SENSOR_V4L2MEDIA:
     case SENSOR_MIPI:
        property_get("ro.vendor.camera_mipi.faceback", property, NULL);
        if (strstr(property, "true")) {
            mFacingBack = 1;
            lensFacing =  ANDROID_LENS_FACING_BACK;
        } else if (strstr(property, "false")) {
            mFacingBack = 0;
            lensFacing =  ANDROID_LENS_FACING_FRONT;
        } else {
            // Default facing front
            mFacingBack = 0;
            lensFacing =  ANDROID_LENS_FACING_FRONT;
        }

@Lexus The answer to the code you showed has been given. It is estimated that you only need to add an attribute. You can verify it according to the following code:

device/khadas$ git diff
diff --git a/kvim4/kvim4.mk b/kvim4/kvim4.mk
 ifeq ($(BUILD_WITH_GAPPS_CONFIG),true)
@@ -513,4 +514,6 @@ PRODUCT_PACKAGES += \
     android.hardware.gnss@1.0-impl \
     android.hardware.gnss@1.0-service
 
+PRODUCT_PROPERTY_OVERRIDES += \
+    ro.vendor.camera_usb.faceback=true
 #add end

I tried to add this attribute, but I couldn’t open the camera.
There was no camera associated with it.
Must go lensFacing=ANDROID_ LENS_ FACING_ EXTERNAL; ??

Then you can try to modify and verify it.

case SENSOR_USB :
        property_get("ro.vendor.camera_usb.faceback", property, NULL);
        if (strstr(property, "true")) {
                ALOGE("support ANDROID_LENS_FACING_BACK!");
          lensFacing =  ANDROID_LENS_FACING_BACK;
          mFacingBack = 1;
        } else if (strstr(property, "false")) {
          ALOGE("support ANDROID_LENS_FACING_FRONT!");
          lensFacing = ANDROID_LENS_FACING_FRONT;
          mFacingBack = 0;
        } else {
          // Default facing external using for cts
          ALOGE("support ANDROID_LENS_FACING_EXTERNAL!");
          lensFacing = ANDROID_LENS_FACING_EXTERNAL;
-          mFacingBack = 0;
+          mFacingBack = 1;
        }

or

device/khadas$ git diff
diff --git a/kvim4/kvim4.mk b/kvim4/kvim4.mk
 ifeq ($(BUILD_WITH_GAPPS_CONFIG),true)
@@ -513,4 +514,6 @@ PRODUCT_PACKAGES += \
     android.hardware.gnss@1.0-impl \
     android.hardware.gnss@1.0-service
 
+PRODUCT_PROPERTY_OVERRIDES += \
+    ro.vendor.camera_usb.faceback=true
 #add end

case SENSOR_USB :
        property_get("ro.vendor.camera_usb.faceback", property, NULL);
        if (strstr(property, "true")) {
                ALOGE("support ANDROID_LENS_FACING_BACK!");
-          lensFacing =  ANDROID_LENS_FACING_BACK;
+         lensFacing =  ANDROID_LENS_FACING_EXTERNAL;
          mFacingBack = 1;
        } else if (strstr(property, "false")) {
          ALOGE("support ANDROID_LENS_FACING_FRONT!");
          lensFacing = ANDROID_LENS_FACING_FRONT;
          mFacingBack = 0;
        } else {
          // Default facing external using for cts
          ALOGE("support ANDROID_LENS_FACING_EXTERNAL!");
          lensFacing = ANDROID_LENS_FACING_EXTERNAL;
          mFacingBack = 0;
        }

hi @goenjoy ,
According to the modifications given, I have set mFaceingBack=1;

However, I use the camera with qq apk to preview. The default rear opening is black. I click the mode to switch to the front to open it.

This is my dump, display or front shot:

dumpsys media.camera

== Service global info: ==

Number of camera devices: 1
Number of normal camera devices: 1
Number of public camera devices visible to API1: 1
    Device 0 maps to "0"
Active Camera Clients:
[]
Allowed user IDs: 0

== Camera service events log (most recent at top): ==
  01-14 08:57:57 : ADD device 0, reason: (Device added)
  01-14 08:56:58 : REMOVE device 0, reason: (Device status changed from 1 to 0)
  01-14 08:56:57 : USER_SWITCH previous allowed user IDs: <None>, current allowed user IDs: 0
  01-14 08:56:54 : ADD device 0, reason: (Device added)
  01-14 08:56:51 : REMOVE device 0, reason: (Device status changed from 1 to 0)
  01-14 08:56:50 : ADD device 0, reason: (Device added)

== Camera device 0 dynamic info: ==
  Device 0 is closed, no client instance
== Camera Provider HAL legacy/0 (v2.5, remote) static info: 1 devices: ==
== Camera HAL device device@3.3/legacy/0 (v3.3) static information: ==
  Resource cost: 0
  Conflicting devices: None
  API1 info:
    Has a flash unit: false
    Facing: Front
    Orientation: 0
  API2 camera characteristics:
    Dumping camera metadata array: 85 / 85 entries, 2104 / 2104 bytes of extra data.
      Version: 1, Flags: 00000000
      android.lens.info.minimumFocusDistance (90005): float[1]
        [0.00000000 ]
      android.lens.info.hyperfocalDistance (90004): float[1]
        [0.00000000 ]
      android.lens.info.availableFocalLengths (90002): float[1]
        [-1.00000000 ]
      android.lens.info.availableApertures (90000): float[1]
        [2.79999995 ]
      android.lens.info.availableFilterDensities (90001): float[1]
        [0.00000000 ]
      android.lens.info.availableOpticalStabilization (90003): byte[1]
        [0 ]
      android.lens.info.shadingMapSize (90006): int32[2]
        [1 1 ]
      android.lens.facing (80005): byte[1]
        [EXTERNAL ]
      android.lens.info.focusDistanceCalibration (90007): byte[1]
        [UNCALIBRATED ]
      android.sensor.availableTestPatternModes (e0019): int32[1]
        [0 ]
      android.sensor.testPatternMode (e0018): int32[1]
        [OFF ]
      android.sensor.info.exposureTimeRange (f0003): int64[2]
        [1000 30000000000 ]
      android.sensor.info.maxFrameDuration (f0004): int64[1]
        [30000000000 ]
      android.sensor.info.sensitivityRange (f0001): int32[2]
        [100 1600 ]
      android.sensor.info.colorFilterArrangement (f0002): byte[1]
        [RGGB ]
      android.sensor.info.physicalSize (f0005): float[2]
        [3.20000005 2.40000010 ]
      android.sensor.info.whiteLevel (f0007): int32[1]
        [4000 ]
      android.sensor.blackLevelPattern (e000c): int32[4]
        [1000 1000 1000 1000 ]
      android.sensor.info.timestampSource (f0008): byte[1]
        [UNKNOWN ]
      android.sensor.orientation (e000e): int32[1]
        [0 ]
      android.sensor.rollingShutterSkew (e001a): int64[1]
        [0 ]
      android.flash.info.available (50000): byte[1]
        [FALSE ]
      android.flash.state (40005): byte[1]
        [UNAVAILABLE ]
      android.flash.info.chargeDuration (50001): int64[1]
        [0 ]
      android.noiseReduction.availableNoiseReductionModes (a0002): byte[1]
        [0 ]
      android.tonemap.availableToneMapModes (130005): byte[2]
        [1 2 ]
      android.tonemap.maxCurvePoints (130004): int32[1]
        [128 ]
      android.scaler.croppingType (d000d): byte[1]
        [CENTER_ONLY ]
      android.scaler.availableFormats (d0001): int32[5]
        [BLOB IMPLEMENTATION_DEFINED YV12 YCrCb_420_SP ]
        [YCbCr_420_888 ]
      android.scaler.availableRawMinDurations (d0007): int64[1]
        [33331760 ]
      android.scaler.availableStreamConfigurations (d000a): int32[56]
        [34 1920 1080 OUTPUT ]
        [34 1280 720 OUTPUT ]
        [34 720 576 OUTPUT ]
        [34 640 480 OUTPUT ]
        [34 320 240 OUTPUT ]
        [35 1920 1080 OUTPUT ]
        [35 1280 720 OUTPUT ]
        [35 720 576 OUTPUT ]
        [35 640 480 OUTPUT ]
        [35 320 240 OUTPUT ]
        [33 1920 1080 OUTPUT ]
        [33 1280 720 OUTPUT ]
        [33 640 480 OUTPUT ]
        [33 320 240 OUTPUT ]
      android.sensor.info.activeArraySize (f0000): int32[4]
        [0 0 1920 1080 ]
      android.sensor.info.pixelArraySize (f0006): int32[2]
        [1920 1080 ]
      android.scaler.availableMinFrameDurations (d000b): int64[56]
        [33 320 ]
        [240 33333333 ]
        [33 640 ]
        [480 33333333 ]
        [33 1280 ]
        [720 33333333 ]
        [33 1920 ]
        [1080 33333333 ]
        [35 320 ]
        [240 33333333 ]
        [35 640 ]
        [480 33333333 ]
        [35 720 ]
        [576 33333333 ]
        [35 1280 ]
        [720 33333333 ]
        [35 1920 ]
        [1080 33333333 ]
        [34 320 ]
        [240 33333333 ]
        [34 640 ]
        [480 33333333 ]
        [34 720 ]
        [576 33333333 ]
        [34 1280 ]
        [720 33333333 ]
        [34 1920 ]
        [1080 33333333 ]
      android.scaler.availableStallDurations (d000c): int64[56]
        [33 320 ]
        [240 33333333 ]
        [33 640 ]
        [480 33333333 ]
        [33 1280 ]
        [720 33333333 ]
        [33 1920 ]
        [1080 33333333 ]
        [35 320 ]
        [240 0 ]
        [35 640 ]
        [480 0 ]
        [35 720 ]
        [576 0 ]
        [35 1280 ]
        [720 0 ]
        [35 1920 ]
        [1080 0 ]
        [34 320 ]
        [240 0 ]
        [34 640 ]
        [480 0 ]
        [34 720 ]
        [576 0 ]
        [34 1280 ]
        [720 0 ]
        [34 1920 ]
        [1080 0 ]
      android.scaler.availableProcessedMinDurations (d0005): int64[1]
        [33331760 ]
      android.scaler.availableJpegMinDurations (d0002): int64[1]
        [33331760 ]
      android.jpeg.availableThumbnailSizes (70007): int32[8]
        [0 0 128 72 ]
        [160 120 320 240 ]
      android.jpeg.maxSize (70008): int32[1]
        [8000000 ]
      android.statistics.info.availableFaceDetectModes (120000): byte[3]
        [0 1 2 ]
      android.statistics.info.maxFaceCount (120002): int32[1]
        [8 ]
      android.statistics.info.histogramBucketCount (120001): int32[1]
        [64 ]
      android.statistics.info.maxHistogramCount (120003): int32[1]
        [1000 ]
      android.statistics.info.sharpnessMapSize (120005): int32[2]
        [64 64 ]
      android.statistics.info.maxSharpnessMapValue (120004): int32[1]
        [1000 ]
      android.statistics.hotPixelMapMode (110003): byte[1]
        [OFF ]
      android.statistics.sceneFlicker (11000e): byte[1]
        [NONE ]
      android.statistics.lensShadingMapMode (110010): byte[1]
        [OFF ]
      android.control.sceneMode (10010): byte[1]
        [FACE_PRIORITY ]
      android.control.availableSceneModes (10019): byte[1]
        [1 ]
      android.control.availableEffects (10018): byte[1]
        [0 ]
      android.control.maxRegions (1001c): int32[3]
        [0 0 0 ]
      android.control.aeAvailableModes (10013): byte[2]
        [0 1 ]
      android.control.aeAvailableTargetFpsRanges (10014): int32[16]
        [5 15 15 15 ]
        [5 20 20 20 ]
        [5 25 25 25 ]
        [5 30 30 30 ]
      android.control.awbAvailableModes (1001b): byte[6]
        [0 1 2 3 5 8 ]
      android.control.afState (10020): byte[1]
        [INACTIVE ]
      android.control.afAvailableModes (10017): byte[1]
        [0 ]
      android.control.aeAvailableAntibandingModes (10012): byte[2]
        [0 3 ]
      android.control.aeExposureCompensation (10001): int32[1]
        [0 ]
      android.control.aeCompensationStep (10016): rational[1]
        [(1 / 3) ]
      android.control.aeCompensationRange (10015): int32[2]
        [-6 6 ]
      android.scaler.availableMaxDigitalZoom (d0004): float[1]
        [1.00000000 ]
      android.control.availableVideoStabilizationModes (1001a): byte[1]
        [0 ]
      android.control.aeState (1001f): byte[1]
        [CONVERGED ]
      android.control.awbState (10022): byte[1]
        [INACTIVE ]
      android.info.supportedHardwareLevel (150000): byte[1]
        [EXTERNAL ]
      android.sync.maxLatency (170001): int32[1]
        [UNKNOWN ]
      android.request.pipelineDepth (c0009): byte[1]
        [1 ]
      android.request.pipelineMaxDepth (c000a): byte[1]
        [4 ]
      android.request.availableCapabilities (c000c): byte[1]
        [BACKWARD_COMPATIBLE ]
      android.request.partialResultCount (c000b): int32[1]
        [1 ]
      android.request.maxNumOutputStreams (c0006): int32[3]
        [0 2 1 ]
      android.colorCorrection.aberrationMode (00003): byte[1]
        [OFF ]
      android.colorCorrection.availableAberrationModes (00004): byte[1]
        [0 ]
      android.request.availableCharacteristicsKeys (c000f): int32[38]
        [4 65554 65555 65556 ]
        [65557 65558 65559 65560 ]
        [65561 65562 65563 327680 ]
        [1376256 458759 524293 589826 ]
        [655362 786444 786443 786442 ]
        [851972 851981 917529 983040 ]
        [983045 983046 983048 917518 ]
        [1179648 1179650 1507329 65572 ]
        [65573 65574 1048578 1179655 ]
        [983050 65582 ]
      android.request.availableRequestKeys (c000d): int32[61]
        [4 65554 65555 65556 ]
        [65557 65558 65559 65560 ]
        [65561 65562 65563 327680 ]
        [1376256 458759 524293 589826 ]
        [655362 786444 786443 786442 ]
        [851972 851981 917529 983040 ]
        [983045 983046 983048 917518 ]
        [1179648 1179650 1507329 65539 ]
        [65543 65547 65551 65553 ]
        [1114112 3 655360 65536 ]
        [65537 65538 65539 65541 ]
        [65543 65545 65546 65547 ]
        [65549 65550 65551 65552 ]
        [65553 262146 458755 458756 ]
        [458757 458758 851968 1114112 ]
        [65583 ]
      android.request.availableResultKeys (c000e): int32[61]
        [4 65554 65555 65556 ]
        [65557 65558 65559 65560 ]
        [65561 65562 65563 327680 ]
        [1376256 458759 524293 589826 ]
        [655362 786444 786443 786442 ]
        [851972 851981 917529 983040 ]
        [983045 983046 983048 917518 ]
        [1179648 1179650 1507329 65539 ]
        [65543 65547 65551 65553 ]
        [1114112 3 655360 65536 ]
        [65537 65538 65539 65541 ]
        [65543 65545 65546 65547 ]
        [65549 65550 65551 65552 ]
        [65553 262146 458755 458756 ]
        [458757 458758 851968 1114112 ]
        [65583 ]
      android.control.aeLockAvailable (10024): byte[1]
        [TRUE ]
      android.control.awbLockAvailable (10025): byte[1]
        [TRUE ]
      android.control.availableModes (10026): byte[3]
        [1 2 0 ]
      android.shading.availableModes (100002): byte[2]
        [1 2 ]
      android.statistics.info.availableLensShadingMapModes (120007): byte[1]
        [0 ]
      android.scaler.availableRotateAndCropModes (d0010): byte[1]
        [0 ]
      android.sensor.info.preCorrectionActiveArraySize (f000a): int32[4]
        [0 0 1920 1080 ]
      android.control.zoomRatioRange (1002e): float[2]
        [1.00000000 1.00000000 ]
== Camera HAL device device@3.3/legacy/0 (v3.3) dumpState: ==
No active camera device session instance

== Vendor tags: ==

  Dumping vendor tag descriptors for vendor with id 3854507339 
  Dumping configured vendor tag descriptors: 16 entries
    0x80000000 (aperture) with type 2 (float) defined in section android.lens
    0x80000001 (filterDensity) with type 2 (float) defined in section android.lens
    0x80000002 (focalLength) with type 2 (float) defined in section android.lens
    0x80000003 (focusDistance) with type 2 (float) defined in section android.lens
    0x80000004 (opticalStabilizationMode) with type 0 (byte) defined in section android.lens
    0x80000005 (facing) with type 0 (byte) defined in section android.lens
    0x80000006 (focusRange) with type 2 (float) defined in section android.lens
    0x80000007 (state) with type 0 (byte) defined in section android.lens
    0x80010000 (availableApertures) with type 2 (float) defined in section android.lens.info
    0x80010001 (availableFilterDensities) with type 2 (float) defined in section android.lens.info
    0x80010002 (availableFocalLengths) with type 2 (float) defined in section android.lens.info
    0x80010003 (availableOpticalStabilization) with type 0 (byte) defined in section android.lens.info
    0x80010004 (hyperfocalDistance) with type 2 (float) defined in section android.lens.info
    0x80010005 (minimumFocusDistance) with type 2 (float) defined in section android.lens.info
    0x80010006 (shadingMapSize) with type 1 (int32) defined in section android.lens.info
    0x80010007 (focusDistanceCalibration) with type 0 (byte) defined in section android.lens.info

== Camera error traces (0): ==
  No camera traces collected.

I added the print, and I did run to ANDROID_ LENS_ FACING_ EXTERNAL branch selection.

logcat | grep "support ANDROID_LENS_FACIN"     
01-14 09:34:02.965   381   484 E EmulatedCamera_FakeCamera3: support ANDROID_LENS_FACING_EXTERNAL!

@goenjoy ,hello
Excuse me, Excuse me, how can the configuration take effect to make the camera a rear camera?

@Lexus Because my code is the latest and has changed a lot of things. The latest version of the code was uploaded to github yesterday. I just verified with the vim4-android-11-64bit-v221228 version of firmware. When I plug in the USB camera and open it with the camera application that comes with the system, the default is the rear camera.

In addition, as I said before, the Android code itself opens the rear camera by default. I suspect you have reversed the front and rear.

@goenjoy

property_get("ro.vendor.camera_usb.faceback", property, NULL);
        if (strstr(property, "true")) {
                ALOGE("support ANDROID_LENS_FACING_BACK!");
          lensFacing =  ANDROID_LENS_FACING_BACK;
          mFacingBack = 1;
device/khadas$ git diff
diff --git a/kvim4/kvim4.mk b/kvim4/kvim4.mk
 ifeq ($(BUILD_WITH_GAPPS_CONFIG),true)
@@ -513,4 +514,6 @@ PRODUCT_PACKAGES += \
     android.hardware.gnss@1.0-impl \
     android.hardware.gnss@1.0-service
 
+PRODUCT_PROPERTY_OVERRIDES += \
+    ro.vendor.camera_usb.faceback=true
 #add end

I just tested it and found that there is a problem with the system’s own apk to test the rear camera.
It is normal for me to test with qq apk camera.

 dumpsys media.camera

== Service global info: ==

Number of camera devices: 1
Number of normal camera devices: 1
Number of public camera devices visible to API1: 1
    Device 0 maps to "0"
Active Camera Clients:
[]
Allowed user IDs: 0

== Camera service events log (most recent at top): ==
  01-14 13:22:29 : ADD device 0, reason: (Device added)
  01-14 11:41:20 : REMOVE device 0, reason: (Device status changed from 1 to 0)
  01-14 11:41:19 : USER_SWITCH previous allowed user IDs: <None>, current allowed user IDs: 0
  01-01 08:00:09 : ADD device 0, reason: (Device added)
  01-01 08:00:06 : REMOVE device 0, reason: (Device status changed from 1 to 0)
  01-01 08:00:06 : ADD device 0, reason: (Device added)
  01-01 08:00:06 : ADD device 0, reason: (Device added)

== Camera device 0 dynamic info: ==
  Device 0 is closed, no client instance
== Camera Provider HAL legacy/0 (v2.5, remote) static info: 1 devices: ==
== Camera HAL device device@3.3/legacy/0 (v3.3) static information: ==
  Resource cost: 0
  Conflicting devices: None
  API1 info:
    Has a flash unit: false
    Facing: Back
    Orientation: 0
  API2 camera characteristics:

What does the system apk need to change to test the rear camera?
You can execute:

dumpsys media.camera

's message to me?

@Lexus


As I said before, the Android code defaults to the rear camera. I verified that there is no problem with the apk provided by the system. If you have made the above changes, please restore it back.

You can execute:

dumpsys media.camera

's message to me?
Let me see!!!

@Lexus

VIM4:/ # dumpsys media.camera

== Service global info: ==

Number of camera devices: 1
Number of normal camera devices: 1
Number of public camera devices visible to API1: 1
    Device 0 maps to "0"
Active Camera Clients:
[
(Camera ID: 0, Cost: 0, PID: 4761, Score: 0, State: 2User Id: 0, Client Package Name: com.android.camera2, Conflicting Client Devices: {})
]
Allowed user IDs: 0

== Camera service events log (most recent at top): ==
  01-14 06:29:44 : CONNECT device 0 client for package com.android.camera2 (PID 4761)
  01-14 06:29:41 : DISCONNECT device 0 client for package com.android.camera2 (PID 4761)
  01-14 06:29:41 : CONNECT device 0 client for package com.android.camera2 (PID 4761)
  12-28 10:06:26 : USER_SWITCH previous allowed user IDs: <None>, current allowed user IDs: 0
  01-01 12:00:18 : ADD device 0, reason: (Device added)
  01-01 12:00:18 : ADD device 0, reason: (Device added)

== Camera device 0 dynamic info: ==
  Camera1 API shim is using parameters:
        CameraParameters::dump: mMap.size = 56
        antibanding: auto
        antibanding-values: off,auto
        auto-exposure-lock: false
        auto-exposure-lock-supported: true
        auto-whitebalance-lock: false
        auto-whitebalance-lock-supported: true
        effect: none
        effect-values: none
        exposure-compensation: 0
        exposure-compensation-step: 0.333333
        focal-length: -1
        focus-areas: (0,0,0,0,0)
        focus-distances: Infinity,Infinity,Infinity
        focus-mode: fixed
        focus-mode-values: fixed
        horizontal-view-angle: -1
        jpeg-quality: 90
        jpeg-thumbnail-height: 72
        jpeg-thumbnail-quality: 90
        jpeg-thumbnail-size-values: 0x0,128x72,160x120,320x240
        jpeg-thumbnail-width: 128
        max-exposure-compensation: 6
        max-num-detected-faces-hw: 8
        max-num-detected-faces-sw: 0
        max-num-focus-areas: 0
        max-num-metering-areas: 0
        metering-areas: (0,0,0,0,0)
        min-exposure-compensation: -6
        picture-format: jpeg
        picture-format-values: jpeg
        picture-size: 1920x1080
        picture-size-values: 1920x1080,1280x720,1024x768,640x480,352x288,320x240
        preferred-preview-size-for-video: 1920x1080
        preview-format: yuv420sp
        preview-format-values: yuv420p,yuv420sp
        preview-fps-range: 5000,30000
        preview-fps-range-values: (5000,15000),(15000,15000),(5000,20000),(20000,20000),(5000,25000),(25000,25000),(5000,30000),(30000,30000)
        preview-frame-rate: 30
        preview-frame-rate-values: 15,20,25,30
        preview-size: 1920x1080
        preview-size-values: 1920x1080,1280x800,1280x720,1024x768,800x600,848x480,640x480,640x360,352x288,320x240,176x144,160x120
        recording-hint: false
        rotation: 0
        scene-mode: auto
        scene-mode-values: auto,
        smooth-zoom-supported: false
        vertical-view-angle: -1
        video-frame-format: android-opaque
        video-size: 1920x1080
        video-size-values: 1920x1080,1280x800,1280x720,1024x768,800x600,848x480,640x480,640x360,352x288,320x240,176x144,160x120
        video-snapshot-supported: true
        video-stabilization: false
        video-stabilization-supported: false
        whitebalance: auto
        whitebalance-values: auto,incandescent,fluorescent,daylight,shade
        zoom-supported: false
  Device 0 is open. Client instance dump:
    Client priority score: 0 state: 2
    Client PID: 4761
    Client package: com.android.camera2
  CameraDeviceClient[0] (0xea9c08b0) dump:
    Current client UID 10048
    State:
      Request ID counter: 1
      No input stream configured.
      Current output stream/surface IDs:
        Stream 1 Surface 0
        Stream 0 Surface 0
    Latest received frame:
      Dumping camera metadata array: 73 / 73 entries, 304 / 304 bytes of extra data.
        Version: 1, Flags: 00000000
        android.colorCorrection.mode (00000): byte[1]
          [FAST ]
        android.colorCorrection.transform (00001): rational[9]
          [(1 / 1) (0 / 1) ]
          [(0 / 1) (0 / 1) ]
          [(1 / 1) (0 / 1) ]
          [(0 / 1) (0 / 1) ]
          [(1 / 1) ]
        android.colorCorrection.aberrationMode (00003): byte[1]
          [OFF ]
        android.control.aeAntibandingMode (10000): byte[1]
          [AUTO ]
        android.control.aeExposureCompensation (10001): int32[1]
          [0 ]
        android.control.aeLock (10002): byte[1]
          [OFF ]
        android.control.aeMode (10003): byte[1]
          [ON ]
        android.control.aeRegions (10004): int32[5]
          [0 0 0 0 ]
          [0 ]
        android.control.aeTargetFpsRange (10005): int32[2]
          [30 30 ]
        android.control.aePrecaptureTrigger (10006): byte[1]
          [IDLE ]
        android.control.afMode (10007): byte[1]
          [AUTO ]
        android.control.afRegions (10008): int32[5]
          [0 0 0 0 ]
          [0 ]
        android.control.afTrigger (10009): byte[1]
          [IDLE ]
        android.control.awbLock (1000a): byte[1]
          [OFF ]
        android.control.awbMode (1000b): byte[1]
          [AUTO ]
        android.control.captureIntent (1000d): byte[1]
          [PREVIEW ]
        android.control.effectMode (1000e): byte[1]
          [OFF ]
        android.control.mode (1000f): byte[1]
          [USE_SCENE_MODE ]
        android.control.sceneMode (10010): byte[1]
          [FACE_PRIORITY ]
        android.control.videoStabilizationMode (10011): byte[1]
          [OFF ]
        android.control.aeState (1001f): byte[1]
          [CONVERGED ]
        android.control.afState (10020): byte[1]
          [INACTIVE ]
        android.control.afTriggerId (10021): int32[1]
          [0 ]
        android.control.awbState (10022): byte[1]
          [CONVERGED ]
        android.demosaic.mode (20000): byte[1]
          [FAST ]
        android.edge.mode (30000): byte[1]
          [FAST ]
        android.edge.strength (30001): byte[1]
          [5 ]
        android.flash.firingPower (40000): byte[1]
          [10 ]
        android.flash.firingTime (40001): int64[1]
          [0 ]
        android.flash.mode (40002): byte[1]
          [OFF ]
        android.flash.state (40005): byte[1]
          [UNAVAILABLE ]
        android.hotPixel.mode (60000): byte[1]
          [FAST ]
        android.jpeg.gpsCoordinates (70000): double[3]
          [0.00000000 0.00000000 0.00000000 ]
        android.jpeg.gpsProcessingMethod (70001): byte[32]
          [78 111 110 101 0 0 0 0 0 0 0 0 0 0 0 0 ]
          [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ]
        android.jpeg.gpsTimestamp (70002): int64[1]
          [0 ]
        android.jpeg.orientation (70003): int32[1]
          [0 ]
        android.jpeg.quality (70004): byte[1]
          [80 ]
        android.jpeg.thumbnailQuality (70005): byte[1]
          [80 ]
        android.jpeg.thumbnailSize (70006): int32[2]
          [320 240 ]
        android.lens.aperture (80000): float[1]
          [2.79999995 ]
        android.lens.filterDensity (80001): float[1]
          [0.00000000 ]
        android.lens.focalLength (80002): float[1]
          [-1.00000000 ]
        android.lens.focusDistance (80003): float[1]
          [0.00000000 ]
        android.lens.opticalStabilizationMode (80004): byte[1]
          [OFF ]
        android.noiseReduction.mode (a0000): byte[1]
          [OFF ]
        android.noiseReduction.strength (a0001): byte[1]
          [5 ]
        android.noiseReduction.availableNoiseReductionModes (a0002): byte[1]
          [0 ]
        android.request.frameCount (c0000): int32[1]
          [427 ]
        android.request.id (c0001): int32[1]
          [0 ]
        android.request.metadataMode (c0003): byte[1]
          [FULL ]
        android.request.type (c0005): byte[1]
          [CAPTURE ]
        android.request.pipelineDepth (c0009): byte[1]
          [3 ]
        android.scaler.cropRegion (d0000): int32[4]
          [0 0 1920 1080 ]
        android.scaler.croppingType (d000d): byte[1]
          [CENTER_ONLY ]
        android.sensor.exposureTime (e0000): int64[1]
          [34584572 ]
        android.sensor.frameDuration (e0001): int64[1]
          [33333333 ]
        android.sensor.sensitivity (e0002): int32[1]
          [100 ]
        android.sensor.timestamp (e0010): int64[1]
          [394178141712 ]
        android.sensor.testPatternMode (e0018): int32[1]
          [OFF ]
        android.sensor.availableTestPatternModes (e0019): int32[1]
          [0 ]
        android.sensor.rollingShutterSkew (e001a): int64[1]
          [0 ]
        android.shading.mode (100000): byte[1]
          [FAST ]
        android.statistics.faceDetectMode (110000): byte[1]
          [FULL ]
        android.statistics.histogramMode (110001): byte[1]
          [OFF ]
        android.statistics.sharpnessMapMode (110002): byte[1]
          [OFF ]
        android.statistics.hotPixelMapMode (110003): byte[1]
          [OFF ]
        android.statistics.sceneFlicker (11000e): byte[1]
          [NONE ]
        android.statistics.lensShadingMapMode (110010): byte[1]
          [OFF ]
        android.tonemap.curveBlue (130000): float[4]
          [0.00000000 0.00000000 1.00000000 1.00000000 ]
        android.tonemap.curveGreen (130001): float[4]
          [0.00000000 0.00000000 1.00000000 1.00000000 ]
        android.tonemap.curveRed (130002): float[4]
          [0.00000000 0.00000000 1.00000000 1.00000000 ]
        android.tonemap.mode (130003): byte[1]
          [FAST ]
        android.control.zoomRatio (1002f): float[1]
          [1.00000000 ]
  Device dump:
    Device status: ACTIVE
    Stream configuration:
    Operation mode: NORMAL (0)
      No input stream.
    Stream[0]: Output
      Consumer name: ImageReader-1920x1080f100m15-4761-0
      State: 4
      Dims: 1920 x 1080, format 0x21, dataspace 0x8c20000
      Max size: 8000000
      Combined usage: 131075, max HAL buffers: 4
      Frames produced: 0, last timestamp: 0 ns
      Total buffers: 19, currently dequeued: 0
    Stream[1]: Output
      Consumer name: SurfaceTexture-0-4761-0
      State: 4
      Dims: 1920 x 1080, format 0x11, dataspace 0x0
      Max size: 0
      Combined usage: 131328, max HAL buffers: 4
      Frames produced: 428, last timestamp: 394178141712 ns
      Total buffers: 6, currently dequeued: 2
      DequeueBuffer latency histogram: (430) samples
        5     10     15     20     25     30     35     40     45    inf (max ms)
     99.30   0.47   0.23   0.00   0.00   0.00   0.00   0.00   0.00   0.00 (%)
    Camera3 Buffer Manager:
      Total stream sets: 0
    In-flight requests:
      Frame 428 |  Timestamp: 394235878129, metadata arrived: false, buffers left: 1
      Frame 429 |  Timestamp: 0, metadata arrived: false, buffers left: 1
    ProcessCaptureRequest latency histogram: (429) samples
       40     80    120    160    200    240    280    320    360    inf (max ms)
     8.16   62.47   23.78   3.26   0.93   1.40   0.00   0.00   0.00   0.00 (%)
    Last request sent:
      Dumping camera metadata array: 70 / 70 entries, 296 / 296 bytes of extra data.
        Version: 1, Flags: 00000001
        android.colorCorrection.mode (00000): byte[1]
          [FAST ]
        android.colorCorrection.transform (00001): rational[9]
          [(1 / 1) (0 / 1) ]
          [(0 / 1) (0 / 1) ]
          [(1 / 1) (0 / 1) ]
          [(0 / 1) (0 / 1) ]
          [(1 / 1) ]
        android.colorCorrection.aberrationMode (00003): byte[1]
          [OFF ]
        android.control.aeAntibandingMode (10000): byte[1]
          [AUTO ]
        android.control.aeExposureCompensation (10001): int32[1]
          [0 ]
        android.control.aeLock (10002): byte[1]
          [OFF ]
        android.control.aeMode (10003): byte[1]
          [ON ]
        android.control.aeRegions (10004): int32[5]
          [0 0 0 0 ]
          [0 ]
        android.control.aeTargetFpsRange (10005): int32[2]
          [30 30 ]
        android.control.aePrecaptureTrigger (10006): byte[1]
          [IDLE ]
        android.control.afMode (10007): byte[1]
          [AUTO ]
        android.control.afRegions (10008): int32[5]
          [0 0 0 0 ]
          [0 ]
        android.control.afTrigger (10009): byte[1]
          [IDLE ]
        android.control.awbLock (1000a): byte[1]
          [OFF ]
        android.control.awbMode (1000b): byte[1]
          [AUTO ]
        android.control.captureIntent (1000d): byte[1]
          [PREVIEW ]
        android.control.effectMode (1000e): byte[1]
          [OFF ]
        android.control.mode (1000f): byte[1]
          [USE_SCENE_MODE ]
        android.control.sceneMode (10010): byte[1]
          [FACE_PRIORITY ]
        android.control.videoStabilizationMode (10011): byte[1]
          [OFF ]
        android.control.aeState (1001f): byte[1]
          [CONVERGED ]
        android.control.afState (10020): byte[1]
          [INACTIVE ]
        android.control.afTriggerId (10021): int32[1]
          [0 ]
        android.control.awbState (10022): byte[1]
          [INACTIVE ]
        android.demosaic.mode (20000): byte[1]
          [FAST ]
        android.edge.mode (30000): byte[1]
          [FAST ]
        android.edge.strength (30001): byte[1]
          [5 ]
        android.flash.firingPower (40000): byte[1]
          [10 ]
        android.flash.firingTime (40001): int64[1]
          [0 ]
        android.flash.mode (40002): byte[1]
          [OFF ]
        android.flash.state (40005): byte[1]
          [UNAVAILABLE ]
        android.hotPixel.mode (60000): byte[1]
          [FAST ]
        android.jpeg.gpsCoordinates (70000): double[3]
          [0.00000000 0.00000000 0.00000000 ]
        android.jpeg.gpsProcessingMethod (70001): byte[32]
          [78 111 110 101 0 0 0 0 0 0 0 0 0 0 0 0 ]
          [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ]
        android.jpeg.gpsTimestamp (70002): int64[1]
          [0 ]
        android.jpeg.orientation (70003): int32[1]
          [0 ]
        android.jpeg.quality (70004): byte[1]
          [80 ]
        android.jpeg.thumbnailQuality (70005): byte[1]
          [80 ]
        android.jpeg.thumbnailSize (70006): int32[2]
          [320 240 ]
        android.lens.aperture (80000): float[1]
          [2.79999995 ]
        android.lens.filterDensity (80001): float[1]
          [0.00000000 ]
        android.lens.focalLength (80002): float[1]
          [-1.00000000 ]
        android.lens.focusDistance (80003): float[1]
          [0.00000000 ]
        android.lens.opticalStabilizationMode (80004): byte[1]
          [OFF ]
        android.noiseReduction.mode (a0000): byte[1]
          [OFF ]
        android.noiseReduction.strength (a0001): byte[1]
          [5 ]
        android.noiseReduction.availableNoiseReductionModes (a0002): byte[1]
          [0 ]
        android.request.frameCount (c0000): int32[1]
          [0 ]
        android.request.id (c0001): int32[1]
          [0 ]
        android.request.metadataMode (c0003): byte[1]
          [FULL ]
        android.request.type (c0005): byte[1]
          [CAPTURE ]
        android.scaler.cropRegion (d0000): int32[4]
          [0 0 1920 1080 ]
        android.scaler.croppingType (d000d): byte[1]
          [CENTER_ONLY ]
        android.sensor.exposureTime (e0000): int64[1]
          [10000000 ]
        android.sensor.frameDuration (e0001): int64[1]
          [33333333 ]
        android.sensor.sensitivity (e0002): int32[1]
          [100 ]
        android.sensor.testPatternMode (e0018): int32[1]
          [OFF ]
        android.sensor.availableTestPatternModes (e0019): int32[1]
          [0 ]
        android.sensor.rollingShutterSkew (e001a): int64[1]
          [0 ]
        android.shading.mode (100000): byte[1]
          [FAST ]
        android.statistics.faceDetectMode (110000): byte[1]
          [FULL ]
        android.statistics.histogramMode (110001): byte[1]
          [OFF ]
        android.statistics.sharpnessMapMode (110002): byte[1]
          [OFF ]
        android.statistics.hotPixelMapMode (110003): byte[1]
          [OFF ]
        android.statistics.sceneFlicker (11000e): byte[1]
          [NONE ]
        android.statistics.lensShadingMapMode (110010): byte[1]
          [OFF ]
        android.tonemap.curveBlue (130000): float[4]
          [0.00000000 0.00000000 1.00000000 1.00000000 ]
        android.tonemap.curveGreen (130001): float[4]
          [0.00000000 0.00000000 1.00000000 1.00000000 ]
        android.tonemap.curveRed (130002): float[4]
          [0.00000000 0.00000000 1.00000000 1.00000000 ]
        android.tonemap.mode (130003): byte[1]
          [FAST ]
     Tag monitoring disabled (enable with -m <name1,..,nameN>)
     HAL device dump:
== Camera Provider HAL legacy/0 (v2.5, remote) static info: 1 devices: ==
== Camera HAL device device@3.3/legacy/0 (v3.3) static information: ==
  Resource cost: 0
  Conflicting devices: None
  API1 info:
    Has a flash unit: false
    Facing: Back
    Orientation: 0
  API2 camera characteristics:
    Dumping camera metadata array: 85 / 85 entries, 3384 / 3384 bytes of extra data.
      Version: 1, Flags: 00000000
      android.lens.info.minimumFocusDistance (90005): float[1]
        [0.00000000 ]
      android.lens.info.hyperfocalDistance (90004): float[1]
        [0.00000000 ]
      android.lens.info.availableFocalLengths (90002): float[1]
        [-1.00000000 ]
      android.lens.info.availableApertures (90000): float[1]
        [2.79999995 ]
      android.lens.info.availableFilterDensities (90001): float[1]
        [0.00000000 ]
      android.lens.info.availableOpticalStabilization (90003): byte[1]
        [0 ]
      android.lens.info.shadingMapSize (90006): int32[2]
        [1 1 ]
      android.lens.facing (80005): byte[1]
        [BACK ]
      android.lens.info.focusDistanceCalibration (90007): byte[1]
        [UNCALIBRATED ]
      android.sensor.availableTestPatternModes (e0019): int32[1]
        [0 ]
      android.sensor.testPatternMode (e0018): int32[1]
        [OFF ]
      android.sensor.info.exposureTimeRange (f0003): int64[2]
        [1000 30000000000 ]
      android.sensor.info.maxFrameDuration (f0004): int64[1]
        [30000000000 ]
      android.sensor.info.sensitivityRange (f0001): int32[2]
        [100 1600 ]
      android.sensor.info.colorFilterArrangement (f0002): byte[1]
        [RGGB ]
      android.sensor.info.physicalSize (f0005): float[2]
        [3.20000005 2.40000010 ]
      android.sensor.info.whiteLevel (f0007): int32[1]
        [4000 ]
      android.sensor.blackLevelPattern (e000c): int32[4]
        [1000 1000 1000 1000 ]
      android.sensor.info.timestampSource (f0008): byte[1]
        [UNKNOWN ]
      android.sensor.orientation (e000e): int32[1]
        [0 ]
      android.sensor.rollingShutterSkew (e001a): int64[1]
        [0 ]
      android.flash.info.available (50000): byte[1]
        [FALSE ]
      android.flash.state (40005): byte[1]
        [UNAVAILABLE ]
      android.flash.info.chargeDuration (50001): int64[1]
        [0 ]
      android.noiseReduction.availableNoiseReductionModes (a0002): byte[1]
        [0 ]
      android.tonemap.availableToneMapModes (130005): byte[2]
        [1 2 ]
      android.tonemap.maxCurvePoints (130004): int32[1]
        [128 ]
      android.scaler.croppingType (d000d): byte[1]
        [CENTER_ONLY ]
      android.scaler.availableFormats (d0001): int32[5]
        [BLOB IMPLEMENTATION_DEFINED YV12 YCrCb_420_SP ]
        [YCbCr_420_888 ]
      android.scaler.availableRawMinDurations (d0007): int64[1]
        [0 ]
      android.scaler.availableStreamConfigurations (d000a): int32[120]
        [34 1920 1080 OUTPUT ]
        [34 1280 800 OUTPUT ]
        [34 1280 720 OUTPUT ]
        [34 1024 768 OUTPUT ]
        [34 800 600 OUTPUT ]
        [34 848 480 OUTPUT ]
        [34 640 480 OUTPUT ]
        [34 640 360 OUTPUT ]
        [34 352 288 OUTPUT ]
        [34 320 240 OUTPUT ]
        [34 176 144 OUTPUT ]
        [34 160 120 OUTPUT ]
        [35 1920 1080 OUTPUT ]
        [35 1280 800 OUTPUT ]
        [35 1280 720 OUTPUT ]
        [35 1024 768 OUTPUT ]
        [35 800 600 OUTPUT ]
        [35 848 480 OUTPUT ]
        [35 640 480 OUTPUT ]
        [35 640 360 OUTPUT ]
        [35 352 288 OUTPUT ]
        [35 320 240 OUTPUT ]
        [35 176 144 OUTPUT ]
        [35 160 120 OUTPUT ]
        [33 1920 1080 OUTPUT ]
        [33 1280 720 OUTPUT ]
        [33 1024 768 OUTPUT ]
        [33 640 480 OUTPUT ]
        [33 352 288 OUTPUT ]
        [33 320 240 OUTPUT ]
      android.sensor.info.activeArraySize (f0000): int32[4]
        [0 0 1920 1080 ]
      android.sensor.info.pixelArraySize (f0006): int32[2]
        [1920 1080 ]
      android.scaler.availableMinFrameDurations (d000b): int64[120]
        [33 320 ]
        [240 33333333 ]
        [33 352 ]
        [288 33333333 ]
        [33 640 ]
        [480 33333333 ]
        [33 1024 ]
        [768 33333333 ]
        [33 1280 ]
        [720 33333333 ]
        [33 1920 ]
        [1080 33333333 ]
        [35 160 ]
        [120 33333333 ]
        [35 176 ]
        [144 33333333 ]
        [35 320 ]
        [240 33333333 ]
        [35 352 ]
        [288 33333333 ]
        [35 640 ]
        [360 33333333 ]
        [35 640 ]
        [480 33333333 ]
        [35 848 ]
        [480 33333333 ]
        [35 800 ]
        [600 33333333 ]
        [35 1024 ]
        [768 33333333 ]
        [35 1280 ]
        [720 33333333 ]
        [35 1280 ]
        [800 33333333 ]
        [35 1920 ]
        [1080 33333333 ]
        [34 160 ]
        [120 33333333 ]
        [34 176 ]
        [144 33333333 ]
        [34 320 ]
        [240 33333333 ]
        [34 352 ]
        [288 33333333 ]
        [34 640 ]
        [360 33333333 ]
        [34 640 ]
        [480 33333333 ]
        [34 848 ]
        [480 33333333 ]
        [34 800 ]
        [600 33333333 ]
        [34 1024 ]
        [768 33333333 ]
        [34 1280 ]
        [720 33333333 ]
        [34 1280 ]
        [800 33333333 ]
        [34 1920 ]
        [1080 33333333 ]
      android.scaler.availableStallDurations (d000c): int64[120]
        [33 320 ]
        [240 33333333 ]
        [33 352 ]
        [288 33333333 ]
        [33 640 ]
        [480 33333333 ]
        [33 1024 ]
        [768 33333333 ]
        [33 1280 ]
        [720 33333333 ]
        [33 1920 ]
        [1080 33333333 ]
        [35 160 ]
        [120 0 ]
        [35 176 ]
        [144 0 ]
        [35 320 ]
        [240 0 ]
        [35 352 ]
        [288 0 ]
        [35 640 ]
        [360 0 ]
        [35 640 ]
        [480 0 ]
        [35 848 ]
        [480 0 ]
        [35 800 ]
        [600 0 ]
        [35 1024 ]
        [768 0 ]
        [35 1280 ]
        [720 0 ]
        [35 1280 ]
        [800 0 ]
        [35 1920 ]
        [1080 0 ]
        [34 160 ]
        [120 0 ]
        [34 176 ]
        [144 0 ]
        [34 320 ]
        [240 0 ]
        [34 352 ]
        [288 0 ]
        [34 640 ]
        [360 0 ]
        [34 640 ]
        [480 0 ]
        [34 848 ]
        [480 0 ]
        [34 800 ]
        [600 0 ]
        [34 1024 ]
        [768 0 ]
        [34 1280 ]
        [720 0 ]
        [34 1280 ]
        [800 0 ]
        [34 1920 ]
        [1080 0 ]
      android.scaler.availableProcessedMinDurations (d0005): int64[1]
        [0 ]
      android.scaler.availableJpegMinDurations (d0002): int64[1]
        [0 ]
      android.jpeg.availableThumbnailSizes (70007): int32[8]
        [0 0 128 72 ]
        [160 120 320 240 ]
      android.jpeg.maxSize (70008): int32[1]
        [8000000 ]
      android.statistics.info.availableFaceDetectModes (120000): byte[3]
        [0 1 2 ]
      android.statistics.info.maxFaceCount (120002): int32[1]
        [8 ]
      android.statistics.info.histogramBucketCount (120001): int32[1]
        [64 ]
      android.statistics.info.maxHistogramCount (120003): int32[1]
        [1000 ]
      android.statistics.info.sharpnessMapSize (120005): int32[2]
        [64 64 ]
      android.statistics.info.maxSharpnessMapValue (120004): int32[1]
        [1000 ]
      android.statistics.hotPixelMapMode (110003): byte[1]
        [OFF ]
      android.statistics.sceneFlicker (11000e): byte[1]
        [NONE ]
      android.statistics.lensShadingMapMode (110010): byte[1]
        [OFF ]
      android.control.sceneMode (10010): byte[1]
        [FACE_PRIORITY ]
      android.control.availableSceneModes (10019): byte[1]
        [1 ]
      android.control.availableEffects (10018): byte[1]
        [0 ]
      android.control.maxRegions (1001c): int32[3]
        [0 0 0 ]
      android.control.aeAvailableModes (10013): byte[2]
        [0 1 ]
      android.control.aeAvailableTargetFpsRanges (10014): int32[16]
        [5 15 15 15 ]
        [5 20 20 20 ]
        [5 25 25 25 ]
        [5 30 30 30 ]
      android.control.awbAvailableModes (1001b): byte[6]
        [0 1 2 3 5 8 ]
      android.control.afState (10020): byte[1]
        [INACTIVE ]
      android.control.afAvailableModes (10017): byte[1]
        [0 ]
      android.control.aeAvailableAntibandingModes (10012): byte[2]
        [0 3 ]
      android.control.aeExposureCompensation (10001): int32[1]
        [0 ]
      android.control.aeCompensationStep (10016): rational[1]
        [(1 / 3) ]
      android.control.aeCompensationRange (10015): int32[2]
        [-6 6 ]
      android.scaler.availableMaxDigitalZoom (d0004): float[1]
        [1.00000000 ]
      android.control.availableVideoStabilizationModes (1001a): byte[1]
        [0 ]
      android.control.aeState (1001f): byte[1]
        [CONVERGED ]
      android.control.awbState (10022): byte[1]
        [INACTIVE ]
      android.info.supportedHardwareLevel (150000): byte[1]
        [EXTERNAL ]
      android.sync.maxLatency (170001): int32[1]
        [UNKNOWN ]
      android.request.pipelineDepth (c0009): byte[1]
        [1 ]
      android.request.pipelineMaxDepth (c000a): byte[1]
        [4 ]
      android.request.availableCapabilities (c000c): byte[1]
        [BACKWARD_COMPATIBLE ]
      android.request.partialResultCount (c000b): int32[1]
        [1 ]
      android.request.maxNumOutputStreams (c0006): int32[3]
        [0 2 1 ]
      android.colorCorrection.aberrationMode (00003): byte[1]
        [OFF ]
      android.colorCorrection.availableAberrationModes (00004): byte[1]
        [0 ]
      android.request.availableCharacteristicsKeys (c000f): int32[38]
        [4 65554 65555 65556 ]
        [65557 65558 65559 65560 ]
        [65561 65562 65563 327680 ]
        [1376256 458759 524293 589826 ]
        [655362 786444 786443 786442 ]
        [851972 851981 917529 983040 ]
        [983045 983046 983048 917518 ]
        [1179648 1179650 1507329 65572 ]
        [65573 65574 1048578 1179655 ]
        [983050 65582 ]
      android.request.availableRequestKeys (c000d): int32[61]
        [4 65554 65555 65556 ]
        [65557 65558 65559 65560 ]
        [65561 65562 65563 327680 ]
        [1376256 458759 524293 589826 ]
        [655362 786444 786443 786442 ]
        [851972 851981 917529 983040 ]
        [983045 983046 983048 917518 ]
        [1179648 1179650 1507329 65539 ]
        [65543 65547 65551 65553 ]
        [1114112 3 655360 65536 ]
        [65537 65538 65539 65541 ]
        [65543 65545 65546 65547 ]
        [65549 65550 65551 65552 ]
        [65553 262146 458755 458756 ]
        [458757 458758 851968 1114112 ]
        [65583 ]
      android.request.availableResultKeys (c000e): int32[61]
        [4 65554 65555 65556 ]
        [65557 65558 65559 65560 ]
        [65561 65562 65563 327680 ]
        [1376256 458759 524293 589826 ]
        [655362 786444 786443 786442 ]
        [851972 851981 917529 983040 ]
        [983045 983046 983048 917518 ]
        [1179648 1179650 1507329 65539 ]
        [65543 65547 65551 65553 ]
        [1114112 3 655360 65536 ]
        [65537 65538 65539 65541 ]
        [65543 65545 65546 65547 ]
        [65549 65550 65551 65552 ]
        [65553 262146 458755 458756 ]
        [458757 458758 851968 1114112 ]
        [65583 ]
      android.control.aeLockAvailable (10024): byte[1]
        [TRUE ]
      android.control.awbLockAvailable (10025): byte[1]
        [TRUE ]
      android.control.availableModes (10026): byte[3]
        [1 2 0 ]
      android.shading.availableModes (100002): byte[2]
        [1 2 ]
      android.statistics.info.availableLensShadingMapModes (120007): byte[1]
        [0 ]
      android.scaler.availableRotateAndCropModes (d0010): byte[1]
        [0 ]
      android.sensor.info.preCorrectionActiveArraySize (f000a): int32[4]
        [0 0 1920 1080 ]
      android.control.zoomRatioRange (1002e): float[2]
        [1.00000000 1.00000000 ]
== Camera HAL device device@3.3/legacy/0 (v3.3) dumpState: ==
No active camera device session instance

== Vendor tags: ==

  Dumping vendor tag descriptors for vendor with id 3854507339
  Dumping configured vendor tag descriptors: 16 entries
    0x80000000 (aperture) with type 2 (float) defined in section android.lens
    0x80000001 (filterDensity) with type 2 (float) defined in section android.lens
    0x80000002 (focalLength) with type 2 (float) defined in section android.lens
    0x80000003 (focusDistance) with type 2 (float) defined in section android.lens
    0x80000004 (opticalStabilizationMode) with type 0 (byte) defined in section android.lens
    0x80000005 (facing) with type 0 (byte) defined in section android.lens
    0x80000006 (focusRange) with type 2 (float) defined in section android.lens
    0x80000007 (state) with type 0 (byte) defined in section android.lens
    0x80010000 (availableApertures) with type 2 (float) defined in section android.lens.info
    0x80010001 (availableFilterDensities) with type 2 (float) defined in section android.lens.info
    0x80010002 (availableFocalLengths) with type 2 (float) defined in section android.lens.info
    0x80010003 (availableOpticalStabilization) with type 0 (byte) defined in section android.lens.info
    0x80010004 (hyperfocalDistance) with type 2 (float) defined in section android.lens.info
    0x80010005 (minimumFocusDistance) with type 2 (float) defined in section android.lens.info
    0x80010006 (shadingMapSize) with type 1 (int32) defined in section android.lens.info
    0x80010007 (focusDistanceCalibration) with type 0 (byte) defined in section android.lens.info

== Camera error traces (0): ==
  No camera traces collected.
VIM4:/ #
1 Like

@goenjoy good!!!
I found the problem!!
Thank you!!!