Open rickyhopper opened 1 month ago
Update on this. I continued to dig into it, and the actual issue happens when the ImageReader surface for CPU processing is added to the capture request, and then the capture request is created. The camera on Pixel 3 and other devices can't seem to handle this, and it's unclear why. My working theory is that it's just streaming to too many surfaces (since there is the GPU surface, the VGA motion tracking surface, the HD surface, and the ImageReader surface all provided), but I can't find anything to back this up. It seems like this still shouldn't crash, and lies somewhere between ARCore and the camera2 library.
I've updated the title to reflect this, but leaving this bug open since it relates to the shared_camera_java sample.
SPECIFIC ISSUE ENCOUNTERED
When setting up an ARCore session with
Session.Feature.SHARED_CAMERA
, setting the CameraConfig to certain configs provided bySession.getSupportedCameraConfigs(CameraConfigFilter)
causes ARCore to crash on some devices. I have reproduced this issue by adding a few lines of code to theshared_camera_java
example in this repository, as detailed in the repro steps.VERSIONS USED
adb shell pm dump com.google.ar.core | findstr /i "packages: versionName"
On macOS, use:adb shell pm dump com.google.ar.core | egrep -i versionName\|packages:
adb shell getprop ro.build.fingerprint
: google/blueline/blueline:12/SP1A.210812.016.C1/8029091:user/release-keysSTEPS TO REPRODUCE THE ISSUE
Set a high resolution camera config when configuring your session. The below is example code I inserted in
shared_camera_java
to sanity test this (inSharedCameraActivity::openCamera
at line 598):WORKAROUNDS (IF ANY)
None.
ADDITIONAL COMMENTS
I am trying to use the highest resolution camera config possible to capture frames for a 3D reconstruction application. I cannot determine which configs are supported by the cameras on my test devices because most CameraConfigs crash (both the high-resolution one gotten with the code above and the medium resolution one provided in the list fail to configure). There is nothing in the documentation about any other way to determine if a CameraConfig is supported, and as far as I can tell I am doing what I am supposed to by calling session.configure after setting the CameraConfig.
Thanks for any assistance on this; and I am happy to help dig into this however I can.