Log in or register to post comments

Camera goes black after scene restart

January 24, 2019 - 9:28am #1

Vuforia SDK Version: 8.0.1 -

Description with steps to reproduce: Setup any project with ARCamera. I used ground plane from core samples

Add button to restart the scene (simple SceneManager.LoadScene())

After few scene loads it results in black screen from ARCamera. The UI, 3D objects, Tracking, etc are working properly, just the background is black.

Random, once it took only 2 times to produce this, sometimes 10 times or more.

Restarting the scene again sometimes fixes the ARCamera (mostly on Android), on iOS when it goes black it will never init properly after next restarts.

App is going to be used at a fair by visitors and the experience will need to be restarted each time

Tested on:

Samsung s8 - restarting again after black screen sometimes fixes
Samsung s6 - restarting again after black screen sometimes fixes
Samsung s4 - restarting again after black screen sometimes fixes

iPhone 7 - black screen persists after first occurance after restarting again -

Development OS (Mac OS X, Windows, Linux): Mac, Windows -

Mobile OS and Version: iOS 12.1.3 Android 8.0.0 -

Mobile Device Manufacturer and Model name: iPhone 7, Samsung S8, S6, S4 -

Do the Vuforia Sample Applications show the same behavior?: Using Core Samples project and tested on Ground Plane scene has the same result

Camera goes black after scene restart

February 7, 2019 - 1:26pm #16

Thanks for the update, iamtheonly.  I spent several hours trying to trim down a project to a very small reproducible case.  It's really tough and time consuming, the issue presents after 50 sometimes 100 scene restarts, but other times it's right away.  Very random.  Anyways, since the fix is working, I'm moving on.  The issue is definitely there.  Hopefully someone else will stumble upon this and be able to create the reproducible case and submit a proper bug report.



 

Camera goes black after scene restart

February 4, 2019 - 10:25am #15

Hey there!

Sorry to get back to this so late. For me when testing on S8 I didn't have to "mash" the button to make this happen. The sample video you provided was a good repro case and should result in the black screen eventually. As dpizzle said, the problem is random though..

 

I do agree that this somewhat is a adversarial use case, but yeah, in the first post I mentioned that the app is going to be used on a fair where multiple exhibitors can take the phone and try the app and need the option to quickly reset the experience instead of closing and running the app again.

Anyways, the delay when initializing is working and it's not that noticable so I'm gonna stick with that.

Camera goes black after scene restart

February 1, 2019 - 9:24am #14

Hello,

FYI, regardless of whether or not this is an adversarial case, I've opened a ticket for core engineering to look into the issue to see if there are ways to make Vuforia more robust.

Thanks,

Vuforia Engine Support

Camera goes black after scene restart

February 1, 2019 - 9:03am #13

I agree, not standard at all, but the problem runs much deeper than this, this is just currently how I can reproduce on command every time.

The problem appears on normal scene switching in normal situations after Vuforia has inited. The problem is quite random though, and hard to figure.  

When I have time, I'll delve into it and provide a more normal example that reproduces often enough.  Please consider this issue open, until that time.

 

Camera goes black after scene restart

January 31, 2019 - 4:39pm #12

Hello,

I was able to reproduce by using your hint to press it multiple times in succession, without waiting for the background image to be re-rendered.

That being said, this use case seems adversarial and unlikely to occur in a real app. If you disagree, can you better explain the use case where you would reset a scene (with ARCamera) multiple times in succession, and not wait for Vuforia to complete initialization by using the provided APIs?

  • Vuforia has initialized (before trackers and camera are started): VuforiaARController.Instance.RegisterVuforiaInitializedCallback(OnVuforiaInitialized);
  • Vuforia trackers and camera have started: VuforiaARController.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted);
  • bool hasVuforiaStarted = VuforiaARController.Instance.HasStarted;

Thanks,

Vuforia Engine Support

Camera goes black after scene restart

January 31, 2019 - 3:54pm #11

Everything looks right.  All the build settings are default, so you should be good on that.  Try mashing the button as fast as you possible can.  You're pressing it really slow.  

I'm pretty busy right now, but I'll attempt to get you a better reproducible case/project early next week.

Camera goes black after scene restart

January 31, 2019 - 2:32pm #10

Hello,

