UE4 Oculus fork and OVRPlugin OpenXR not detecting correct HMD

Hey, there’s issues with OpenXR from the official 4.27.2 build so I switched to the Oculus fork, I was told that using OpenXR + OVRPlugin OpenXR would be the equivalent to the default OpenXR + Oculus OpenXR from the official vr template.

The problem is that OpenXR + OVRPlugin OpenXR is not detecting my Quest 2 headset and the controllers are flipped 90 degrees, it’s detecting it as OculusHMD instead, why is OpenXR not detecting the correct HMD when used with OVRPlugin OpenXR?

The OpenXR standard by design has no way to detect what HMD you are using. For better or worse, the intent seems to be to force developers to design applications in device-agnostic way.

I’m confused, when I use OpenXR “Get HMDDevice Name” prints “Oculus Quest 2”, and when I use OpenXR + OVRPlugin OpenXR it prints OculusHMD, why does it differ?

Looking at it, the OpenXR plugin returns the value of XrSystemProperties.systemName
which is up to the runtime what the put in there. The SteamVR runtime at least only puts in what driver is used rather than the headset name. Not sure how Oculus represents it, but guessing that’s where the “Oculus Quest 2” comes from.

Seems like the custom Oculus plugin might be overriding the OpenXR version with the default implementation of IHeadMountedDisplay::GetHMDName() which just returns the plugin name. Not sure if that is fixable without modifying the code.

What worries me is the different controller orientation, and why does it differ when using OpenXR / OpenXR + OVRPlugin OpenXR, in the official build using OpenXR / OpenXR + Oculus OpenXR makes no difference, why does it differ in the Oculus fork?

I don’t really need to detect which hmd is being used but this was an observation while trying to understand why my vr hands end up being flipped 90 degrees using OVRPlugin OpenXR, my guess was that it adjusted the orientation to match the controllers it thinks I’m using, and that’s why I checked the device name.

It might be worth checking whether the motion controller transforms differ, or if it’s just he models.

It might be using a different source for retrieving the controller models. The base OpenXR spec doesn’t have any way to get controller models, so Epic has a set of models in the OpenXR plugin. Oculus has a proprietary extension for retrieving the model, so one of the branches might be doing that while the other one doesn’t.

Alright so I’ve done some tests in an empty template to simplify things, and I’ve attached cubes to the motion controllers and hid the actual controller model to rule that out, both the motion controllers and the cubes transforms are unchanged, and I’m holding the controllers in the same position during both tests, however they’re in a different orientation as shown here

Not sure why it still differs

I don’t think it should even be possible to access that pose from OpenXR. I would guess that the OVRPlugin is somehow disabling OpenXR and using the legacy API instead.

That’s what it looks like to me as well since that’s the behavior I get using the legacy plugin, I’ve been told multiple times that OpenXR + OVRPlugin OpenXR is the same as OpenXR + Oculus OpenXR from the official 4.27.2 build but it doesn’t seem like it