google-ar / arcore-android-sdk

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

autofocus not working in pixel6 #1312

Open canaee opened 2 years ago

canaee commented 2 years ago

SPECIFIC ISSUE ENCOUNTERED

Hello, I turned on auto focus in my app, and the focus model I got was auto, but the image I got are still blurry. Is there any way to make the image clearer? Here is my code: mSession = new Session(this); Config config = mSession.getConfig(); config.setFocusMode(Config.FocusMode.AUTO); Log.i("focus", "focus:"+configuration.getFocusMode()); Out:I/focus: focus:AUTO

Here is my image: image

VERSIONS USED

Android Studio: 4.2.1 ARCore SDK for Android: 1.28.0 Device manufacturer, model, and O/S: google Pixel6 ,Android version 12 Google Play Services for AR (ARCore):1.28.212840293 Output of adb shell getprop ro.build.fingerprint: google/oriole/oriole:12/SD1A.210817.036/7805805:user/release-keys

STEPS TO REPRODUCE THE ISSUE

1. 1. 1.

WORKAROUNDS (IF ANY)

ADDITIONAL COMMENTS

canaee commented 2 years ago

When I use version 1.22 auto focus is normal and the image i got is clear. May I ask is there a problem with auto focus in versions after 1.22

PauGuillamon commented 2 years ago

Having the same issue here. I noticed putting the app in the background and coming back "fixes" the issue.

Other workarounds:

kevinylo commented 2 years ago

still seeing this issue in AR core v1.30.

maxrd2 commented 2 years ago

I am having this same issue on other devices: Pixel3, Galaxy S22.
Using ARcore 1.30.0

EDIT: workaround with resume/pause/resume fixes the issue for me too:

    // NDK no delay between function calls
    ArSession_resume(_arSession);
    ArSession_pause(_arSession);
    ArSession_resume(_arSession);
gayko1976 commented 2 years ago

Still exists with v1.31. Annoying...

AlessandroMulloni commented 1 year ago

Still occurring with 1.36.0. The trick with resume / pause / resume still works.

mizhoux commented 1 year ago

Still occurring with 1.36.0. It's maddening, why not expose a method of ARSession for manual focus...

PauGuillamon commented 1 year ago

@mizhoux hopefully the resume/pause/resume workaround also works for you.

ADDITIONAL INFORMATION The issue also happens when using WebXR on the web. In which case AFAIK it's not possible to apply the resume/pause/resume workaround.

It's also reproducible in any of the AR samples from https://immersive-web.github.io/webxr-samples/. Tested on Chrome Android 112.0.5615.47 on a Samsung Galaxy S21 (Android 13).

mizhoux commented 1 year ago

@PauGuillamon Thanks for filling the hole, the trick 'resume/pause/resume' also works for me.

MihMihai commented 11 months ago

Having the same issue here. I noticed putting the app in the background and coming back "fixes" the issue.

Other workarounds:

* For me cleaning up Google Play Services for AR data fixed the issue. Rebooting the device or forcing stop the service makes the issue appear again.

* when creating the ARCore Session, call resume(), pause() and resume() again.

The resume(), pause(), resume() combination worked for me too using version 1.39.0 of the ARCore library. Thanks a lot!