Here's our Unity project and testing on the iPhone 8 Plus: https://www.dropbox.com/s/ro2hp8yob33sxyg/iPhone8Plus.zip?dl=0. Let me know if you see anything obvious that we missed.

I suggest you share your test project by zipping up the Unity Project folder. Perhaps there is something in the build settings that differs?

Thanks,

Vuforia Engine Support

Camera goes black after scene restart

January 31, 2019 - 7:05am #9

Unity 2018.3.2 and 2018.3.3

Vuforia 8.0.10

iOS 12.0.1



You're saying you created the project from the video, ran on an iOS device and then pressed the button as fast as you could, and it still didn't black screen?  

I'm really surprised, happens every time on all iOS devices we have.  Disconnect from xcode if you're debugging, seems to happen less when in that mode.

 

Camera goes black after scene restart

January 30, 2019 - 2:59pm #8

Hello,

Thanks for the additional info. Still no luck on our side using Unity 2018.3.3f1.

Can you provide the versions of Unity you're using? I don't see them referenced in this thread.

Thanks,

Vuforia Engine Support

 

Camera goes black after scene restart

January 30, 2019 - 8:10am #7

Here's a video that might help debug things:  https://www.dropbox.com/s/bc9pyspsva7bh31/BlackScreenBug.mp4?dl=0  

I didn't say in the video, this was running on iPhone 8+.  We've seen on about 4 different iOS devices, so I doubt it's device dependent.

Also, I can confirm adding the delay like iamtheonly suggests, solves the issue for us as well.  

Camera goes black after scene restart

January 29, 2019 - 3:44pm #6

Hello,

We attempted to reproduce the issue but were unable to using these steps with SDK 8.0.10 & Unity 2018.3.3f1:

  1. Created a new project, importing a Vuforia Core Samples 8.0.11
  2. Opened the Ground Plane scene
  3. Added functionality to reset the scene with the existing reset button
    • In PlaneManager.cs, in the ResetScene( ) function, added the following line of code at the bottom of the function:
      • SceneManager.LoadScene("3-GroundPlane", LoadSceneMode.Single);
    • This makes the reset button re-load the scene
  4. Built and ran on Android and iOS
    • Tested with Galaxy S8 (Android 7.0)
    • Tested with Galaxy S6 (Android 6.0)
    • Tested with iPhone 7 (iOS 12.0.1)

Is this an accurate repro scenario? Are we calling LoadScene() with the same parameters?

Thanks,

Vuforia Engine Support

Camera goes black after scene restart

January 24, 2019 - 4:10pm #5

Hello,

Thanks for the report and follow-ups. We're looking into it.

-Vuforia Engine Support

Camera goes black after scene restart

January 24, 2019 - 2:41pm #4

Fixed using delayed initialization

Vuforia config -> delayed initialization

Disable Vuforia Behaviour on ARCamera

 

Run this in start

 

private IEnumerator DelayedInit()

    {

        VuforiaRuntime.Instance.InitVuforia();



        yield return new WaitForSeconds(0.1f); // Wait time to let init finish. If black screen still persists increase wait time

       

        Camera.main.GetComponent<VuforiaBehaviour>().enabled = true;

       

    }

Consider adding like a text with "loading" if it takes too long to start up whole thing.

 

Looks like Vuforia isn't checking if Initialization was complete to run Behaviour on automatic, and reloading scene somehow breaks this? No idea how this is different than first time app launch (works everytime)

Camera goes black after scene restart

January 24, 2019 - 10:44am #3

Can't edit post due to some error

 

I've recorded a video how this looks: https://www.youtube.com/watch?v=huQ0Fy7FCtM

Camera goes black after scene restart

January 24, 2019 - 10:36am #2

Yes please take a look at this Vuforia!  We are seeing this as well. Thanks iamtheonly, for creating a simple reproducable case, was about to do this today.

I have seen this on a range of IOS devices (iPad Pro, iPad 2018, and iPhone 8+).  I never encountered it prior to Vuforia 8, but can't be sure it wasn't there.  It seems to happen at random and can't quite figure out the cause.  At first I thought it had to do with loading a scene before Vuforia fully initializes, and thought I could work around it, but that's not always the case.  

And like iamtheonly said, tracking works fine, the camera view is just black.  On one of our projects we can recover by going to a different scene, on another one of our project, black camera view persists no matter what you do. 

Log in or register to post comments