Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Bug Oculus SDK Crashes when OpenXR is the xr back-end and oculus xr feature is enabled without headset

Discussion in 'VR' started by ertanturan, Jan 17, 2023.

  1. ertanturan

    ertanturan

    Joined:
    Nov 19, 2016
    Posts:
    20
    So yeah, if you don't have any headset connected and you set your xr back-end to OpenXR and enable the OculusXR feature Unity crashes.

    steps to reproduce.

    1. add oculus sdk and package and xr package from package manager. (I'm also using the sdk integration from assetstore)
    2. add oculus camera rig to an empty scene.
    3. set xr back-end to OpenXR
    4. Enable OculusXR feature
    5. Disconnect your headset from your pc/laptop
    6. start the scene it should crash

    added crash reports
     

    Attached Files:

    Jimbo_Slice likes this.
  2. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    211
    You should file a bug report.
     
  3. Tanya_Li

    Tanya_Li

    Unity Technologies

    Joined:
    Jun 29, 2020
    Posts:
    98
    We also observed this issue lately and reported it to Meta team. This failure mostly happen when the headset is disconnected and also if the oculus link is not started during initialization. According to the responses from Meta this issue would be fixed in the next SDK release.
     
  4. ertanturan

    ertanturan

    Joined:
    Nov 19, 2016
    Posts:
    20

    Thank you for the info ! is there any link that we can track the progress ?
     
    Jimbo_Slice likes this.
  5. ertanturan

    ertanturan

    Joined:
    Nov 19, 2016
    Posts:
    20

    Hello Tanya Li,

    The Oculus plugin was just updated yesterday and I've updated every package in my project to their latest version. The problem kind of stil persists. If I start my project with no headset connected Unity is crashing. And if I take the cable off during a session and plug it back and re-enable the link from the headset Unity editor stops playing instead of continuing the session.

    Can you please confirm that you guys actually reported the issue to the Meta team and confirm if they've solved the issue ? I couldn't see anything in the changelog regarding this issue.

    Any info would be appreciated

    Thanks !
     
  6. ertanturan

    ertanturan

    Joined:
    Nov 19, 2016
    Posts:
    20
    Sometimes I'm receiving this error when I disconnect the headset and re-connect it back... and it crashes Unity without logs
     

    Attached Files:

    Last edited: Feb 8, 2023
  7. ertanturan

    ertanturan

    Joined:
    Nov 19, 2016
    Posts:
    20
    Alternatively you can enable both openXr and Oculus xr back-ends along with "metaXR feature" and hit play to reproduce the crash
     
  8. ertanturan

    ertanturan

    Joined:
    Nov 19, 2016
    Posts:
    20
    Still happening even with the newest oculus sdk. Looks like the new issues are caused by unity xr plugin and openxr plugin.
     
  9. Tanya_Li

    Tanya_Li

    Unity Technologies

    Joined:
    Jun 29, 2020
    Posts:
    98
    glenneroo likes this.
  10. krzys_h

    krzys_h

    Joined:
    Jun 23, 2013
    Posts:
    1
    V50 was released on 15th of March (which was "next week or so" after the previous post) including the following in the release notes, but it seems like it did not fix the issue.

    It seems like it did change the issue though - instead of crashing during OpenXR initialization, it now crashes while trying to deinitialize it after it fails because of the disconnected HMD.

    Before (V47 is the one I had installed I think? It matches the log from the initial post in this thread):
    Code (csharp):
    1. =================================================================
    2.     Managed Stacktrace:
    3. =================================================================
    4.       at <unknown> <0xffffffff>
    5.       at UnityEngine.SubsystemDescriptorBindings:Create <0x00089>
    6.       at UnityEngine.IntegratedSubsystemDescriptor`1:Create <0x0002a>
    7.       at UnityEngine.IntegratedSubsystemDescriptor`1:CreateImpl <0x0001a>
    8.       at UnityEngine.IntegratedSubsystemDescriptor:UnityEngine.ISubsystemDescriptor.Create <0x00017>
    9.       at UnityEngine.XR.Management.XRLoaderHelper:CreateSubsystem <0x00178>
    10.       at UnityEngine.XR.OpenXR.OpenXRLoaderBase:CreateSubsystem <0x0004a>
    11.       at UnityEngine.XR.OpenXR.OpenXRLoaderBase:CreateSubsystems <0x00062>
    12.       at UnityEngine.XR.OpenXR.OpenXRLoaderBase:InitializeInternal <0x0054a>
    13.       at UnityEngine.XR.OpenXR.OpenXRLoaderBase:Initialize <0x000e2>
    14.       at UnityEngine.XR.Management.XRManagerSettings:InitializeLoaderSync <0x000d6>
    15.       at UnityEngine.XR.Management.XRGeneralSettings:InitXRSDK <0x00112>
    16.       at UnityEngine.XR.Management.XRGeneralSettings:AttemptInitializeXRSDKOnLoad <0x00052>
    17.       at System.Object:runtime_invoke_void <0x00084>
    18. =================================================================
    After (V50):
    Code (csharp):
    1. =================================================================
    2.     Managed Stacktrace:
    3. =================================================================
    4.       at <unknown> <0xffffffff>
    5.       at UnityEngine.XR.OpenXR.OpenXRLoaderBase:Internal_PumpMessageLoop <0x00086>
    6.       at UnityEngine.XR.OpenXR.OpenXRLoaderBase:ProcessOpenXRMessageLoop <0x000a2>
    7.       at UnityEngine.XR.OpenXR.OpenXRLoaderBase:Deinitialize <0x0010a>
    8.       at UnityEngine.XR.OpenXR.OpenXRLoaderBase:Initialize <0x00151>
    9.       at UnityEngine.XR.Management.XRManagerSettings:InitializeLoaderSync <0x000d6>
    10.       at UnityEngine.XR.Management.XRGeneralSettings:InitXRSDK <0x00112>
    11.       at UnityEngine.XR.Management.XRGeneralSettings:AttemptInitializeXRSDKOnLoad <0x00052>
    12.       at System.Object:runtime_invoke_void <0x00084>
    13. =================================================================
    Also note that the same issue occurs in built players, which is a huge pain when trying to support both VR and non-VR scenarios in one build.
     
  11. ertanturan

    ertanturan

    Joined:
    Nov 19, 2016
    Posts:
    20
    Exactly same on my end. It didn't fix the issue but changed it. Also, now it doesn't crash if I start with a headset connected and disconnect it when my unity game is playing and reconnect it back instead it just stops playing Unity which is still not ideal. Anyway, the fight is still on. Hope they'll fix the error soon.
     
  12. BAM5

    BAM5

    Joined:
    Wednesday
    Posts:
    1
    I too have been having this issue, albeit with unreal.
    Whenever I disconnect the hmd the game will crash and my stack trace shows that it always happens with an external openxr call.
    I'm currently looking through the openxr standard to see if there's some way to retrieve HMD status to guard against calling these functions that crash when the HMD is disconnected.
     
  13. ThomasBERNARD33

    ThomasBERNARD33

    Joined:
    Apr 20, 2022
    Posts:
    8
    So we have to wait for V51 for a resolution...

    In the meantime, the quickest and dirtiest fix I found to use the editor without a VRHeadset plugged in is simply to change the editor "Play Mode OpenXR Runtime" from default to SteamVR.
    It is clearly stated that this change will only affect this instance of the editor and so it will need to be set at any launch.
    Once a VR headset is plugged in, I switch it back to default or Oculus...
    This is not ideal, but it is working for me.

    Temp solution more detailed :

    Project Settings / XR Plug-in Management / OpenXR
    Under the windows tab, change the "Play Mode OpenXR Runtime" from "System Default" or "Oculus OpenXR" to "SteamVR".
    Revert when you want to use your Oculus headset or simply use it though SteamVR until it's fixed.
     
    ertanturan likes this.