Status Update
Comments
er...@google.com <er...@google.com> #2
Per the email, please help us with the following:
- Code samples
- Are you using the Video function at all?
- expanded error log
- Other artifacts you're also using
Thanks!
ch...@google.com <ch...@google.com> #3
Hi Varga,
Could you help to provide the full log to clarify the issue?
There should be the following stack in the log:
Caused by: java.lang.RuntimeException
at android.media.CamcorderProfile.native_get_camcorder_profile(CamcorderProfile.java)
at android.media.CamcorderProfile.get(CamcorderProfile.java:467)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getRecordSize(SupportedSurfaceCombination.java:1210)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.generateSurfaceSizeDefinition(SupportedSurfaceCombination.java:1168)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.<init>(SupportedSurfaceCombination.java:120)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.init(Camera2DeviceSurfaceManager.java:93)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:82)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:65)
at androidx.camera.camera2.Camera2Config.lambda$defaultConfig$0$Camera2Config(Camera2Config.java:52)
at androidx.camera.camera2.Camera2Config$$Lambda$1.newInstance(Camera2Config.java:2)
at androidx.camera.core.CameraX.lambda$initAndRetryRecursively$9$CameraX(CameraX.java:578)
at androidx.camera.core.CameraX$$Lambda$6.run(CameraX.java:12)
If it is true, the issue is caused by two parts of issues:
- An issue happened when using 1.1.0-alpha02. There has been a solution for it in
and will be included in the next release. The root cause is the exception might still be threw even trying to get a guaranteed supported QUALITY_HIGH CamcorderProfile. This issue should only happened on some specific devices.aosp/1593559 - As the issue description, the library version you tried to use is 1.0.0-rc03. But, please refer to the
discussion. Even 1.0.0-rc03 was specified to use, but actually 1.0.0-alpha02 will be used. And then the issue happened. We're discussing the solution for this issue.Forum thread
wu...@google.com <wu...@google.com> #4
Update the information from
I had the same problem with rc03. I didn't use the video function only take photo. This issue happened most on Android 11.
Caused by java.lang.RuntimeException: Error retrieving camcorder profile params
at android.media.CamcorderProfile.native_get_camcorder_profile(CamcorderProfile.java)
at android.media.CamcorderProfile.get(CamcorderProfile.java:456)
at androidx.camera.camera2.internal.-$$Lambda$E2rRrx9ASsJbpKoXo9ov4Zv64wI.get(-.java)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getRecordSize(SupportedSurfaceCombination.java:1213)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.generateSurfaceSizeDefinition(SupportedSurfaceCombination.java:1168)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.<init>(SupportedSurfaceCombination.java:120)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.init(Camera2DeviceSurfaceManager.java:94)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:82)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:65)
at androidx.camera.camera2.Camera2Config.lambda$defaultConfig$0(Camera2Config.java:52)
at androidx.camera.camera2.-$$Lambda$Camera2Config$kPfcZYYQs2fXKvw1cjC5GhRy6hM.newInstance(-.java)
at androidx.camera.core.CameraX.lambda$initAndRetryRecursively$9(CameraX.java:578)
at androidx.camera.core.CameraX.lambda$initAndRetryRecursively$9$CameraX(CameraX.java)
at androidx.camera.core.-$$Lambda$CameraX$u-Xx2b6YXY5GXNXRh-mDiDnHdpQ.run(-.java:10)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
va...@gmail.com <va...@gmail.com> #5
here is the log with stack trace:
I/CameraManagerGlobal: Camera 21 facing CAMERA_FACING_BACK state now
CAMERA_STATE_CLOSED for client android.system API Level 2
Camera 23 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for
client android.system API Level 2
Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_CLOSED for
client com.samsung.android.smartface API Level 2
I/CameraManagerGlobal: Camera 4 facing CAMERA_FACING_BACK state now
CAMERA_STATE_CLOSED for client android.system API Level 2
I/CameraManagerGlobal: Camera 40 facing CAMERA_FACING_BACK state now
CAMERA_STATE_CLOSED for client android.system API Level 2
Camera 50 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for
client android.system API Level 2
Camera 52 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for
client android.system API Level 2
Camera 80 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for
client android.system API Level 2
Camera 91 facing CAMERA_FACING_FRONT state now CAMERA_STATE_CLOSED for
client android.system API Level 2
E/MediaProfiles: The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
W/CameraX: Retry init. Start time 152689353 current time 152689366
java.lang.RuntimeException: Error retrieving camcorder profile params
at
android.media.CamcorderProfile.native_get_camcorder_profile(Native Method)
at android.media.CamcorderProfile.get(CamcorderProfile.java:456)
at
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.lambda$E2rRrx9ASsJbpKoXo9ov4Zv64wI(Unknown
Source:0)
at
androidx.camera.camera2.internal.-$$Lambda$Camera2DeviceSurfaceManager$E2rRrx9ASsJbpKoXo9ov4Zv64wI.get(Unknown
Source:0)
at
androidx.camera.camera2.internal.SupportedSurfaceCombination.getRecordSize(SupportedSurfaceCombination.java:1213)
at
androidx.camera.camera2.internal.SupportedSurfaceCombination.generateSurfaceSizeDefinition(SupportedSurfaceCombination.java:1168)
at
androidx.camera.camera2.internal.SupportedSurfaceCombination.<init>(SupportedSurfaceCombination.java:120)
at
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.init(Camera2DeviceSurfaceManager.java:94)
at
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:82)
at
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:65)
at
androidx.camera.camera2.Camera2Config.lambda$defaultConfig$0(Camera2Config.java:52)
at
androidx.camera.camera2.-$$Lambda$Camera2Config$kPfcZYYQs2fXKvw1cjC5GhRy6hM.newInstance(Unknown
Source:0)
at
androidx.camera.core.CameraX.lambda$initAndRetryRecursively$9$CameraX(CameraX.java:578)
at
androidx.camera.core.-$$Lambda$CameraX$u-Xx2b6YXY5GXNXRh-mDiDnHdpQ.run(Unknown
Source:10)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
then the same because camera retries couple of times,
then at the end:
Caused by: java.lang.RuntimeException: Error retrieving camcorder profile
params
at
android.media.CamcorderProfile.native_get_camcorder_profile(Native Method)
at android.media.CamcorderProfile.get(CamcorderProfile.java:456)
at
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.lambda$E2rRrx9ASsJbpKoXo9ov4Zv64wI(Unknown
Source:0)
at
androidx.camera.camera2.internal.-$$Lambda$Camera2DeviceSurfaceManager$E2rRrx9ASsJbpKoXo9ov4Zv64wI.get(Unknown
Source:0)
at
androidx.camera.camera2.internal.SupportedSurfaceCombination.getRecordSize(SupportedSurfaceCombination.java:1213)
at
androidx.camera.camera2.internal.SupportedSurfaceCombination.generateSurfaceSizeDefinition(SupportedSurfaceCombination.java:1168)
at
androidx.camera.camera2.internal.SupportedSurfaceCombination.<init>(SupportedSurfaceCombination.java:120)
at
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.init(Camera2DeviceSurfaceManager.java:94)
at
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:82)
at
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:65)
at
androidx.camera.camera2.Camera2Config.lambda$defaultConfig$0(Camera2Config.java:52)
at
androidx.camera.camera2.-$$Lambda$Camera2Config$kPfcZYYQs2fXKvw1cjC5GhRy6hM.newInstance(Unknown
Source:0)
at
androidx.camera.core.CameraX.lambda$initAndRetryRecursively$9$CameraX(CameraX.java:578)
at
androidx.camera.core.-$$Lambda$CameraX$u-Xx2b6YXY5GXNXRh-mDiDnHdpQ.run(Unknown
Source:10)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
The code where I get this error is:
*cameraController = new LifecycleCameraController(context);*
Futures.addCallback(cameraController.getInitializationFuture(), new
FutureCallback<Void>() {
@Override
public void onSuccess(@Nullable Void result) {
Log.d(TAG, "createCameraController SUCCESS");
onCameraInited.accept(easyCamera);
}
@Override
public void onFailure(Throwable t) {
onFailure.accept(new EasyCameraException("Exception while
creating CameraController", t));
}
}, CameraXExecutors.mainThreadExecutor());
There is nothing before this, I mean no camera related code.
Setting the parameters, the use cases, lifecycle binding and everything
else are AFTER this code so it does not matter what configuration I plan to
use.
The exact same code works perfectly with rc02.
The phone is a Samsung Note 10 plus, Android 11.
My gradle files looks like:
def camerax_version = '1.0.0-rc03'
implementation "androidx.camera:camera-core:${camerax_version}"
implementation "androidx.camera:camera-camera2:${camerax_version}"
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
implementation "androidx.camera:camera-extensions:1.0.0-alpha22"
implementation 'androidx.camera:camera-view:1.0.0-alpha22'
Cheers,
Peter
On Tue, Mar 2, 2021 at 8:39 AM <buganizer-system@google.com> wrote:
ch...@google.com <ch...@google.com> #6
Hi Varga,
Thanks for providing the information. It should be the issue that was mentioned in
// CameraX core library
def camerax_version = '1.0.0-rc03'
implementation("androidx.camera:camera-core") {
version {
strictly "$camerax_version"
}
because "Force use 1.0.0-rc03"
}
// CameraX Camera2 extensions
implementation("androidx.camera:camera-camera2") {
version {
strictly "$camerax_version"
}
because "Force use 1.0.0-rc03"
}
// CameraX Lifecycle library
implementation("androidx.camera:camera-lifecycle") {
version {
strictly "$camerax_version"
}
because "Force use 1.0.0-rc03"
}
va...@gmail.com <va...@gmail.com> #7
Peter
On Wed, Mar 3, 2021 at 10:24 AM <buganizer-system@google.com> wrote:
er...@google.com <er...@google.com>
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit 67f1405a3020b57d18802af3733237e4f9777f30
Author: Trevor McGuire <trevormcguire@google.com>
Date: Sun Mar 07 23:10:20 2021
Move PreviewStretchedQuirk to camera-view
The PreviewTransformation class in camera-view was accessing the
DeviceQuirks class, which is LIBRARY-scoped to camera-core.
Adds DeviceQuirks, DeviceQuirksLoader and PreviewStretchedQuirk
to camera-view so that PreviewStretchedQuirk can be accessed properly.
This also allows camera-view to rely on a pinned 1.0.0 dependency on
camera-core.
Bug: 181599852
Test: ./gradlew camera:camera-view:test
Change-Id: I69c6165c9e375743333f794dd3d3e31a9163a5e1
M camera/camera-core/src/main/java/androidx/camera/core/internal/compat/quirk/DeviceQuirksLoader.java
M camera/camera-view/src/main/java/androidx/camera/view/PreviewTransformation.java
A camera/camera-view/src/main/java/androidx/camera/view/internal/compat/quirk/DeviceQuirks.java
A camera/camera-view/src/main/java/androidx/camera/view/internal/compat/quirk/DeviceQuirksLoader.java
M camera/camera-view/src/main/java/androidx/camera/view/internal/compat/quirk/PreviewStretchedQuirk.java
A camera/camera-view/src/main/java/androidx/camera/view/internal/compat/quirk/package-info.java
M camera/camera-view/src/test/java/androidx/camera/view/internal/compat/quirk/PreviewStretchedQuirkTest.java
ap...@google.com <ap...@google.com> #9
Branch: androidx-main
commit 25e735624f0a718cc4569440c5afa1e88cf4d09c
Author: Trevor McGuire <trevormcguire@google.com>
Date: Wed Mar 03 23:17:07 2021
Pin camera-view dependencies to 1.0.0-rc03
Changes project dependencies to pinned dependencies for camera-view's
dependencies on camera-core and camera-lifecycle so dependency
resolution doesn't override developer's choice of using RC/stable
releases.
Also updates test dependencies to ensure we're testing against pinned
versions rather than ToT.
Allows FakeCameraInfoInternal to be used with camera-core:1.0.0 by
delaying initialization of instance variable until it is used.
Relnote: "Pinned camera-view dependencies to rely on 1.0.0 artifacts.
Depending on camera-view will not longer cause gradle's dependency
resolution to automatically upgrade camera-core, camera-camera2 and
camera-lifecycle to the latest 1.1.0 artifacts, though camera-view is
still compatible with those artifacts if they are explicitly set to use
1.1.0."
Bug: 181599852
Test: ./gradlew camera:camera-view:test
&& ./gradlew camera:camera-view:connectedCheck
&& ./gradlew camera:integration-tests:view-testapp:connectedCheck
Change-Id: Ic8fa123684e2ab739b4a4b271f004c4d3f631bf5
M camera/camera-testing/src/main/java/androidx/camera/testing/fakes/FakeCameraInfoInternal.java
M camera/camera-view/build.gradle
A camera/camera-view/dependencies.gradle
M camera/integration-tests/viewtestapp/build.gradle
[Deleted User] <[Deleted User]> #10
Here is a workaround if you use camera-view alpha 22
implementation("androidx.camera:camera-view:1.0.0-alpha22") {
exclude group:'androidx.camera' // FIX to avoid pulling camera-core and lifecycle 1.1.0-alpha02
}
ap...@google.com <ap...@google.com> #11
Branch: androidx-main
commit 6d6266e2e32472ce4545e23d399b3bb92472a526
Author: Trevor McGuire <trevormcguire@google.com>
Date: Sat Mar 13 16:04:54 2021
Ensure view testapp is built against pinned deps
The camera-view testapp is currently depending on camera-testing, so we
need to ignore the transitive camera-core project dependency so the
version of camera-core doesn't get pulled up at dependency resolution.
Dependencies verified with
./gradlew camera:integration-tests:camera-testapp-view:dependencies
--configuration debugRuntimeClasspath
Bug: 181599852
Test: ./gradlew camera:integration-tests:camera-testapp-view:connectedCheck
Change-Id: Ib25937df0dd735ab498a7b9fc8d2675879547caf
M camera/integration-tests/viewtestapp/build.gradle
ch...@google.com <ch...@google.com> #13
Hi,
Yes, the issue has been fixed in version 1.1.0-alpha03
.
Description
Please note: This component is for the CameraX API used in Jetpack. Please DO NOT file Pixel Camera issues here.
Please describe your issue and include details such as the version of CameraX you are using and any relevant logs related to your issue.
// If at all possible, capture an Android logcat (https://developer.android.com/studio/command-line/logcat ) when you're experiencing the issue, preferably while the camera is still active.
I use CameraController that worked well in RC02. But if I upgrade to RC03 I get "androidx.camera.core.initializationexception: java.lang.runtimeexception: error retrieving camcorder profile params" when I create the CameraController. Simply when I attach the listener I get this exception:
cameraController = new LifecycleCameraController(context); Futures.addCallback(cameraController.getInitializationFuture(), new FutureCallback<Void>() { @Override public void onFailure(Throwable t) { is called instead of onSuccess.
CAMERAX VERSION (ex - 1.0.0-alpha07)
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) Samsung Note 10+
DESCRIPTION:
LIST ANY EXPERIMENTAL FEATURES: (As an example - @ExperimentalCamera2Interop)
STEPS TO REPRODUCE: 1. 2. 3.
OBSERVED RESULTS:
EXPECTED RESULTS:
REPRODUCIBILITY: (5 of 5, 1 of 100, etc)
ADDITIONAL INFORMATION:
CODE FRAGMENTS (this will help us troubleshoot your issues):