cancel
Showing results for 
Search instead for 
Did you mean: 

Oculus SDK performance issues when project is launched from Unity Hub

ezra_vr
Honored Guest
We recently upgraded our Oculus Unity Integration from v1.36 to v16 and noticed the behavior I'm about to describe. I'm also able to reproduce it in a new project with just the Oculus Unity Integration package and the sample scenes included with it. It's...weird.

I'm using Unity 2018.4.4f1, building for standalone (but have also tried with Android), using a Rift CV1. I have a Quest + Link attached to my PC as well, but it's not my active device (and is currently unplugged). Testing with the Assets/Oculus/Avatar/Samples/Controllers scene and the Assets/Oculus/Avatar/Samples/LocalAvatar scene.

When I launch the Unity Editor directly, every frame takes about 3ms. When I launch my project via Unity Hub (v2.3.1), every frame takes about 9ms, with the extra time going to:
  • XR.DeviceSDK (2.66ms)
  • OVRP_1_16_0.ovrp_GetControllerState4() (2.63ms)
  • OVRPlugin.UpdateNodePhysicsPoses() (1.18ms)
When I'm getting the 9ms frame times, I also see these messages in the Unity Editor log (not the console, but the "Open Editor Log" option available via right-clicking the console tab):

[OVRPlugin][ERROR] Device required
^ (logged one time)

[OVRPlugin][ERROR] ovr_GetCurrentHandInputState failed: ovr_GetCurrentHandInputState: Only Oculus Link is supported.
^ (spammed in the log over and over)

At this point, I should clarify: it's not a given that launching from the Unity Hub will trigger the degradation in performance, it just has a very good chance of making it happen. I've launched Unity over and over, both from the hub and without it, and launching from the hub almost always triggers this degradation, but occasionally it doesn't. Similarly, I've seen this happen when launching the editor directly, but it's very rare. All of this leads me to believe that there's some sort of race condition during plugin initialization that might be exacerbated by the extra time Unity takes to set up IPC between editor <-> hub (which it doesn't do when the editor is launched directly).

I haven't had time to test this in every version of the Oculus Unity Integration SDK, but I've found that it happens in v16, v15, and v14, and I haven't managed to reproduce it in v1.36 or v12.

Whatever is happening here could also be the underlying cause of these issues:
https://forums.oculusvr.com/developer/discussion/89263/massive-cpu-usage-by-ovrmanager-update-talkin...
https://forums.oculusvr.com/developer/discussion/89040/ovrinput-updates-killing-performance
2 REPLIES 2

Anonymous
Not applicable
Yep we're seeing it too, on any computer with an old-school Rift attached. Also happening in v17.

tzmtn
Explorer
We are also seeing this, thanks for posting the workaround. We are using Unity 2019.3.15f1 by the way and we had to double click the scene file in order to bypass the hub