Status Update
Comments
sc...@google.com <sc...@google.com> #2
[Deleted User] <[Deleted User]> #3
Great! Thanks a lot, I'll look for the live updates soon!
[Deleted User] <[Deleted User]> #4
Fatal Exception: java.lang.IllegalStateException: maxImages (4) has already been acquired, call #close before acquiring more.
at android.media.ImageReader.acquireNextImage(ImageReader.java:501)
at android.media.ImageReader.acquireLatestImage(ImageReader.java:386)
at androidx.camera.core.AndroidImageReaderProxy.c(AndroidImageReaderProxy.java:4)
at androidx.camera.core.SafeCloseImageReaderProxy.acquireLatestImage(SafeCloseImageReaderProxy.java:5)
at androidx.camera.core.ImageAnalysisNonBlockingAnalyzer.onImageAvailable(ImageAnalysisNonBlockingAnalyzer.java)
at androidx.camera.core.SafeCloseImageReaderProxy.lambda$setOnImageAvailableListener$1(SafeCloseImageReaderProxy.java:2)
at androidx.camera.core.-$$Lambda$SafeCloseImageReaderProxy$vlVuGMKvMVqmwbJFm3dTgGgUzu4.onImageAvailable(-.java:2)
at androidx.camera.core.AndroidImageReaderProxy.lambda$setOnImageAvailableListener$0(AndroidImageReaderProxy.java:2)
at androidx.camera.core.-$$Lambda$AndroidImageReaderProxy$ydxkGVJ03P0ZMYkq3dfSV-hzi3E.run(-.java:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
sc...@google.com <sc...@google.com> #5
I think there must be a Image leakage somewhere. we will look into the issue with priority.
xi...@google.com <xi...@google.com> #6
Venkatesh and/or other people experiencing the issue:
We have some ideas but haven't found a way to repro so it can't be verified.
Could you provide a full logcat? We would like to know what leads to the crash. Also any tips on reproducing the issue would be helpful.
xi...@google.com <xi...@google.com> #7
We have aosp/1545504 out for review, but probably won't make the next build since we want to give it some soak time.
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit 9fd9b8d48bfef2c9abfcba4d4f0fba89a12f6875
Author: Xi Zhang <xizh@google.com>
Date: Thu Jan 07 09:49:58 2021
ImageAnalysis: acquire image when queue is maxed should not crash.
Not sure what the exact cause of the bug
Changes:
- refactor abstract analyzerto make the logic clear. Remove the open/close methods of the abstract analyzer, and replace it with the later introduced attach/detach concept. It should only forward images when 1) the user analzyer is set, and 2) the ImageAnalysis is attached to a camera.
- Add a clearCache() method to release cached images. The method is called when 1) user analyzer is unset, 2) ImageAnalysis is detached, or 3) there is an error in creating pipeline.
- In non-blocking analyzer, rely on posted image's existence to check if it's been closed.
- try/catch the max queue exception and log it as an error.
- clean up unit tests.
Relnote: This change catches the exception when the image queue is maxed out in ImageAnalysis. So instead of crash, you may notice other use cases being frozen or sluggish. e.g. frozen/sluggish preview.
Bug: 175851631
Test: manual test and ./gradlew bOS
Change-Id: Ic12dafa0b0feed875a07ea1d8c23c52977b15afa
M camera/camera-camera2/src/androidTest/java/androidx/camera/camera2/ImageAnalysisTest.java
M camera/camera-core/lint-baseline.xml
M camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysis.java
M camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysisAbstractAnalyzer.java
M camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysisBlockingAnalyzer.java
M camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysisNonBlockingAnalyzer.java
M camera/camera-core/src/test/java/androidx/camera/core/ImageAnalysisNonBlockingAnalyzerTest.java
sc...@google.com <sc...@google.com> #9
I tried to reproduce it using your approach (by stress testing CaptureFragment<->GalleryFragment on CameraXBasic app) on several devices.
But still failed to reproduce it.
Could you kindly clarify the below questions?
(1) Confirm if there is anything modified in your CameraXBasic app
(2) Clarify what the chance is to reproduce it ? For example, reproduce once after keep switching for 5 minutes.
(3) Does it happen on all devices or only on specific devices ? Please give us the device name if it happens on specific devices.
bh...@gmail.com <bh...@gmail.com> #11
(1) Confirm if there is anything modified in your CameraXBasic app
No. We have attached all 3 use cases.
(2) Clarify what the chance is to reproduce it ? For example, reproduce once after keep switching for 5 minutes.
1 in 50. It has 0.1-0.2% instance in our production environment.
(3) Does it happen on all devices or only on specific devices ? Please give us the device name if it happens on specific devices.
It happen on specific devices. Attached is the list of devices on which we see this issue in producton.
sc...@google.com <sc...@google.com> #12
Thanks ! This is quite useful. We are trying to get one of the devices and reproducing on other devices as well. Will let you know if there is any result.
sc...@google.com <sc...@google.com> #13
Hi Visual,
I got the Huawei Y6 Pro 2019 which has the highest occurrences fro your list. But I still cannot reproduce it using CameraXBasic.
I am thinking maybe I can test it by using your app directly ? If that is feasible for you, please share the apk to my email (
bh...@gmail.com <bh...@gmail.com> #14
Our app is on play store. Just search for Microsoft Lens on play store.
On Fri, Mar 19, 2021, 12:49 PM <buganizer-system@google.com> wrote:
sc...@google.com <sc...@google.com> #15
Thanks! I was able to run Microsoft Lens and I tried to play around the app intensively on Huawei Y6 Pro 2019 but did not encounter the issue yet. It seems that it only happens on specific timing with specific scenarios.
Several more questions :
(1) Do you have ideas on what user did to run into this crash ? In other words, do you know how we can reproduce it using Microsoft Lens ?
(2) What camera-core and camera-view versions are used in the current production app(ver 16.0.13628.20346) ?
And still we failed to reproduce it on unmodified CameraXBasic on Huawei Y6 Pro 2019.
bh...@gmail.com <bh...@gmail.com> #16
mins of using the app, sometimes it happened on app open itself when camera
is opened for first time.
So there is no set pattern.
In current production it is beta05.
We will have alpha02 around April in prod.
On Mon, Mar 22, 2021, 9:35 AM <buganizer-system@google.com> wrote:
sc...@google.com <sc...@google.com> #17
We have a fix at beta08, so I would suggest you using version after that.
alpha02 contains a critical issue that would crash on some samsung devices (note10+, s20..)
We recommend using the upcoming rc04 or alpha03 and camera-view alpha23. (will be released this week).
Also please notice that if you are using camera-view alpha22, it contains a camera-core alpha02 dependency which will override your camera-core versions you declares in the gradle file and contain the issue accidentally. The dependency issue has been fixed in camera-view alpha23.
Description
Please describe your issue and include details such as the version of CameraX you are using and any relevant logs related to your issue.
App crashes with below exception on camera launch/restart.
java.lang.IllegalStateException: maxImages (4) has already been acquired, call #close before acquiring more.
android.media.ImageReader.acquireNextImage ImageReader.java:502
android.media.ImageReader.acquireLatestImage ImageReader.java:386
androidx.camera.core.b.acquireLatestImage SourceFile:56
androidx.camera.core.q.acquireLatestImage SourceFile:63
androidx.camera.core.k.onImageAvailable SourceFile:66
androidx.camera.core.q.a SourceFile:166
androidx.camera.core.q.lambda$OPW0IohYTbcucNR3zD07oG0ajTs
androidx.camera.core.-$$Lambda$q$OPW0IohYTbcucNR3zD07oG0ajTs.onImageAvailable
androidx.camera.core.b.a SourceFile:139
androidx.camera.core.b.lambda$VKdqVJS22_zThdeYRaclgKj6pfQ
androidx.camera.core.-$$Lambda$b$VKdqVJS22_zThdeYRaclgKj6pfQ.run
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java:1167
// If at all possible, capture an Android logcat (
CAMERAX VERSION (ex - 1.0.0-alpha07) Beta-05
CAMERA APPLICATION NAME AND VERSION: (Settings > Apps > (app name) > version)
ANDROID OS BUILD NUMBER: (Settings > About > Build number)
DEVICE NAME: (Nexus 5X, Samsung S6, etc)
All devices / not device specific
DESCRIPTION:
Based on few instances we encountered while development, crash is happening while camera launch/re-start.
LIST ANY EXPERIMENTAL FEATURES: (As an example - @ExperimentalCamera2Interop)
STEPS TO REPRODUCE:
1. Attach all threee usecases for camera
2. Since issue is intermittent we need to try many times to reproduce it.
3.
OBSERVED RESULTS:
EXPECTED RESULTS:
REPRODUCIBILITY: (5 of 5, 1 of 100, etc)
ADDITIONAL INFORMATION:
CODE FRAGMENTS (this will help us troubleshoot your issues):