小米5s使用SurfaceTracking demo无法打开摄像头

0 投票
最新提问 9月 16, 2020 用户: ruanchaohouzi (140 分)
小米5s在Unity中使用SurfaceTracking demo无法打开摄像头 画面一片黑,报错信息如下:

主要报错信息: E/libc: Access denied finding property "persist.camera.cfa.packagelist"

日志:

2020-09-16 15:56:10.697 2181-2354/com.shuwen.easyar D/AudioTrack: Client defaulted notificationFrames to 192 for frameCount 1536
2020-09-16 15:56:11.144 2181-2354/com.shuwen.easyar D/AudioManager: getStreamVolume isRestricted mode = 0
2020-09-16 15:56:11.189 2181-2354/com.shuwen.easyar I/zygote64: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2020-09-16 15:56:11.197 2181-2354/com.shuwen.easyar I/zygote64: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2020-09-16 15:56:11.264 2181-2354/com.shuwen.easyar V/MediaRouter: Adding route: RouteInfo{ name=手机, description=null, status=null, category=RouteCategory{ name=系统 types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
2020-09-16 15:56:11.291 2181-2354/com.shuwen.easyar V/MediaRouter: Selecting route: RouteInfo{ name=手机, description=null, status=null, category=RouteCategory{ name=系统 types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
2020-09-16 15:56:11.350 2181-2513/com.shuwen.easyar E/AudioTrack: did not receive expected priority boost on time
2020-09-16 15:56:13.418 2181-2354/com.shuwen.easyar I/Unity: EasyAR Sense Unity Plugin Version 4.1.0.811-b8004aa8b
    easyar.EasyARController:GlobalInitialization()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2020-09-16 15:56:13.688 2181-2354/com.shuwen.easyar I/EasyAR: EasyAR Sense (Android-arm64) Version 4.1.0.7750-f1413084f
2020-09-16 15:56:17.897 2181-2354/com.shuwen.easyar D/AudioManager: getStreamVolume isRestricted mode = 0
2020-09-16 15:56:19.026 2181-2354/com.shuwen.easyar I/EasyAR: Camera2 selected
2020-09-16 15:56:19.030 2181-2354/com.shuwen.easyar I/CameraManagerGlobal: Connecting to camera service
2020-09-16 15:56:19.059 2181-2354/com.shuwen.easyar W/EasyAR: Camera2: Timestamp is not precise.
2020-09-16 15:56:19.390 2181-2181/com.shuwen.easyar W/UnityMain: type=1400 audit(0.0:4817): avc: denied { read } for name="u:object_r:camera_prop:s0" dev="tmpfs" ino=7140 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:camera_prop:s0 tclass=file permissive=0
2020-09-16 15:56:19.404 2181-2354/com.shuwen.easyar E/libc: Access denied finding property "persist.camera.cfa.packagelist"
2020-09-16 15:56:20.187 2181-2191/com.shuwen.easyar I/zygote64: Do partial code cache collection, code=61KB, data=44KB
2020-09-16 15:56:20.188 2181-2191/com.shuwen.easyar I/zygote64: After code cache collection, code=61KB, data=44KB
2020-09-16 15:56:20.188 2181-2191/com.shuwen.easyar I/zygote64: Increasing code cache capacity to 256KB
2020-09-16 15:59:21.992 2181-2191/com.shuwen.easyar I/zygote64: Do full code cache collection, code=123KB, data=81KB
2020-09-16 15:59:21.993 2181-2191/com.shuwen.easyar I/zygote64: After code cache collection, code=77KB, data=46KB

1个回答

0 投票
最新回答 9月 23, 2020 用户: kenn (19,220 分)

看起来和系统camera2有关,在网上也可以搜到相关的错误。

我们在我们自己的小米5s上无法重现问题。不过不排除系统版本有一些影响。

如果你需要在这个手机上运行,可以尝试在VideoCameraDevice.DeviceCreated事件中设置使用camera1

Device.setAndroidCameraApiType(AndroidCameraApiType.Camera1);

发表于 10月 10, 2020 用户: easyarguxin (2,360 分)
需要判断camera2的打开返回值,如果是false就再启动camera1。因为有些camera2打开存在硬件障碍,
auto openResult = camera->openWithSpecificType(CameraDeviceType::Back);
openWithSpecificType打开camera时可以判断返回值openResult,如果openResult是false就是失败了,然后再打开camera1即可
欢迎来到 EasyAR Q&A ,有什么不懂的可以尽管在这里提问,你将会收到社区其他成员的回答。
...