OpenXR without rendering loop

Hi there, I’m new to OpenXR and am attempting to build a native application that drives OpenXR enabled haptic devices. This application is meant to run in the background and so I do not need or want a rendering loop. There should be no image sent to the HMD. What’s tripping me up is Section 9.2 of the spec which reads:

During XrSession creation the application must provide information about which graphics API it intends to use by adding an XrGraphicsBinding* struct of one (and only one) of the enabled graphics API extensions to the next chain of XrSessionCreateInfo.

Has anyone had any success in building headless OpenXR applications? Do I need to simply pass a graphics api in, but never call xrBeginSession? My thinking is this would not work based on the session lifecycle section which states:

When the runtime determines the application is eligible to receive XR inputs, e.g. motion controller or hand tracking inputs, it notifies with XR_SESSION_STATE_FOCUSED state. The application can expect to receive active action inputs.

Because this is a background application, I need to be able to send/receive information from the controllers even when the application is not focused. Is this something OpenXR is just not capable of? Is there some other way I should be attempting to communicate with controllers?

After some more reading, this looks like the extension I want:
https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_MND_headless

However, it looks like this extension may only be supported by the Monado runtime…this would be a good extension for all runtimes to implement I would think

Yeah, the base spec only has support for exclusive foreground applications.

In my opinion, this is a huge limitation with OpenXR currently. There are many different application types that don’t fit this model.

  • Headless applications that don’t need to render, but can always receive input.
  • 2D overlay applications with decoupled on-demand rendering that may conditionally take over input.
  • 3D overlay applications that sync rendering with the main scene application, and could either take over input or share it with main application.

There are extensions for both headless and overlay applications, but currently only Monado seems to support them. It would be nice to have a an interface to query support for and specify different application types, ideally in a future version of the core spec.

I would agree that this seems to be a huge limitation with the current spec. From browsing the forums I’ve seen a number others requesting this overlay on-demand rendering capability specifically. I’m in that first category. I may try out Monado and see how that goes. I’d really like to see this extension upgraded to a KHR or EXT and supported by other runtimes

SteamVR just added support for XR_MND_headless in the latest beta.

Good news! I’ve actually already switched to using OpenVR/SteamVR because OpenVR already provided an easy route for writing headless applications

1 Like