google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.97k stars 1.22k forks source link

CAMERA_UNAVAILABLE on Samsung A23: black screen #1553

Open ironmanromeo opened 1 year ago

ironmanromeo commented 1 year ago

SPECIFIC ISSUE ENCOUNTERED

Hello everybody. This is not a strictly SceneForm-related issue but indirectly it is. It is not clear if it was SceneForm that caused it or it is a problem with the phone: it happens that on a newly purchased Samsung A23 the camera no longer has the privileges and does not start. The error obtained from a native HelloWorld Java ArCore app returns that the camera is in use by another application. There is no need to close all the apps, delete them, re-install them: nothing is done. I also downloaded the demo app https://play.google.com/store/apps/details?id=com.gorisse.thomas.ar.environmentlights on the phone which has the same problem: the screen stays black. Access to the room has been given to all apps. The system camera app was restarted and I reset the settings: nothing to do. I don't know how it happened but on one occasion the camera unlocked and the apps worked, but once closed and reopened they no longer worked. Looking online "it seems" that the problem is limited to only some Samsung phones, even the A23 is not mentioned because it is still new. Tips? Thanks in advance.

https://developers.google.com/ar/reference/java/com/google/ar/core/TrackingFailureReason

Motion tracking paused because the camera is in use by another application. Tracking will resume once this app regains priority, or once all apps with higher priority have stopped using the camera. Prior to ARCore SDK 1.13, NONE is returned in this case instead.

VERSIONS USED

STEPS TO REPRODUCE THE ISSUE

  1. Build and install ArCore HelloWorld Java
  2. open the app
  3. black screen

WORKAROUNDS (IF ANY)

ADDITIONAL COMMENTS

agGitHub commented 1 year ago

Any update? Also have this issue.

matejnevlud commented 1 year ago

Tested on latest HelloWorld Java ArCore example, still black screen.

PauGuillamon commented 1 year ago

Same issue here with Samsung Galaxy A23 5G. Android build number: TP1A.220624.014.A236BXXU4CWE3 I tested it with ARCore 1.37 and 1.38 and I also get reports from users that the device was never able to handle any AR app. Uninstalling and reinstalling ARCore did not help.

ARCore seems to not be able to open the rear camera. The result of Session.update() is a Frame with timestamp always 0. When using the front camera, ARCore seems capable of opening it but unable to do any tracking.

Opening the camera through another library, such as Camera X, works fine. Also the system camera app works as expected (including face recognition). So it doesn't seem to be a hardware problem.

PauGuillamon commented 1 year ago

It also affects Unity. According to https://github.com/Unity-Technologies/arfoundation-samples/issues/1079, it worked fine with Unity 2020.3.23f1. Once I get access to a Galaxy A23 I'll test different ARCore versions to hopefully get the specific version that broke it.

matejnevlud commented 1 year ago

Tried using hello_ar_java sample from ARCore 1.20 and it`s working on A23 !!

https://github.com/google-ar/arcore-android-sdk/tree/v1.20.0

PauGuillamon commented 1 year ago

ARCore 1.22 (the one used in Unity 2020.3.23.f1) also works fine. ARCore 1.32 did not work.

ninjadev64 commented 1 year ago

I have the same issue on a Motorola Moto G8 Power (disguised as a Pixel 5 through root) using the HelloAR Kotlin sample. Is the solution just to downgrade ARCore?

yanadelrey commented 1 year ago

On Android 12 (API level 31) or later, make sure that "Block Camera" is set to OFF in system settings.

I randomly found it here in Errors section lol: https://developers.google.com/ar/design/interaction/ui

Tell me if it works. (btw I am a UX Designer)

tiofeliz commented 1 year ago

On Android 12 (API level 31) or later, make sure that "Block Camera" is set to OFF in system settings.

I randomly found it here in Errors section lol: https://developers.google.com/ar/design/interaction/ui

Tell me if it works. (btw I am a UX Designer)

Where do i set that off i cant found it anywhere :(

PauGuillamon commented 1 year ago

@yanadelrey that's not the case, the camera is accessible through the Camera2 API.

Bug is still reproducible with ARCore 1.40.

thecnoNSMB commented 10 months ago

A year later and this is still an issue. Should this be noted as a device-specific issue in #89 or is that thread dead?

cosminstefanxp commented 1 week ago

Hello, any updates on this? We've been stumbling upon this on Samsung A33. It seems it used to work with AR Core 1.21, but then something got broken. And the behaviour is that AR system cannot take ownership of the cameras.