Android (Oculus Go) app freezing even before the Unity logo

I’ve made a trivial app — just a textured plane and a cube — for Oculus Go (an Android device), and when I Build and Run, the device goes to a black screen and freezes. This is before the Unity logo, or even the background color set in Player Settings (Splash Image), appears. In this state, the Back button on the controller (which should pause/exit the app) does not work, and I have to hold the power button for several seconds to reboot or shut down the device.

When I launch the app with adb logcat running, the last Unity messages I see are:

Then we get a whole bunch of OVRPlugin and VrApi messages, including “OVRPlugin: Entering VR mode” and “VrApi: HMD sensor attached.” Messages like these continue indefinitely, even as the app/device appear locked up to the user.

Though the scene is trivial, it’s part of a much larger app that has a bunch of legacy stuff (it’s a desktop app that I will be porting to Android). I’m a bit suspicious of that GameObserver bit; that seems to come from Unity’s CloudAnalytics plugin.

At any rate, I’m not sure how to proceed… when even a trivial app locks up on launch like this, before even getting to the Unity logo, how can I debug it? Any ideas?

Today it occurred to me to wait and see if the loading process (even before the Unity logo) is just taking a very, very long time.

Turns out that if I wait five minutes or so (with the head sensor covered so it thinks I’m wearing it the whole time), the app process actually dies. The device then puts itself to sleep, but I can wake it up and use it normally without rebooting. So, that’s something. :stuck_out_tongue:

On my last test, the game was pid 9417… so here are logcat lines related to that:

Does any of that trigger an “a-ha!” for anybody? All I see is that the CPU usage is very high for the whole five minutes (those Util Poller and VrApi messages repeat much more than I’ve copied above, but all tell the same story). Smells like an infinite loop to me, but one that occurs well before getting into any of my code — if indeed this scene had any code in it, which it does not.

Thanks for any help!

1 Like

You could try attaching the Android Studio debugger and using “Get Thread Dump” to see what the threads are up to. Maybe the callstacks will shed some light on the situation.

Sam

Did you manage to get anywhere with this? I’m still seeing this much later and with LWRP.

Once the app has started up I get a lot of:

vrapi_GetPredictedTracking2: ovr == NULL

And earlier I see this?

03-27 21:44:31.519 18191 18206 I OVRPlugin: OSSDK::VrDevice::v2::createVrDeviceManager() succeed
03-27 21:44:31.519 18191 18206 I VrApi   : ------------ vrapi_CreateSystemVulkan -----------
03-27 21:44:31.519 18191 18206 W Unity   : If your machine has multiple graphics adapters, Unity may have created a WindowContext on the wrong adapter. If you experience a black screen when playing, please restart the Editor.
03-27 21:44:31.519 18191 18206 W Unity   :
03-27 21:44:31.519 18191 18206 W Unity   : (Filename: ./Modules/VR/VRDevice.cpp Line: 323)
03-27 21:44:31.519 18191 18206 W Unity   :
03-27 21:44:31.520 18191 18232 D OVRPlugin: Finished setting up render thread.
03-27 21:44:31.520 18191 18232 D OVRPlugin: Entering VR mode.
03-27 21:44:31.520 18191 18232 I VrApi   : ---------- vrapi_EnterVrMode [start] ----------

I wonder if it’s actually working but created the device on the wrong adapter for some reason?

Wondering why there are OVRPlugin entries; do you have VR enabled?

Yes VR is enabled, if you mean Player → Other → XR Settings → Virtual Reality Supported

Note that this is when building with Vulkan and I am now seeing warnings that Vulkan does not work atm in XR. Can you confirm whether this is the case and if it is on the roadmap to fix? Vulkan for GO I have high hopes for…

Right.
I think the message is correct and Vulkan is not supported on VR yet. Let me find someone to confirm…

1 Like

Yes; the warning about Vulkan not being supported by Vulkan is correct. We’re working on completing the integration for all of the VR rendering modes. Support should be in 2019.3 at the latest.

1 Like

Thanks. I’ll stop trying to use it then :slight_smile: It will be very interesting to see how it improves rendering speed when it is available.