Repository navigation
Conversation
Putting the headset down used to leave the controllers dead for good: the runtime stops the session while the app is asleep, and READY only began a session when no renderer existed yet, so after a wake-up no frame was ever waited on again and no input came back. Recovery is driven by what the runtime reports instead of by cached session state: - STOPPING stops rendering and READY re-begins the session the runtime handed back; - a frame pump that stays blocked inside xrWaitFrame (Oculus can hold it for half a minute after it silently stopped feeding the session, and then returns XR_ERROR_RUNTIME_FAILURE) is replaced by a fresh one under a generational token, and once enough replacements produced no frame the session is rebuilt from scratch; - XR_SESSION_STATE_EXITING says a session can never be begun again - that is what closing the app in the headset sends - so Cemu follows the runtime out instead of asking for another session and putting the app back in front of the user. Everything owned by a session is forgotten before xrDestroySession, including the swapchains the layers hold, and everything owned by the instance survives it: the action sets and their suggested bindings, which have to be suggested exactly once per instance. A replaced renderer is retired rather than destroyed, because its frame pump may still be blocked inside xrWaitFrame, and its ImGui overlay - there is one per process, together with the frame objects its constructor built on the renderer's frames - is handed to the replacement instead of being rebuilt. Recoverable paths no longer go through checkXRResult, which shows a message box and throws, and the game's hooks and layers survive the window in which there is no renderer at all.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I don't really understand C++, but I used a local AI model to fix a very annoying bug with VR controller disconnection after the headset goes to sleep mode.
The AI added a timeout/re-initialization loop for SDL/OpenXR controller events. It works on my Quest 2. If it's a mess, feel free to close this PR, I just wanted to share.