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 Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Bug Game takes forever to start in editor or build if Oculus desktop app isn't running

Discussion in 'AR/VR (XR) Discussion' started by Phillips_Albright, Jul 23, 2022.

  1. Phillips_Albright

    Phillips_Albright

    Joined:
    May 2, 2021
    Posts:
    6
    To preface, I am using Unity editor version 2021.3.4f1 on windows. I have been working on some VR projects using the XR Interaction Toolkit and XR Plugin Management and deploying to windows desktop and oculus quest. Here are all the packages I am using, as well as the XR Plug-in management settings:
    c9c104dc3715dd33bb1eb45018ecc7a5.png 8e357ab9226c6281aa52e0fb0a268578.png
    d02b5ce4750d5110dd485c4b31f94cbf.png
    I have noticed that if I do not have the Oculus desktop app running in the background, then pressing play in the editor will take over 6 minutes to actually start playing the game. While waiting, this is on the screen the whole time:
    5be4a6c21b4e8c5b87199dba7e17c797.png
    Something similar happens with the build of the game, where if the oculus app is not running in the background the build for windows will take a very long time to open.
    By default the oculus app runs in the background of your computer, but I encountered this because I set the oculus app to not run in the background on startup. To replicate the oculus app being fully shut down, you have to end these three services in task manager:
    1711ec59dac23ae6392107101ab4f298.png
    All my projects projects on this version of unity without XR related plugins and packages work fine, and all my projects with the XR stuff in them have the same or a similar problem. This wouldn't be that big of a deal, but I am trying to deploy my app to steamVR and I don't want my customers to have to deal with absurd wait times or requiring the oculus desktop app.
    I recognize that it could be likely happening due to requiring oculus support for android in the editor, but then why is that appearing in the windows build? I can't just remove oculus support since I also need to build for android, nor am I certain that will even fix it. I have tried booting with steamVR open and oculus closed to the same problematic results.
    This problem is really slowing down progress on my work and if a solution exists it would be great to hear.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    2,054
    Have you tried the latest LTS and OpenXR package?
    If so, I suggest making a bug report.

    You could try setting steamvr as the OpenXR runtime to see if it's an oculus issue (if true, still should be fixed however)
     
  3. Phillips_Albright

    Phillips_Albright

    Joined:
    May 2, 2021
    Posts:
    6
    I have tried the latest LTS and OpenXR packages. This may be a dumb question, but where do I set steamVR as the openXR runtime?
     
  4. Play_Different

    Play_Different

    Joined:
    Feb 24, 2015
    Posts:
    4
    Hi, after a week of searching I finally found someone else having this exact same problem (7+ minutes to enter play mode), I have this issue for every project running URP + OpenXR).
    This started happening last week, immediately after the last Windows update (I had Unity open and Windows decided to update by itself. Re-opened Unity right after and suddenly this started happening so maybe it's related to that?).

    I tried everything that I could think of, nothing worked:
    - Deleting Temp and Library
    - Reinstalling GPU drivers
    - Freeing disk space in both C:\ (where Windows is) and D:\ (where the project is)
    - Returning to a previous version of my URP projects saved on git (which I am sure worked fine)
    - Updating URP Package
    - Updating XRInteractionToolkit Package
    - Every combination of settings in ProjectSettings/Editor/Enter Play Mode Settings
    - Updating the project to latest LTS version of Unity

    By the way, I am NOT using SteamVR in any of the projects with this issue

    I tried with the Profiler in editor mode, and the culprit seems to be in XRGeneralSettings.AttemptInitializeXRSDKOnLoad():
    upload_2022-8-20_23-15-30.png

    Funny thing: If I try to enable "Deep Profile" the profiler, Unity Editor again gets stuck in Application.Reload (At least, I waited for 15 minutes then I lost my patience and closed Unity).

    Having the oculus app open in the background DOES fix the problem (at least now I can work on my project). However it's still annoying. It would be awesome if someone finds a "real" fix.
     
  5. Phillips_Albright

    Phillips_Albright

    Joined:
    May 2, 2021
    Posts:
    6
    I will add to this that my projects use the base Unity renderer and have this same issue, so it is not specific to URP
     
  6. ThomasBERNARD33

    ThomasBERNARD33

    Joined:
    Apr 20, 2022
    Posts:
    7
    Same issue there !

    No clear fix or anything but I fully removed both SteamVR and Oculus Desktop robooted and reinstalled them and the issue seems to have vanished...

    Any deep understanding of this would help me prevent this in the future (or provide a quicker fix).

    Edit for context : Unity 2021.2.14f1 running with XRIT 2.0.2, XR Plugin 4.2.1, Oculus Plugin both for Desktop and build. I'm now using OpenXR for both but I don't think it's related to my issues (via Unity, because I think OpenXR running in the background of my windows11 was causing the issue).
     
  7. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    92
    This happens randomly on any version of Unity, legacy sdk and new xr plugin it doesn't matter. This never used to happen in the past so it's possibly related to Oculus software updates instead.