Skip to content

xrWaitFrame returns XR_SUCCESS with negative predictedDisplayTime (SteamVR stable 2.14.5; not seen on beta 2.15.3) #1917

@rangerdoormat

Description

@rangerdoormat

This issue occurs on SteamVR stable 2.14.5 (default branch) approximately once every hour. I have not been able to reproduce it yet on SteamVR beta 2.15.3. The HMD view goes black briefly, then SteamVR transitions into its hanging/waiting view while the application remains running.

Description
When the session is in XR_SESSION_STATE_SYNCHRONIZED or XR_SESSION_STATE_FOCUSED, xrWaitFrame will sometimes (seemingly at random) return:

  • XR_SUCCESS
  • XrFrameState.predictedDisplayTime set to a large negative value (example: -17,855,724,683,963,200)

Call site

XrFrameState State { XR_TYPE_FRAME_STATE };
XrResult Result = xrWaitFrame (Session, nullptr, &State);

Expected
When xrWaitFrame returns XR_SUCCESS in a synchronized/focused session, predictedDisplayTime should be a valid XrTime suitable for use with xrEndFrame.

Actual
Passing the returned negative predictedDisplayTime directly into xrEndFrame causes xrEndFrame to fail with XR_ERROR_TIME_INVALID ("The provided XrTime was zero, negative, or out of range"), and the frame is discarded.

After xrWaitFrame returns a negative predictedDisplayTime for the first time, every subsequent xrWaitFrame call continues to return large negative predictedDisplayTime values while still reporting XR_SUCCESS, until the session is restarted.

Frame state sequence logged from XrFrameState around the first occurrence

shouldRender	predictedDisplayPeriod	predictedDisplayTime
true	8333300	13081454143500
true	8333300	13081458646000
true	8333300	13081463159700
true	8333300	13081467666800
true	8333300	13081472169500
true	8333300	13081476670700
true	8333300	13081481169300
true	8333300	13081485664900
true	8333300	13081490164000
true	8333300	13081494658700
true	8333400	-17882616467509700
true	8333300	-17882616467509699
true	8333300	-17882616467509698
true	8333300	-17882616467509697
true	8333300	-17882616467509696
true	8333300	-17882616467509695
true	8333300	-17882616467509694
true	8333300	-17882616467509693
true	8333300	-17882616467509692
true	8333300	-17882616467509691

Note: After the first negative value appears, predictedDisplayTime increases by 1 tick per xrWaitFrame call (e.g. ...9700, ...9699, ...9698, …). Also, predictedDisplayTime divided by predictedDisplayPeriod is close to 2³¹ (≈ 2,145,896,809 vs 2,147,483,648), which may indicate an overflow/underflow or an incorrect timebase/offset.

System configuration

  • Headset/controllers: Valve Index
  • OpenXR runtime: SteamVR (steamxr_win64.json points to vrclient_x64.dll)
  • Windows 11, Intel Core i7-12700KF, NVIDIA RTX 3080

Enabled extensions
XR_KHR_D3D12_ENABLE_EXTENSION_NAME,
XR_KHR_VISIBILITY_MASK_EXTENSION_NAME,
XR_EXT_HP_MIXED_REALITY_CONTROLLER_EXTENSION_NAME,
XR_HTC_VIVE_COSMOS_CONTROLLER_INTERACTION_EXTENSION_NAME,
XR_HTC_VIVE_FOCUS3_CONTROLLER_INTERACTION_EXTENSION_NAME

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions