Log in or register to post comments

Long Initialization Time on HoloLens

October 13, 2021 - 11:15am #1

I am developing an offline Vuforia app for the HoloLens 2 that requires a delayed initialization. I am able to force Vuforia to wait until I call VuforiaRuntime.Instance.InitVuforia(); However, on the HoloLens, it takes 13 seconds for Vuforia to initialize and finish its tasks. During this time, the entire screen goes blank and I am unable to see any holograms or do anything. In the Unity editor, initialization takes a fraction of a second. 

 

On older forum posts, there is a line of code (VuforiaUnity.SetHint(VuforiaHint.HINT_ASYNC_FETCH_OF_LATEST_CALIBRATION, 1);) that users are told to use, however, Unity does not recognize the VuforiaUnity namespace and the link to the documentation results in a 404. 

 

What can I do to significantly lower the load times for Vuforia initialization? I am using Vuforia 9.8.8 and my image target database only has 8 targets. 

Long Initialization Time on HoloLens

October 18, 2021 - 10:38am #5

Hello @Dogfishlab,

Thanks for the clarification. I'll have the portal documentation updated accordingly.

Thanks,

Vuforia Engine Support

Long Initialization Time on HoloLens

October 15, 2021 - 6:46am #4

Finally was able to get it to compile. For those with the same issue as me, you need to put 

VuforiaUnity.SetHint(VuforiaUnity.VuforiaHint.HINT_ASYNC_FETCH_OF_LATEST_CALIBRATION, 1);

Now, it only takes half a second to start and initialize Vuforia. 

Long Initialization Time on HoloLens

October 13, 2021 - 12:09pm #3

I should have been more specific in my original post. Unity does not have a problem recognizing the VuforiaUnity namespace, but VuforiaHint. "error CS0103: The name 'VuforiaHint' does not exist in the current context". I am not sure what I should be importing to make that work. 

Long Initialization Time on HoloLens

October 13, 2021 - 11:24am #2

Hello,

I believe the forum post you found is related to this text, which is in the following article: https://library.vuforia.com/articles/Solution/How-To-Migrate-a-Unity-Project.html

"Vuforia Engine 7.2 has made some changes to the initialization process that may impact the flow of your application. The default initialization behavior of Vuforia Engine 7.2 is to download the latest device profile in order to deliver the best experience on the device.  Depending on the speed of the user's internet, this could add several seconds to application load. This only occurs the very first time the user launches the app and will not impact application loading in future launches of the app.

It is strongly recommended to allow the Vuforia Engine to fetch the latest device profile. Developers looking to disable this behavior should set the following hint before initializing Vuforia Engine: VuforiaUnity.SetHint(VuforiaHint.HINT_ASYNC_FETCH_OF_LATEST_CALIBRATION, 1);"

I'm a bit confused from your comment about Unity not recognizing the namespace as this API is clearly documented: https://library.vuforia.com/sites/default/files/references/9.8/unity/classVuforia_1_1VuforiaUnity.html

Thanks,

Vuforia Engine Support

Log in or register to post comments