Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Android/OpenXR lifecycle correctly #84

Closed
3 tasks done
Tracked by #64
kanerogers opened this issue Sep 15, 2021 · 1 comment · Fixed by #128
Closed
3 tasks done
Tracked by #64

Handle Android/OpenXR lifecycle correctly #84

kanerogers opened this issue Sep 15, 2021 · 1 comment · Fixed by #128
Assignees
Labels
bug Something isn't working cleanup Something smells - clean it up! openxr An issue with OpenXR

Comments

@kanerogers
Copy link
Collaborator

kanerogers commented Sep 15, 2021

Description

Having some issues getting Hotham to behave well with the Oculus runtime. For example, pressing then results in:

09-15 12:51:12.728  8773  8773 E ActivityThread: Activity android.app.NativeActivity has leaked IntentReceiver com.oculus.vrapi.UserSwitchedReceiver@5b373cb that was originally registered here. Are you missing a call to unregisterReceiver()?
09-15 12:51:12.728  8773  8773 E ActivityThread: android.app.IntentReceiverLeaked: Activity android.app.NativeActivity has leaked IntentReceiver com.oculus.vrapi.UserSwitchedReceiver@5b373cb that was originally registered here. Are you missing a call to unregisterReceiver()?

Also noted is the sequence of Android/OpenXR events:

09-15 12:51:12.988  8773  8797 I RustStdoutStderr: [HOTHAM_ANDROID] Received event WindowDestroyed
09-15 12:51:12.988  8773  8797 I RustStdoutStderr: [HOTHAM_POLL_EVENT] Received some other event
09-15 12:51:14.001  8773  8797 I RustStdoutStderr: [HOTHAM_ANDROID] Received event Stop
09-15 12:51:15.040  8773  8797 I RustStdoutStderr: [HOTHAM_ANDROID] Received event InputQueueDestroyed
09-15 12:51:16.067  8773  8797 I RustStdoutStderr: [HOTHAM_ANDROID] Received event Destroy
09-15 12:51:17.112  8773  8798 I OpenXR_Actions: ------------ xrDestroyAction -----------
09-15 12:51:17.112  8773  8798 I OpenXR_Actions: ------------ xrDestroyAction -----------
09-15 12:51:17.112  8773  8798 I OpenXR_Actions: ------------ xrDestroyActionSet --------
09-15 12:51:17.112  8773  8798 I OpenXR  : ------------ xrDestroySession [start] -----------
09-15 12:51:17.113  8773  8798 D SystemActivitiesReceiver: Unregistering Oculus System Activity receiver
09-15 12:51:17.113  8773  8798 I VulkanLoader: ovrVulkanLoader::Unload
09-15 12:51:17.113  8773  8798 I AudioCapture: AudioCapture::Shutdown
09-15 12:51:17.114  8773  8798 I AudioCapture: AudioCapture::StopAudioConsumerThread
09-15 12:51:17.114  8773  8798 I AudioCapture: AudioCapture::StopAudioConsumerThread COMPLETE

We might be handling things in the wrong order - we may have to respond to OpenXR before we just stop the app - even if we receive an Android Stop event.

TODO

  • Research correct behaviour of Android lifecycle
  • Research correct behaviour of OpenXR lifecycle
  • Implement correctly
@kanerogers kanerogers mentioned this issue Sep 15, 2021
33 tasks
@kanerogers kanerogers self-assigned this Sep 15, 2021
@kanerogers kanerogers added bug Something isn't working openxr An issue with OpenXR labels Sep 15, 2021
@kanerogers kanerogers added this to Week ending 5/8/2021 in 0.1 Release Roadmap via automation Sep 15, 2021
@kanerogers kanerogers moved this from 19/8/2021 to 26/9/2021 in 0.1 Release Roadmap Sep 15, 2021
@kanerogers kanerogers moved this from 26/9/2021 to 10/10/2021 in 0.1 Release Roadmap Sep 15, 2021
@kanerogers kanerogers moved this from 10/10/2021 to 17/10/2021 in 0.1 Release Roadmap Sep 15, 2021
@kanerogers kanerogers added the cleanup Something smells - clean it up! label Sep 15, 2021
@kanerogers
Copy link
Collaborator Author

Note, we need to call ndk_glue::native_activity().finish() when exiting gracefully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cleanup Something smells - clean it up! openxr An issue with OpenXR
Projects
No open projects
0.1 Release Roadmap
  
31/10/2021
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant