leetvr / hotham

Hotham is a tool for creating incredible standalone VR games.
Apache License 2.0
388 stars 28 forks source link

[Bug]: Hotham apps do not close correctly in the headset #220

Open kanerogers opened 2 years ago

kanerogers commented 2 years ago

What happened?

Background

As per #214, @sinoth found the following:

  1. Run Simple Scene
  2. Press Oculus button and select 'Quit' from system menu
  3. Wait
  4. See error that "Simple Scene keeps stopping"
  5. Use error dialog to close the app

This is likely either an OpenXR or Android lifecycle issue.

Version

latest

In which Hotham component are you seeing the problem on?

Example

What VR System are you seeing the problem on?

Quest-2

What OS are you seeing the problem on?

No response

Relevant log output

No response

louiidev commented 2 years ago

I noticed there's a similar issue when exiting out of the simulator by clicking the window exit button:

[HOTHAM_SIMULATOR] !ERROR RENDERING FRAME! ERROR_OUT_OF_DATE_KHR
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ERROR_VALIDATION_FAILURE', hotham\src\schedule_functions\end_frame.rs:18:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[HOTHAM_SIMULATOR] Destroy called..
[HOTHAM_SIMULATOR] All things are now destroyed
error: process didn't exit successfully: `target\release\hotham_crab_saber.exe` (exit code: 101)
kanerogers commented 2 years ago

I noticed there's a similar issue when exiting out of the simulator by clicking the window exit button:

[HOTHAM_SIMULATOR] !ERROR RENDERING FRAME! ERROR_OUT_OF_DATE_KHR
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ERROR_VALIDATION_FAILURE', hotham\src\schedule_functions\end_frame.rs:18:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[HOTHAM_SIMULATOR] Destroy called..
[HOTHAM_SIMULATOR] All things are now destroyed
error: process didn't exit successfully: `target\release\haotham_crab_saber.exe` (exit code: 101)

Good point! But that one's kind of unrelated; in that instance it just comes from really sloppy handling of the swapchain in the simulator. It's technically a bug but it's not that high of a priority (though you are totally welcome to open a separate issue for that).

I've refined the issue to make it clear this is specifically about the failure case that occurs on the headset. Closing the app through the normal Oculus menus should "just work", but it isn't.

kanerogers commented 1 year ago

May be something related to session lifecycle stuff:

https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#XR_OCULUS_android_session_state_enable