vuforia-engine icon indicating copy to clipboard operation
vuforia-engine copied to clipboard

Continuous autofocus not working on iPhone 16 pro max

Open shalesh-shekhar opened this issue 11 months ago • 16 comments
trafficstars

Summarize the bug: The continuous autofocus doesn't work on iPhone 16 Pro Max. We used Vuforia's camera configuration to set continuous autofocus and also implemented it during runtime through scripting, but neither approach resolved the issue.

Observed problem: On other iPhones, the autofocus is swift and accurate. However, on the iPhone 16 Pro Max, autofocus doesn't work properly or is very unstable and slow. So far, I have set the continuous autofocus through Vuforia's camera configuration settings and also through scripting, but neither approach resolves the issue.

Expected result: The normal camera configuration should work consistently across all devices. With the script, continuous autofocus should engage successfully after Vuforia is initialized and loaded.

Other observations: Even when the image appears to be in focus, the app sometimes fails to recognize the target image.

Reproducible steps:

  1. Create a basic Vuforia project with an image target.
  2. Build and deploy the app to an iPhone 16 Pro Max.
  3. Observe autofocus behavior while scanning the target image.

Affected Vuforia Engine version: 10.27 Workstation OS: Mac Platform: Unity Platform version: Unity 6

Affected device: Name: iPhone 16 Pro Max OS: iOS 18

Screenshots / Video Recordings: Video will be attached to showcase the issue.

https://github.com/user-attachments/assets/d50104d7-7b61-4dac-a9ae-207217045ce9

shalesh-shekhar avatar Dec 05 '24 10:12 shalesh-shekhar

Thank you for your report.

We will try and reproduce the auto focus issue and get back to you. Please note that this may take a little longer while we acquire the specific device.

ptc-thesbyro avatar Dec 05 '24 12:12 ptc-thesbyro

I hope you're doing well! I wanted to follow up on the status of this error. It's been a couple of weeks since the report, and I was wondering if there are any updates or an estimated timeline for when I might hear back about the reproduction results. If there's any additional information or testing on my end that could assist, please let me know. Looking forward to your response!

shalesh-shekhar avatar Dec 16 '24 09:12 shalesh-shekhar

Hi,

We did not yet receive the device yet, so unfortunately, we do not have any updates. I think the only test you could do on your end is to try and reproduce the issue by running the app on a different iPhone 16 Pro Max with OS version iOS 18.

As we are nearing Christmas and new year vacation for many people, it's difficult to say when we will have updates. We could be lucky and receive the device within the next days and reproduce and fix the issue on the first try. If we don't, there's likely not any updates from us until the end of the first week of January.

ptc-thesbyro avatar Dec 16 '24 12:12 ptc-thesbyro

+1 This issue also exists in my application.

My phone is a Samsung Galaxy Note10+. Unity 2022.3.5, URP, Vuforia 10.27 While adding the script to autofocus when tapped twice works, the autofocus itself not working well. What I noticed is that it works at the start, but after frame freezing (another issue on URP, the frame freezes for 0.5-1 sec), autofocus stops working and always focuses far away.

Archi97 avatar Dec 22 '24 10:12 Archi97

Hi @Archi97,

I will add your information to the bug ticket, however, your observed issue may be unrelated to the one seen on the iPhone 16. I would be surprised if it's Unity 6 (the common factor in your reports) that interferes with the focus modes. Have you tried reproducing the autofocus issue and frame freezing up in Unity 2022 LTS?

ptc-thesbyro avatar Jan 07 '25 10:01 ptc-thesbyro

Hi @Archi97,

I will add your information to the bug ticket, however, your observed issue may be unrelated to the one seen on the iPhone 16. I would be surprised if it's Unity 6 (the common factor in your reports) that interferes with the focus modes. Have you tried reproducing the autofocus issue and frame freezing up in Unity 2022 LTS?

Hi @ptc-thesbyro . I use Unity 2022.3. i believe it is URP problem. During the freezes i noticed that the content's animation is still normal. So freeze happens on the camera+rendering part not the app it self.

Archi97 avatar Jan 07 '25 10:01 Archi97

Ah thanks for the correction. I misread that part.

ptc-thesbyro avatar Jan 07 '25 11:01 ptc-thesbyro

We have tested AutoFocus behavior on iPhone 16 Pro and what we see AutoFocus working however it is very very slow compared to other models and it takes up to 10 seconds to refocus on a change of scene depth. In some rare cases also the AF fails to trigger. The slow AF issue is limited to ARkit camera (which we internally use by default), and one can reproduce it even outside of Vuforia Engine (for example with one of the ARKit samples ).

I have started a thread in the Apple developers forum. If you experience this issue please raise its importance by clicking on the Boost button and adding a comment https://forums.developer.apple.com/forums/thread/772721

ptc-emaggio avatar Jan 21 '25 09:01 ptc-emaggio

A workaround exists by disabling the platform fusion provider. In Unity select VUFORIA_FUSION_ONLY, in native code set usePlatformFusionProvider to false.

On iOS this switches off ARKit and Engine will use the standard AVFoundation camera API where autofocus is more responsive. Note that not all Engine features work with ARKit disabled (for details please see this page on Vuforia Fusion).

ptc-emaggio avatar Jan 22 '25 10:01 ptc-emaggio

A workaround exists by disabling the platform fusion provider. In Unity select VUFORIA_FUSION_ONLY, in native code set usePlatformFusionProvider to false.

On iOS this switches off ARKit and Engine will use the standard AVFoundation camera API where autofocus is more responsive. Note that not all Engine features work with ARKit disabled (for details please see this page on Vuforia Fusion).

Will this step also work on Android?

Archi97 avatar Jan 22 '25 13:01 Archi97

Will this step also work on Android?

@Archi97 it is possible as also on android by disabling the fusion provider Engine switches to the default Android camera API instead than ARCore. Still, the Android issue is completely unrelated to the iPhone one and we have not been able to reproduce it so far.

ptc-emaggio avatar Jan 22 '25 13:01 ptc-emaggio

@Archi97 regarding your AF issue could you please file a separate github issue indicating the exact steps to reproduce? In particular please add information if the issue happens after a tap event or if it is independent on the tap event.

ptc-emaggio avatar Jan 23 '25 12:01 ptc-emaggio

@ptc-emaggio any new on this bug? it seems like the iPhone 16 pro max as a focus issue

liavezra avatar Feb 28 '25 14:02 liavezra

hi @liavezra unfortunately this is an issue with the phone itself not with Vuforia Engine. I have highlighted here a possible workaround but a proper fix has to come from Apple. If this issue affects your application please let Apple know by clicking on the boost button or by leaving a comment on the thread https://forums.developer.apple.com/forums/thread/772721

ptc-emaggio avatar Feb 28 '25 15:02 ptc-emaggio

@ptc-emaggio can you guide me how to change it in vuforia configuration file?

liavezra avatar Mar 04 '25 09:03 liavezra

Hi @liavezra, you can see the general information about Vuforia Fusion here, and a code sample to set the FusionProvideOption here

Hope it helps,

ptc-thesbyro avatar Mar 04 '25 09:03 ptc-thesbyro

Apple reported back on their investigation on the issue and concluded that autofocus on 16 Pro works as by design. I will close this ticket as, beside the workaround suggested above, there is not much we can do on our side.

ptc-emaggio avatar Aug 21 '25 10:08 ptc-emaggio