Log in or register to post comments

Pause Camera?

May 7, 2019 - 1:55pm #8

I am using 32 image targets and it takes ~5 seconds to initialize Vuforia. 

I have 2 questions:

1. How to speed up initialization?

2. I need to re-init the vuforia camera to save battery inbetween image detection. Can I pause the camera, so it doesn't need to be re-initialized and take another 5 seconds?

 

thanks

Pause Camera?

May 9, 2019 - 10:33am #7

Hello,

emorling wrote:

1. How to speed up initialization?

Vuforia Engine 7.2 made changes to the initialization process that may impact the flow of your application. The default initialization behavior of Vuforia Engine 7.2 (and beyond) 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: VuforiaUnity.SetHint(VuforiaHint.HINT_ASYNC_FETCH_OF_LATEST_CALIBRATION, 1);

emorling wrote:

2. I need to re-init the vuforia camera to save battery inbetween image detection. Can I pause the camera, so it doesn't need to be re-initialized and take another 5 seconds?

There is no concept of camera "pause" in Engine APIs. However, as a power saving feature, we recommend that you enter a Unity scene that *does not* have an ARCamera. This essentially "pauses" Vuforia.

Thanks,

Vuforia Engine Support

 

Pause Camera?

May 9, 2019 - 2:36pm #6

Loading a new scene is not an option unfortunately, in this case.

I found this method described in the forum. 

VuforiaRenderer.Instance.Pause(false);

 

Is it not a recommended way to pause and play Vuforia?

Pause Camera?

May 9, 2019 - 3:54pm #5

Hello,

From our internal benchmarking, some of the most significant power drains on a device while running Vuforia Engine SDK come from:

  1. The display (the most significant power consumer, by far)
  2. The camera stack
  3. The tracker

#1 cannot be paused, and the API you've referenced does nothing for #2 & #3.

An additional option is to use Engine APIs to stop the camera and/or the tracker. Here is the recommended sequence:

  1. Stop camera: https://library.vuforia.com/content/vuforia-library/en/reference/unity/classVuforia_1_1CameraDevice.html#a7d498b13dc60fe7d0ba25025182d53fd
  2. Stop tracker: https://library.vuforia.com/content/vuforia-library/en/reference/unity/classVuforia_1_1Tracker.html#a91cb134594ca8097f1a54b1df902359b

And then reverse the order to start.

Note that stopping the camera and/or tracker will have negative effects for any existing AR experience - to state the obvious.

HTH.

Thanks,

Vuforia Engine Support

 

 

Pause Camera?

May 15, 2019 - 11:58am #4

Okay, but what would you say is the impact for initializing the image database and targets with the method of stopping the camera and tracker?

 

 

Pause Camera?

May 15, 2019 - 4:00pm #3

Hello,

I have no direct knowledge of the impact of loading a device database with the methods I described below.

Intuitively, I would think that the tracker should be running when loading/unloading device databases. Please let me know if your tests indicate otherwise.

Thanks,

Vuforia Engine Support

Pause Camera?

May 29, 2019 - 3:39am #2

Hello,

Some parts of my app are not in AR, so to save the battery life, I used

Quote:

CameraDevice.Instance.Stop();

and 

Quote:

CameraDevice.Instance.Start();

It was working, until I update to Unity 2019.1.x and Vuforia 8.1.1. Now I have the following errors, on IOS only, when I try to restart the Camera after a pause:

Quote:

cameraDeviceStartCamera INFO/AR(391) 2019-05-30 12:23:53: Starting camera with profile for iPhone8,4, 800.1 Execution of the command buffer was aborted due to an error during execution. Caused GPU Timeout Error (IOAF code 2)

then multiple times:

Quote:

Execution of the command buffer was aborted due to an error during execution. Discarded (victim of GPU error/recovery) (IOAF code 5)

then indefinitely:

Quote:

Execution of the command buffer was aborted due to an error during execution. Ignored (for causing prior/excessive GPU errors) (IOAF code 4)

Setup:

Unity 2019.1.x

Vuforia 8.1.11

iPhone 6 SE

iOS 12

 

Any idea how I can Pause / Start the camera without crashing everything? Thanks!

Pause Camera?

June 5, 2019 - 8:04am #1

Hello,

This is one of the known issues with Vuforia Engine SDK 8.1.X and Unity 2019.1: https://developer.vuforia.com/forum/unity/known-issues-unity-20191

We are planning to release a fix in our next commercial release, targeted for sometime later this month. Recommendation is to use 2018.4 as we've not observed this problem with that version of Unity.

Thanks,

Vuforia Engine Support

Log in or register to post comments