Search Unity

Bug Slowdowns when VR headset connected, alt tabbing, but head not inside headset.

Discussion in 'VR' started by ClosingTime, May 9, 2022.

  1. ClosingTime

    ClosingTime

    Joined:
    Nov 23, 2016
    Posts:
    241
    I find out that when you build a VR game with XR, there is a bug where if your headset is connected(Quest 2 via link in my case) while the game is running, but then you alt tab and go back to your game. Your game start to slow down a lot.

    It is fine before you alt tab, it is fine if VR headset is not connected and you alt tab and after it is slow down with a headset connected, if you put your head in the headset, it's also fine.

    This happen in the editor, but also stand alone windows build.

    I found in the CPU analyzer, that some sort of XR endFrame is waiting for a sempahire, probably related to frame synch.
    It might be also that VSynch turns on when the headset is connected, and somehow the alt tabbing cause an issue.

    unknown.png

    The Unity editor version is:
    2021.3.2f1
     
  2. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    142
    I am trying to upgrade 2019 to 2021. I don't see an alt/tab issue, but the VR numbers aren't right. I created a new project using the VR template, completely empty scene. Firing the editor, it's showing 500fps, once you engage the VR helmet, it reduces immediately to 90 fps, 10-11ms CPU, 9-10ms render thread.

    This is also what my game sits at on 2021. It's like it's locking the frames/vsync as you said, but also taking quite a hit on render thread and CPU, in contrast, in 2019 my game shows 7ms CPU and .6 for render.

    Something is wrong here, I don't think it's the editor overhead like I've read about, because when it starts it's humming showing those big FPS numbers like you'd expect.