New to the forums? Click here to read the "How To" Guide.

Developer? Click here to go to the Developer Forums.

Proximity sensog

INTETACTIVELABDOTRUINTETACTIVELABDOTRU Posts: 7
NerveGear
edited February 2016 in Samsung Gear VR
Is any way to access proximity sensor of Gear VR?

Or any other way to determine that user had wore the spectacles?

Comments

  • I'd like to know this as well. This way I could make the screen slowly fade on from black whenever someone puts the Gear VR on.
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    I believe there is a way to do it, but it's not really documented or tested very well.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • yosunyosun Posts: 69
    Hiro Protagonist
    You can use the usual android sensor enumeration to access the proximity sensor - the range is from 0 to 8... 8 being far proximity and 0 being close. TMG399X

    However, I believe this seems to be just the sensor on the Galaxy Note 4 and not the proximity sensor on the Gear VR device?
    ChallengePost: yosun
    SMS: 415-77-YOSUN
    Twitter: @yosun

    Some old public hacks.
  • Did anyone have any luck getting access to the proximity sensor or any other way to detect if the device is put on or not.

    So far I've tried several different solution to this problem, neither OnApplicationFocus or OnApplicationPaused works in this case.

    Another solution i tried was to see if the application paused in some way that isn't detected, but it just seems as the applications keeps running in the background as if nothing changed.

    I also just tried to access the proximity sensor on the phone, this only resulted in it reading as always being far away.


    For now as a very bad temporary work around I'm going to try to just use movement data from the OVR to detect if it has been put taken off, hopefully i can read this as if the Samsung Gear VR was moving to quick or jerky to be on the head.
  • Ok small update, I've now tried to instead detect which state the screen is in, but is seems as this didn't work either.

    Maybe a conclusion to all this can actually be that the screen is never turned of, and really just fades to a black color?
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • So far only the built in OnApplicationPause() function in Unity (which is supposed to work in the same way and works fine in other applications)

    But it seems as the applications keeps running even when not wearing the headset, so I don't think that would work anyway.
    As stated as before I think it only makes the screen color turn to black, not turning it off or anything else.
  • jkimovrjkimovr Posts: 53
    Unfortunately there is no API that is exposed to us for fine grain control. This is Samsung level code that we can't access through the mobile SDK. If you're trying to change the distance at which the sensor is active there isn't a good way to do this.

    If you're trying to determine whether the headset is on the user's face or not, you can try using - ovr_HeadsetIsMounted()
  • Ah I see, that should work then I guess :D
    I'll look around and see if I can get it running in Unity then, since its not yet implemented. If something hasn't changed since this post viewtopic.php?t=23927
  • LucaMefistoLucaMefisto Posts: 74 Oculus Start Member
    Sorry for resurrection and old discussion.

    Even if there is no way to modify it, is there any way to read from it?
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    Support for this is coming. Sorry for the wait.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • Any update on this bug? We'd like an expeditious way to detect when the user has removed the headset and pause our app as close to instantly as possible. OnApplicationPaused() has about a 10 second delay, not really acceptable.
  • bp2008bp2008 Posts: 256
    Art3mis
    captainkw wrote:
    Any update on this bug? We'd like an expeditious way to detect when the user has removed the headset and pause our app as close to instantly as possible. OnApplicationPaused() has about a 10 second delay, not really acceptable.

    LOL it is funny how long things like this can slip through the cracks.
  • rwalkergmrrwalkergmr Posts: 3
    NerveGear
    I can't believe this isn't addressed yet.  I was also struggling over a year ago with this seemingly basic issue and once again have the same problem on a similar project a year later.  I have only days left at this point before client also gets the 'it's impossible because of the hardware, sorry' line.  Will continue to sniff around forums to see what reliable Unity hacks exist if any, and if I can find any real ETA posted, but my guess is all the devs are too busy secretly playing on the Vive at home and dreaming about it at work to worry about their engine SDK's.  Now THAT'S funny hahahaha.  (Sorry, there's no RL support group formed for screwed devs to cry on each other so I have to resort to rantage.)
  • rwalkergmrrwalkergmr Posts: 3
    NerveGear
    Oh no, I might have to eat some parts of that, but I get to chew very slowly, like for about a year.  Trying this tomorrow I seriously hope it pans out:
    https://forums.oculus.com/vip/discussion/22461/call-a-method-when-the-headset-is-put-on


  • rwalkergmrrwalkergmr Posts: 3
    NerveGear
    OK, I'm eating slowly.  See the post by delphinius81 in this thread for the start of the breadcrumb trail to the detecting headset removal/worn solution:
    https://forums.oculus.com/vip/discussion/22461/call-a-method-when-the-headset-is-put-on

    It's working for me very well in Unity 5.3.5f1.  Had to get new Oculus Tools and Android SDK for updated scripts and to complete build for Android 6.  Nice to see the userPresent value be readable instead of giving false positive like it used to.  

  • michaelvoigtmichaelvoigt Posts: 5
    NerveGear
    I attach a OVR manager to my GoogleVR project ( using GVR to be cross-platform ) and I get errors. Is it very difficult to use a OVR manager just to detect the user with a GVR project?

    DllNotFoundException: /Applications/Unity/Unity.app/Contents/VR/Unity/OSXIntel64/OVRPlugin.bundle/Contents/MacOS/OVRPlugin
    OVRPlugin.GetStatus (Status bit) (at Assets/OVR/Scripts/OVRPlugin.cs:744)
    OVRPlugin.get_userPresent () (at Assets/OVR/Scripts/OVRPlugin.cs:405)
    OVRManager.get_isUserPresent () (at Assets/OVR/Scripts/OVRManager.cs:459)
    GalaxyManager.get_isUserPresent () (at Assets/scripts/GalaxyManager.cs:48)
    GalaxyManager.Update () (at Assets/scripts/GalaxyManager.cs:110)


    OVRPlugin.cs
    line 744 : return (OVRP_0_1_0.ovrp_GetStatus() & (uint)(1 << (int)bit)) != 0;  
Sign In or Register to comment.