Skip to content

Add no-simulation argument#941

Closed
gareth-morgan-nv wants to merge 1 commit into
bjornbytes:devfrom
gareth-morgan-nv:gmorgan/RetryOnFFError
Closed

Add no-simulation argument#941
gareth-morgan-nv wants to merge 1 commit into
bjornbytes:devfrom
gareth-morgan-nv:gmorgan/RetryOnFFError

Conversation

@gareth-morgan-nv
Copy link
Copy Markdown
Contributor

@gareth-morgan-nv gareth-morgan-nv commented May 15, 2026

Disables the simulation option and exits when OXR creation fails if its set. This allows LOVR to be run in automation and detect the FORM_FACTOR_UNAVAILABLE discussed below without a custom LUA script.

@bjornbytes
Copy link
Copy Markdown
Owner

If the form factor is unavailable, lovr.headset.connect will loop infinitely and never return. This would prevent apps from calling lovr.headset.connect once to check if VR is available (potentially falling back to flatscreen or otherwise showing some kind of error).

Maybe you could do something like this in Lua?

while not lovr.headset.connect() do
  print('Failed to set up headset, retrying after 1s...')
  lovr.timer.sleep(1)
end

You could also use the second return value of lovr.headset.connect to specifically match on 'xrGetSystem' or 'FORM_FACTOR_UNAVAILABLE'.

@gareth-morgan-nv gareth-morgan-nv changed the title Retry if xrGetSystem returns XR_ERROR_FORM_FACTOR_UNAVAILABLE Add no-simulation argument May 15, 2026
@gareth-morgan-nv gareth-morgan-nv force-pushed the gmorgan/RetryOnFFError branch from 7bcc5ca to f016523 Compare May 15, 2026 16:44
@gareth-morgan-nv
Copy link
Copy Markdown
Contributor Author

gareth-morgan-nv commented May 15, 2026

Maybe you could do something like this in Lua?

Though we have the issue we are running in automation with an arbritary LUA script, so we can't detect the case where the OXR init has failed and its gone into simulation. How about this? I added a --no-simulation option that disables simulation and just exits if OXR fails.

@bjornbytes
Copy link
Copy Markdown
Owner

Closing in favor of #946

@bjornbytes bjornbytes closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants