cancel
Showing results for 
Search instead for 
Did you mean: 

Disable OVR sleep?

demodern2
Honored Guest
Hi everyone,
I'm working on a VR app in unity, been using the dk2 so far, switched to cv1 today (yay!) and finally got it to run as expected.

One problem I have encountered though, is when the light sensor in the goggle sends it to "sleep mode", effectively pausing the running exe. I need to disable this feature, since my exe already tracks user inactivity (no more LocalRotation for a couple of seconds) but it obviously can't do that when it's paused... I've been digging through a lot of supplied ovr code, but cannot find anything.

So, the question is: how can I disable this standard behaviour? The goggle itself going to sleep is fine, just not the pausing of the exe...

Cheers,
tobe
2 REPLIES 2

Baj
Explorer
A temp fix would be to stick something over the sensor.

demodern2
Honored Guest
A little late, but maybe this helps if someone has a similar problem with inactivity:
I switched to using OnApplicationPause together with Time.realtimeSinceStartup to get the time passed when the app returns from sleep.
It's a bit silly to test in-editor since you have to tab out and back to simulate pause / resume, but it definitely works reliably for a standalone build.

float lastUserTime = 0;



// app deactivated by rift's light sensor
void OnApplicationPause(bool appIsPaused)
{
if (appIsPaused)
{
// we are in background
Debug.LogError("# # # # app paused!");
lastUserTime = Time.realtimeSinceStartup;
}
else
{
// we are in foreground again.
Debug.LogError("# # # # app resumed! -> time passed: " + (Time.realtimeSinceStartup - lastUserTime));
}
}

Get Help
Did this answer your question? If it didn’t, use our search to find other topics or create your own and other members of the community will help out.

Check out some popular posts here:
Getting Help from the Meta Quest Community
Tips and Tricks: Charging your Meta Quest Headset
Tips and Tricks: Help with Pairing your Meta Quest
Trouble With Facebook/Instagram Accounts?