front-rear-simultaneous-camera icon indicating copy to clipboard operation
front-rear-simultaneous-camera copied to clipboard

Hardware

Open dirk61 opened this issue 5 years ago • 7 comments

What device did you use? I'm using Huawei mate 30 and only one camera preview works.

dirk61 avatar Jul 19 '20 09:07 dirk61

I have tried this on Xiaomi Mi 5, Android 8.0.0 API 26

ananthrajsingh avatar Jul 21 '20 08:07 ananthrajsingh

mCaptureRequestBuilderFront = mCameraDeviceFront.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW); mCaptureRequestBuilderFront.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_OFF); mCaptureRequestBuilderFront.set(CaptureRequest.CONTROL_AE_LOCK, true);

Try this while creating capture request for front or both cameras. This made the application work on a custom Quectel hardware running Android 9.

ananthrajsingh avatar Jul 21 '20 08:07 ananthrajsingh

Hello, Thank you for this wonderful code. I am using a Quectel SC600Y and the application crashes when opening the rear camera. Here is the error message: Access denied finding property "vendor.camera.aux.packagelist". I thought it's a permission issue, so I added this in the manifest: uses-permission android: name = "android.permission.CAMERA" uses-feature android: name = "android.hardware.camera" uses-feature android: name = "android.hardware.camera.autofocus" but nothing to do. Do you have an idea ? Thanks & Best Regards,

seann99 avatar Jul 22 '20 10:07 seann99

Hey @seann99, you are welcome. Did you try this:

mPreviewBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_OFF);

mPreviewBuilder.set(CaptureRequest.CONTROL_AE_LOCK, true);

mPreviewBuilder.set(CaptureRequest.CONTROL_MODE, CaptureRequest.CONTROL_MODE_OFF);

If problem persists, mind posting the crashlogs?

ananthrajsingh avatar Jul 22 '20 10:07 ananthrajsingh

Thank you very much for this quick feedback. In your code it is already mentioned: previewRequestBuilderRear.set (CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE).

and i'chnaged in:

previewRequestBuilderFront.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_OFF) previewRequestBuilderFront.set(CaptureRequest.CONTROL_AE_LOCK, true) previewRequestBuilderFront.set(CaptureRequest.CONTROL_MODE, CaptureRequest.CONTROL_MODE_OFF)

here are my logs:

2020-07-22 14:09:14.047 17413-17413/com.ananth.frontrearcamera E/libc: Access denied finding property "vendor.camera.aux.packagelist" 2020-07-22 14:09:14.055 17413-17413/com.ananth.frontrearcamera D/CameraFragment: selected aspect ratio 120x160 : 0 2020-07-22 14:09:14.052 17413-17413/com.ananth.frontrearcamera W/frontrearcamera: type=1400 audit(0.0:1044): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=14928 scontext=u:r:untrusted_app:s0:c99,c256,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0 2020-07-22 14:09:14.063 17413-17413/com.ananth.frontrearcamera E/libc: Access denied finding property "persist.vendor.camera.privapp.list" 2020-07-22 14:09:14.062 17413-17413/com.ananth.frontrearcamera W/Binder:17413_2: type=1400 audit(0.0:1045): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=14928 scontext=u:r:untrusted_app:s0:c99,c256,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0 2020-07-22 14:09:14.069 17413-17426/com.ananth.frontrearcamera E/libc: Access denied finding property "vendor.camera.aux.packagelist" 2020-07-22 14:09:14.151 17413-17413/com.ananth.frontrearcamera E/libc: Access denied finding property "vendor.camera.aux.packagelist" 2020-07-22 14:09:14.158 17413-17413/com.ananth.frontrearcamera D/CameraFragment: selected aspect ratio 120x160 : 0 2020-07-22 14:09:14.166 17413-17413/com.ananth.frontrearcamera E/libc: Access denied finding property "persist.vendor.camera.privapp.list" 2020-07-22 14:09:14.175 17413-17426/com.ananth.frontrearcamera E/libc: Access denied finding property "vendor.camera.aux.packagelist" 2020-07-22 14:09:14.176 17413-17426/com.ananth.frontrearcamera E/libc: Access denied finding property "vendor.camera.aux.packagelist" 2020-07-22 14:09:14.878 17413-17426/com.ananth.frontrearcamera E/libc: Access denied finding property "vendor.camera.aux.packagelist" 2020-07-22 14:09:14.890 17413-17426/com.ananth.frontrearcamera E/libc: Access denied finding property "vendor.camera.aux.packagelist" 2020-07-22 14:09:15.163 17413-17426/com.ananth.frontrearcamera E/libc: Access denied finding property "vendor.camera.aux.packagelist"

2020-07-22 14:09:15.152 17413-17413/com.ananth.frontrearcamera W/Binder:17413_2: type=1400 audit(0.0:1056): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=14928 scontext=u:r:untrusted_app:s0:c99,c256,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0 2020-07-22 14:09:20.835 17413-17422/com.ananth.frontrearcamera W/System: A resource failed to call release. 2020-07-22 14:09:20.835 17413-17422/com.ananth.frontrearcamera W/System: A resource failed to call release.

seann99 avatar Jul 22 '20 11:07 seann99

Hey @seann99, I am not sure these are crash logs.

ananthrajsingh avatar Jul 27 '20 18:07 ananthrajsingh

mCaptureRequestBuilderFront = mCameraDeviceFront.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW); mCaptureRequestBuilderFront.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_OFF); mCaptureRequestBuilderFront.set(CaptureRequest.CONTROL_AE_LOCK, true); can you tell me exactly where i have to paste this code my rear is working fine but front is not working

ranveerraj248 avatar Oct 17 '20 06:10 ranveerraj248