-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash - IllegalStateException: maxImages (16) has already been acquired (SharedCamera) #1637
Comments
setDummyOnImageAvailableListener should not retain any images, so this is probably an issue that the acquired images are not being released from somewhere else. Are all images, either ARCore frames or images acquired from the SharedCamera, being promptly closed? |
We are rendering the camera preview with com.google.ar.core.Session.setCameraTextureName(OpenGL TEXTURE_EXTERNAL_OES texture name) and not calling com.google.ar.core.Frame.acquireCameraImage() at all. |
This is triggered by Session.pause(), and simply puts OnImageAvailableListener to ARCore's image readers to avoid buffer starvation which does:
So those images are not being used anywhere. However, acquireLatestImage could fail if the app has already acquired and failed to release 16 other images. |
How can the app acquire images from the same ImageReader that setDummyOnImageAvailableListener is using? From what you wrote, it seems that the ImageReader buffer is already full when setDummyOnImageAvailableListener is called. Is the app causing this (the filled buffer) or ARCore itself? We are using com.google.ar.core.Config.updateMode = Config.UpdateMode.LATEST_CAMERA_IMAGE (if that changes anything). |
I checked it several times already and I'm sure I'm closing all the images obtained by Like this:
The only other images I acquire are from my own android.media.ImageReader which has Is there something else that could be acquiring those 16 images before we call |
SPECIFIC ISSUE ENCOUNTERED
Crash from Crashlytics
VERSIONS USED
STEPS TO REPRODUCE THE ISSUE
WORKAROUNDS (IF ANY)
The exception can't be caught as the call is made on another thread inside the AR core lib.
ADDITIONAL COMMENTS
The app is using AR core with the shared camera feature.
The Crashlytics is reporting Device state 100% In background
The text was updated successfully, but these errors were encountered: