PTCInc / vuforia-engine

Bug and feedback issue tracker for the Vuforia Engine SDK
https://developer.vuforia.com
20 stars 0 forks source link

The Camera restarts itself when the application looses then regain focus on Android #100

Closed tsoen closed 5 months ago

tsoen commented 8 months ago

Summarize the bug: When our application is not using the camera feed, or is using another camera than the Vuforia Camera (e.g. using a WebCamTexture for using the Front Camera, our using an USB External Camera), we disable the Vuforia Camera to save performance and battery life, and to avoid having to manage the events triggered by Vuforia when we don't need them (e.g. World.OnStateUpdated). To do so, we disable the VuforiaBehaviour component in our scene.

However, when the Android application looses focus (e.g. goes to the background, or if any native Android pop-up is shown on top of the app), then regain focus, we noticed that the Vuforia re-initializes itself and the Back (Vuforia) Camera restarts.

What is weird is that the VuforiaBehaviour is still disabled in the scene. We checked that there was only one VuforiaBehaviour in the scene, and it was still disabled, but everything is working as it was activated : we get events from VuforiaBehaviour.World.OnStateUpdated and the Camera is rendering the video in the application.

Expected result Vuforia does not restarts after a temporary loss of focus.

Reproducible steps Steps to reproduce the behavior:

  1. Open Vuforia-Core-Samples project
  2. Add a button to disable the VuforiaBehaviour component in a scene
  3. Build to Android
  4. Click the button to disable the VuforiaBehaviour
  5. Send the application to the background
  6. Bring the application to the foreground
  7. Camera restarts

Affected Vuforia Engine version: v10.19.3

Affected platform:

Affected device:

Device or platform logs I can share logs from Android LogCat if needed.

Workaround No.

ptc-epassaro commented 8 months ago

Hi @tsoen, thank you for the detailed report. The team was able to identify the issue and will be working on a fix for an upcoming release of Vuforia Engine. We will keep you posted on the status of the fix.

ptc-thesbyro commented 5 months ago

Hi,

Disabling the Vuforia Behaviour now persists through app resumes with the latest 10.24 release.

I will close this ticket as completed but feel free to re-open it if the problem persists.

Thank you,