Search Unity

Bug Can't turn off Phase Sync, Oculus Quest 2, Creates jittery movement

Discussion in 'VR' started by jaglitegrann, May 30, 2023.

  1. jaglitegrann

    jaglitegrann

    Joined:
    Feb 25, 2014
    Posts:
    10
    Hey! I can't turn off "Phase Sync" when developing for Oculus Quest 2.

    There is a setting to toggle Phase Sync under "PlayerSettings/XR Plug-in Management/oculus/android/Phase Sync" but it seems to be ignored.

    In Oculus documentation (https://developer.oculus.com/documentation/unity/enable-phase-sync) they have instruction on how to see if the feature is active in logcat logs. And it is indeed active.

    I also tried commands to turn it off but without any success.

    What is Phase Sync?
    Phase Sync is for when game is having no problems making frame rate and even has time to spare. The Oculus systems recognize the game is consistently finishing it's work early. Oculus tells the game it can start to "sleep in" and start rendering the next frame later because it knows it shouldn't need the full amount of time.

    The advantage of telling the game to starting sleeping in is to reduce input latency.

    Why do I need it off
    I have a separate update function for multiplayer that runs in a different rate than the normal update function.
    This causes causes the time it takes to compute each frame to variate because on some update calls the multiplayer code runs, and on some it does not.

    When the frame-time variates the phase sync is not able to estimate the time it takes to compute the next frame.

    If I run the the rendering at 90 FPS and the network code at 45 FPS,
    every other frame will be long and the other short. If the previous frame was short, it will add an extra delay to my already longer frame making this frame even longer. And it will add a shorter delay to the frame that already is short. Making the frame-time variation even worse.

    This is bad because it makes delta time variate a lot and make all movement based on delta time jittery.
    It also makes it hard for the game to stay inside the target FPS goal.

    Finally
    Does anyone know how I can turn the feature off. Or have any other suggestion for me on how to deal with the problem?

    System info
    Unity version: 2021.2.6f1
    XR Plugin Management: 4.2.1
    Oculus XR Plugin: Version 1.11.2
    Oculus Quest 2 Version: 53.0.0.137.132
     
  2. Deltigre

    Deltigre

    Unity Technologies

    Joined:
    Sep 13, 2022
    Posts:
    36
    Can you submit a bug report and include the logcats, then include the report id here?
     
  3. jaglitegrann

    jaglitegrann

    Joined:
    Feb 25, 2014
    Posts:
    10
    I have now submitted a bug report. I guess my report id is: IN-42798
     
  4. jaglitegrann

    jaglitegrann

    Joined:
    Feb 25, 2014
    Posts:
    10
    The bug was confirmed a while ago. But I have no clue if it will be fixed and if so when I can expect it to be fixed. How can I follow up on this problem?
     
  5. lianne13

    lianne13

    Unity Technologies

    Joined:
    Jan 31, 2023
    Posts:
    21
    Hello @jaglitegrann,

    We worked on this issue recently and learned that PhaseSync is now set to always be active in Meta's Oculus OpenXR Runtime. Therefore, there is no longer a way to Disable PhaseSync in the Unity Oculus Package.

    We will be updating the Unity Oculus package documentation to notify users of this change. Thank you for bringing this to our attention.
     
  6. Liam-C

    Liam-C

    Joined:
    Mar 6, 2017
    Posts:
    18
    Are you sure this is correct? Meta has updated their Phase Sync documentation within the last couple of weeks (since switching to the new Meta XR SDK package) and there is no mention of Phase Sync always being enabled.

    https://developer.oculus.com/documentation/unity/enable-phase-sync/

    I'm in the same boat as jaglitegrann. My app runs at 72, 80 or 90 FPS with application space warp (so 36, 40 and 45fps) and my multiplayer library syncs at 20Hz. So it generally runs a fairly expensive update every second or third frame.

    Physics is a similar issue. Even with the physics timestep matching the frame rate, slight differences in timing will cause 0, 1 or 2 physics timesteps to be executed per frame, making the CPU cost of frames even more inconsistent.

    edit: I should also mention that OVR Metrics HUD reports LAT = 0, which according to the docs means phase sync is inactive. Haven't checked the VRAPI logs yet, im just assuming they're the same metric.
     
    Last edited: Nov 21, 2023
  7. VR_Unity_Account

    VR_Unity_Account

    Joined:
    Aug 17, 2017
    Posts:
    22
    Can confirm the same issue.
    • Phase Sync says that it is inactive in the editor.
    • The in-headset Metrics Tool reports LAT = 0
    • Android Logcat within Unity says LAT = -1, indicating that it actually is active.
    I am running 2020.3.26f1.