Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OVRPlugin.GetSystemHeadsetType() always returns Oculus_Quest_2 when using OpenXR Plugin #15

Closed
WikkidEdd opened this issue Apr 16, 2024 · 3 comments

Comments

@WikkidEdd
Copy link

WikkidEdd commented Apr 16, 2024

Description

When switching to the OpenXR Plugin OVRPlugin.GetSystemHeadsetType() always returns Oculus_Quest_2 even when using other devices such as the Quest 3

This is significant because when using the interaction package this function call is used to determine which controllers to show the users by OVRControllerHelper.

Using the Oculus XR Plugin the OVRPlugin.GetSystemHeadsetType() returns the correct headset type.

Setup

Unity: 2021.3.36f1
Packages: Meta XR Core SDK v 62.0.0; OpenXR Plugin 1.10.0; XR Plugin Management 4.4.0
Device: Quest 3, OS version 63.0.0.399.366

Repro

Add the following script to the sample project

using TMPro;
using UnityEngine;

public class GetSystemHeadsetType : MonoBehaviour
{

    TextMeshPro _text;

    // Start is called before the first frame update
    void Start()
    {
        var go = new GameObject("Debug Text");

        _text = go.AddComponent<TextMeshPro>();
        var rectTransform = go.GetComponent<RectTransform>();
        rectTransform.position = new Vector3(0, 0.8f, 1);
        rectTransform.localScale = new Vector3(0.02f, 0.02f, 0.02f);
        rectTransform.sizeDelta = new Vector2(50, 5);
    }

    // Update is called once per frame
    void Update()
    {
        _text.text = $"GetSystemHeadsetType {OVRPlugin.GetSystemHeadsetType()}";
    }
}
  • Add the script to any game object in the StartScene.unity
  • Save the scene
  • Build using Oculus > Samples > Build Starter Scene and deploy to device
  • Run the app on a Quest 3 and observe the text field saying "GetSystemHeadsetType Meta_Quest_3"
  • Back in Unity, install the OpenXR Plugin package
  • Under Project Settings > XR Plug-in Management switch Plug-in Provider to OpenXR
  • Build using Oculus > Samples > Build Starter Scene and deploy to device
  • Run the app and observe the text field saying "GetSystemHeadsetType Oculus_Quest_2"

Expected Results

OVRPlugin.GetSystemHeadsetType() returns the headset type the app is running on, as it does with the Oculus XR plugin.

Actual Results

OVRManager.IsPassthroughRecommended() always returns Oculus_Quest_2

Workarounds

The cause of this bug seems to be due to the missing OpenXR extension XR_META_headset_id. You can create a custom OpenXR feature (as mentioned in this issue #12) which includes that extension and the call to OVRPlugin.GetSystemHeadsetType() now works

@AlexThiv
Copy link
Contributor

AlexThiv commented Jul 2, 2024

This as been resolved as of SDK v66.
If you encounter any additional issue you can open a new issue.

@BenIVRE
Copy link

BenIVRE commented Oct 24, 2024

This as been resolved as of SDK v66. If you encounter any additional issue you can open a new issue.

We're still seeing this issue on v69

@tsaileo-meta
Copy link

tsaileo-meta commented Oct 31, 2024

We're still seeing this issue on v69

Hey! Curious if you saw any logs in adb that said anything about the XR_META_headset_id extension? The MetaXRFeature.cs should contain the new XR_META_headset_id extension that should allow for the correct headset type in OpenXR. If this extension isn't enabled there's a fallback to the old system which doesn't contain Quest 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants