PTCInc / vuforia-engine

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

Entering playmode with "Domain Reload" disabled fails initialization. #38

Closed TheXRMonk closed 1 year ago

TheXRMonk commented 1 year ago

Summarize the bug: After updating from 10.13.3 to 10.15.4, we've noticed that vuforia fails to initialize in playmode. And our project runs with "reload domain" disabled under "Enter Play Mode Settings".

The only way to fix is to enable reload domain, enter and exit play mode to trigger a domain reload, and then hereafter we can disable "reload domain" in the settings again and it will work for a while. Haven't figured out what triggers the bug, since we have to do this "dance" once in a while.

Expected result Should not fail to initialize.

Affected Vuforia Engine version: v10.15.4

Affected platform:

Workaround See above;

The only way to fix is to enable reload domain, enter and exit play mode to trigger a domain reload, and then hereafter we can disable "reload domain" in the settings again and it will work for a while. 
Haven't figured out what triggers the bug, since we have to do this "dance" once in a while. 
ptc-pscheper commented 1 year ago

Hi there, which Unity version are you using? And is it possible to add reproducible steps? (Accidentally closed and reopened this case, sorry!)

TheXRMonk commented 1 year ago

Hi there, which Unity version are you using? And is it possible to add reproducible steps? (Accidentally closed and reopened this case, sorry!)

Unity version is in report above (2022.3.2f1)

I don't know how to provoke it to appear.

But I just found another workaround by simply reimporting a script to force a domain reload.

TheXRMonk commented 1 year ago

I think closing unity and after reopening, and then entering play mode without domain reload it will trigger the initialization error.

TheXRMonk commented 1 year ago

This is the most info i can get out of the error;

Failed to create Vuforia engine: Engine initialization error
—
at void UnityEngine.Debug.LogError(object message)
void Vuforia.Internal.Utility.UnityLogger.LogError(string message)
void Vuforia.Internal.Utility.Log.Error(string message)
bool Vuforia.Internal.Core.Engine.InitOnCameraReady()
bool Vuforia.Internal.ExternalCamera.NullExternalCamera.Init(Func<bool> initOnCameraReady)
bool Vuforia.Internal.Core.Engine.Init(string recordingPath)+() => { }
void Vuforia.Internal.Core.EnginePermissions.OnPermissionRequestFinished(bool allPermissionsGranted)
void Vuforia.Internal.Permissions.EmptyPermissionRequester.Request(IEnumerable<Permission> permissions)
void Vuforia.Internal.Core.EnginePermissions.RequestPermissions()
void Vuforia.Internal.Core.EnginePermissions.Request(Action continueAction)
bool Vuforia.Internal.Core.Engine.Init(string recordingPath)
void Vuforia.VuforiaApplication.InitEngine()
void Vuforia.VuforiaApplication.Initialize()
void Vuforia.Internal.Core.OneTimeInitialization.Initialize()
ptc-pscheper commented 1 year ago

I will create a new Unity project, add the older version of Vuforia to it, and update it to see if I can reproduce the error. Which play mode are you using, the webcam mode?

TheXRMonk commented 1 year ago

I will create a new Unity project, add the older version of Vuforia to it, and update it to see if I can reproduce the error. Which play mode are you using, the webcam mode?

Yes, using Webcam.

TheXRMonk commented 1 year ago

I will create a new Unity project, add the older version of Vuforia to it, and update it to see if I can reproduce the error. Which play mode are you using, the webcam mode?

I got some more info for you here;

ptc-pscheper commented 1 year ago

Hi there, sadly I was not able to reproduce the issue. Can you setup a new project and try to reproduce the issue, while writing down the steps to reproduce? If the issue cannot be consistently reproduced there is no way to solve the issue. I tried to reproduce the issue but was unsure what your "Enter Play Mode Settings" are. The "Reload Domain" property should already be disabled by default.

TheXRMonk commented 1 year ago

Hi there, sadly I was not able to reproduce the issue. Can you setup a new project and try to reproduce the issue, while writing down the steps to reproduce? If the issue cannot be consistently reproduced there is no way to solve the issue. I tried to reproduce the issue but was unsure what your "Enter Play Mode Settings" are. The "Reload Domain" property should already be disabled by default.

Pretty sure it's not off by default. Our settings looks like this; image Maybe we can set up a call next week? I can reproduce this issue fairly easy.

ptc-pscheper commented 1 year ago

Hi there, sorry but I am a little confused. Let's try to align. You stated here the following:

I don't know how to provoke it to appear.

Hence I am confused because in your last comment you stated you it can be reproduced very easy. Could you try to share the reproducible steps? Preferably if you can reproduce it with our Core Samples or a new Unity project without any of your own assets or code.

Also it seems, when I create a new Unity project, the project starts with the "Reload Domain" property disabled:

image

Could you disable "Enter Play Mode Options" completely and try to see if that solves the issue?

TheXRMonk commented 1 year ago

Also it seems, when I create a new Unity project, the project starts with the "Reload Domain" property disabled:

image

Could you disable "Enter Play Mode Options" completely and try to see if that solves the issue?

I just opened the sample project in a fresh 2022.3.2f1 project, and was able to reproduce the bug.

I simply just went into the settings, enabled "Enter playmode options", and turned off reload domain while keeping scene reload on. Then entered playmode and got the same initialization error. This is definitely a bug in Vuforia 10.16.5+4097.

I then just reimported a random script (to trigger domain reload), entered playmode, and the bug dissappeard again.

Then exit playmode, create a new script, and enter playmode, and the bug will return.

The "Enter Play Mode options" tickbox has to be enabled for unity to even consider the "Reload Domain" and "Reload Scene". Default behaviour is that unity performs domain and scene reload when you don't check "enter playmode options".

https://docs.unity3d.com/Manual/ConfigurableEnterPlayMode.html

Yes, if we enable "Reload Domain" it works fine again in our project.

ptc-pscheper commented 1 year ago

Hi there, I was able to reproduce the bug and have reported this internally for further investigation. The steps were:

  1. Create a new Unity project (2022.3.5f1)
  2. Add Vuforia Engine to the project
  3. Remove Main Camera and Add ARCamera
  4. Enable "Enter Play Mode Options" and "Reload Scene" while disabling "Reload Domain" (note that the error even happens when they are both disabled)
  5. Start Play Mode
  6. Stop Play Mode
  7. Create a new C# script in the Project files
  8. Start Play Mode
  9. See Initialization error

Could you elaborate why you need this setting to be enabled for your project? It seems that when "Enter Play Mode Options" is turned off, the issue is not appearing. The workaround as well is to disable "Enter Play Mode Options".

TheXRMonk commented 1 year ago

Awesome!

Could you elaborate why you need this setting to be enabled for your project? It seems that when "Enter Play Mode Options" is turned off, the issue is not appearing. The workaround as well is to disable "Enter Play Mode Options".

Simply because without domain reload we can enter playmode in less than a second, while with domain reload it takes around 30 seconds and will only get worse as a project grows. tldr: Iteration time

Also worth emphasizing, this wasn't an issue with vuforia 10.13.3 so something must have changed.

ptc-ddowning commented 1 year ago

Hello @TheXRMonk,

The fix is targeted for our next commercial release (10.17), due in mid-August.

We appreciate your assistance and patience.

ptc-pscheper commented 1 year ago

Please note that v10.17 has been released and can be download via the Engine Developer Portal! Happy developing!