Search Unity

Camera video feed freezes when re-initializing Vuforia

Discussion in 'Vuforia' started by andersemil, Feb 28, 2018.

  1. andersemil

    andersemil

    Joined:
    Feb 2, 2015
    Posts:
    53
    We have a larger mobile Unity project in 2017.3.1p1 where the AR experience is but a sub-level of the Unity project, therefore we use delayed initialization option and manually call VuforiaRuntime.Instance.InitVuforia () before loading an AR scene.
    When the scene is unloaded, we call VuforiaRuntime.Instance.Deinit () and continue the app.
    This all works perfectly in editor, and also works fine first time on devices.
    However, on iOS devices (tried 5S and X), when we return to the sub-level and call InitVuforia again, something fails and we get no camera video at all. The log output is all the same as the first time round, EXCEPT for one line beginning with:

    "failed to setVideoBackgroundTexturePtr"

    Any ideas? We tried to call CameraDevice.Instance.Init / Start and Deinit / Stop manually, doesn't change a thing...

    Also tried calling VuforiaUnity.Deinit () rather than VuforiaRuntime.Instance.Deinit (), no difference.

    Any help or tips appreciated!
     
    Last edited: Feb 28, 2018
  2. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Hello @andersemil

    Could you try using "VuforiaBehaviour.instance.enabled = false/true;" and let me know if that resolves your issue?

    Thanks