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

Saving to Quest prior to finishing experiment #119

Open
mrstruijk opened this issue Mar 23, 2022 · 3 comments
Open

Saving to Quest prior to finishing experiment #119

mrstruijk opened this issue Mar 23, 2022 · 3 comments

Comments

@mrstruijk
Copy link

Hi there,

In the wiki it is mentioned that on Standalone Quest: "When you run a UXF application, it seems currently to only save data if you do not quit mid-way through the experiment.".

Do you know of any way around this? I'm running a study which only uses 1 (long) trial. My aim is of course for all participants to reach the end of the study, but something might come up causing the program to quit prematurely. I'd like to have their data stored even if the app crashes, or they exit out early.

I've tried setting the Session.instance.EndCurrentTrial(); at OnApplicationQuit and OnDisable, but to no avail. However, if I run that same code in for instance a coroutine with a set timer, and then close the app a little while later, the data does get saved.

Best,
Maarten

@jackbrookes
Copy link
Member

I haven't done extensive testing, but I think it can be assumed that this is somewhat unavoidable. Oculus Quest does not allow Unity apps to cleanly shut down:

https://forum.unity.com/threads/onapplicationquit-and-ondestroy-is-not-executed-when-exit-app-on-oculus-quest.795942/

However I think there is very little chance of app crash, the Unity engine is pretty stable in general. You could (a) split into smaller trials (the user won't notice), or (b) have some button the user presses/holds to cleanly exit.

Some are suggesting OnApplicationPause, but this will invoke any time you press the Oculus Menu. So you could tell users not to press the Oculus Menu or the experiment will end.

https://stackoverflow.com/questions/55584865/onquit-event-in-oculus-go-app-made-in-unity

@mrstruijk
Copy link
Author

Hi Jack,

Thanks for the reply. Your suggestions are excellent, I'll look into those.

Option A I don't quite understand. The issue is that the data doesn't get saved until the full Session is completed, right? So then creating smaller Trials doesn't solve my problem, or am I missing something obvious? Can I also write the files after each Trial?

OnApplicationPause might be a solution indeed. I could theoretically start a new Session if the pause-button was hit accidentally, and have that saved under a second Session number.

Small suggestion regarding the Wiki: could you make the explanation about Quest not quitting gracefully a little more prominent? I must admit I'm a hasty reader, but I missed that comment completely, and tried for a couple of frustrating hours to get it to work.

I'll post some updates once I've tried some of your solutions.

Thanks Jack,
Best,
Maarten

@jackbrookes
Copy link
Member

Regarding option A: Data files that a per-trial (e.g. trackers) get saved at the end of each trial.

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

No branches or pull requests

2 participants