Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Oculus Go back button randomly detected

KosTargoKosTargo Posts: 4
NerveGear
Hi,

I'm facing a weird problem with the back button on the Oculus Go.
I'm developing my app with Unity 2018.1.0f2, Oculus SDK 1.25.2 and VRTK 3.3 and my last step to upload my app on oculus store is to make the back button requirement. (Enable Universal Menu when back button is pressed)

Unfortunately, the back button event is catch randomly. I need to spam the button if I want the event called.

I tried different ways :

void Update ()
    {
        OVRInput.Update();
        Debug.Log("Update");
        if (OVRInput.Get(OVRInput.Button.Back))
            OVRPlugin.ShowUI(new OVRPlugin.PlatformUI()); if (OVRInput.GetDown(OVRInput.Button.Back)) OVRPlugin.ShowUI(new OVRPlugin.PlatformUI());
    }
  
 public VRTK_ControllerEvents m_Event;

    private void Start()
    {
        m_Event.ButtonTwoPressed += (sender, e) => { OVRPlugin.ShowUI(new OVRPlugin.PlatformUI()); };
        m_Event.ButtonTwoReleased += (sender, e) => { OVRPlugin.ShowUI(new OVRPlugin.PlatformUI()); };
        m_Event.ButtonTwoTouchStart += (sender, e) => { OVRPlugin.ShowUI(new OVRPlugin.PlatformUI()); };
        m_Event.ButtonTwoTouchEnd += (sender, e) => { OVRPlugin.ShowUI(new OVRPlugin.PlatformUI()); };
    }

But the result is still the same. 

Do I miss something ?

Comments

  • KosTargoKosTargo Posts: 4
    NerveGear
  • juanoldinhojuanoldinho Posts: 131 Oculus Staff
    @KosTargo

    Do you have OVRManager in your scene? If so you do not need to call OVRInput.Update() in the Update() method. That may be why the back button is not getting caught consistently.

    Also the OVRPlatformMenu script provides a short press handler, which can either show the Confirm Quit menu, or retreat one level of your application, until the main scene is reached and it displays the Confirm Quit menu.
    Please tag me, @juanoldinho, in your forum post/response if you need immediate assistance or want additional support or context on an issue you are having with our software or integrations.

    Having an issue with our platform, services, or integrations?

    Try using our new bug tool to report this and receive emailed updates as we proceed to address it internally.
  • juanoldinhojuanoldinho Posts: 131 Oculus Staff
    Also, when you check for the back button you can just check using Get(), then use
    if (OVRInput.Get (OVRInput.Button.Back)) {
    	OVRDebugInfo.print ("pressed back button");
    	OVRManager.PlatformUIConfirmQuit ();
    }


    Please tag me, @juanoldinho, in your forum post/response if you need immediate assistance or want additional support or context on an issue you are having with our software or integrations.

    Having an issue with our platform, services, or integrations?

    Try using our new bug tool to report this and receive emailed updates as we proceed to address it internally.
  • KosTargoKosTargo Posts: 4
    NerveGear
    @imperativity  
    Yes I'm using OVRManager because I'm using the OVRCameraRig prefab.
    I don't understand your second question, all I can say is that nothing works to detect correctly the back button.

    @juanoldinho  
    I know for the OVRInput.Update(), but with or without it, the result is the same. Also for OVRInput.Get...
    Thank you for the OVRPlatformMenu script but the result is still the same. I need to spam the back button and it works 1 on X(random) times.
  • KosTargoKosTargo Posts: 4
    NerveGear
    @juanoldinho
    BTW, even with OVRInput.Button.any, the problem is still here. All the buttons respond correctly but not the back button.
  • jhone.gjhone.g Posts: 1
    NerveGear
    @imperativity
    I have this problem using Unity 2017.2.4.2f2 and Oculus Utilities 1.22
  • JacobHomanicsJacobHomanics Posts: 7
    NerveGear
    Hi, so I am actually encountering this issue with the latest version Oculus Integration and Unity 2018.2.14f1. It is the exact same issue.
  • paulodgnpaulodgn Posts: 2
    NerveGear
    Im having the exact same problem. Is there any solution? Using Unity 2017.3 and Oculos GO.
  • r0b0sarur0b0saru Posts: 45 Oculus Start Member
    Any update to a fix for this? Having the same issue (2018.1.9f2)
  • pnaidupnaidu Posts: 1
    NerveGear
    edited January 11
    Same issue on Unity 2018.3.0f2 with Oculus Integration 1.32 for the Oculus Go Back Button only
  • AndyBorrellAndyBorrell Posts: 25
    Brain Burst
    edited January 23
    I'm also having this issue.   Unity 2017.4.11f1 + Oculus Integration 1.32 on the Oculus Go.    Back button presses are not detected about 10% of the time.
  • MikeSwansonMikeSwanson Posts: 28
    Brain Burst
    I shared this repro (that includes two bugs) with Oculus. It's a Unity 2018.3.0f2 project that includes Oculus Integration 1.32.0: https://drive.google.com/file/d/1-0_vi6KakQ_iNPDwFKrBKtlR8iwPu9K-/view?usp=sharing

    Here's a video of the two bugs. The first is me pressing the back button on the Oculus Go controller. I recorded my actual button presses and merged it with the video capture, so you can hear each press. You'll see that not every press is reported by OVRInput (as described in this thread).

    After that, I pull the trigger while loading an image from the web. You'll see that the tracking briefly glitches, which is another bug we're fighting with the 1.32.0 integration. Subsequent trigger presses and loads work just fine: https://drive.google.com/file/d/1-UaCWaI_NwucG4ooalbB8okFYfa3wqVT/view?usp=sharing
  • MikeSwansonMikeSwanson Posts: 28
    Brain Burst
    For what it's worth, this issue exists in 1.32, 1.31, and 1.30. However, it does not exist in 1.28. Unfortunately, I don't have version 1.29 handy, and it's possible that it would work correctly too.
  • perceptimageryperceptimagery Posts: 2
    NerveGear
    Hi. I have the same issue. I am surprised there has been so much time since the OP posted this and no reply from Oculus team. I just had to downgrade to 1.28 because in my case, it was only detecting the back button 20% of the time. I hope they release a hotfix for this soon.
  • lindahaolindahao Posts: 2
    NerveGear
    When I disable "multithreaded rendering" , the "Button.Back" problem will happen.
  • MikeSwansonMikeSwanson Posts: 28
    Brain Burst
    FYI that 1.32.1 was released today, but in my testing, it does not fix this issue.
  • AndyCoplanarAndyCoplanar Posts: 3
    NerveGear
    edited January 22
    (I am not Oculus staff - ignore flair)

    I just filed a bug this : https://developer.oculus.com/bugs/bug/483305815821770/
  • AndyBorrellAndyBorrell Posts: 25
    Brain Burst
    In the native SDK header files there is a comment that says "The ovrButton_Back flag always signals a short press and will only remain set for a single frame."   It certainly is the case that long presses don't cause this signal to be detected, however the bug we're seeing here is more than that.

    What I suspect is happening is that OVRPlugin detects a short press and sets the back button as being down, then clears it the next frame, or maybe even later the same frame.  The problem is that with multithreaded rendering in Unity, a frame on the main thread is not the same as a frame on the render thread. So it could easily be that in some cases the input update calls (on the main thread) happen just before the back button flag got set, and then just after it on the next frame so it gets missed.

    In Unity the call that actually gets the button state is OVRPlugin.GetControllerState4.  I tried adding more calls to this at various points in code to see if I could call it during that timing window to detect the back button press.  I found that different points in my code were indeed more likely to catch the back button than others.  By or-ing these together I found that I was detecting more than 95% of back button presses, which is probably good enough as a stopgap until Oculus fix this.

    Code location                                         Number of back button presses detected
    Earliest.Update                                       190
    Latest.Update                                         419
    Earliest yield return null                            467
    Latest  yield return null                             524
    Earliest yield return new WaitForEndOfFrame           178 
    Latest yield return new WaitForEndOfFrame             179
    
    Earliest is a script set to run before all other scripts,  Latest is a script set to run after all other scripts.  This is all from a single test session, so there are definitely times the back button flag was not returned when it was returned from identical function calls in the same frame.

    You can't tell from these numbers, but some of my button presses were still not detected.  It could be that the press never detected at all for these presses, or maybe the timing is such that it can still occasionally be missed.

    I'm sure this would be easy for someone at Oculus to fix if they looked into it. The repro is very easy. It happens for me in an empty project just with the 1.32 utilities on Unity 2017.4.11f1

  • MikeSwansonMikeSwanson Posts: 28
    Brain Burst
    edited January 23
    Thanks for the investigation, @AndyBorrell.

    I heard back from Oculus yesterday that this issue has been fixed and will likely be in the next release.

    Also, if you didn't see it, there's a simple repro project a few posts above.
  • MikeSwansonMikeSwanson Posts: 28
    Brain Burst
    Dropping by to say that today's 1.34.0 release today does not fix this issue.
  • cenek.strichelcenek.strichel Posts: 8 Oculus Start Member
    I had same problem, but I fixed it! :) I have two projects with same SDK. One with problem, second without problem. So it must be fixed in some Unity settings. I set my project settings by this blog: https://developer.oculus.com/blog/tech-note-unity-settings-for-mobile-vr/ and Back button is working again! I don't know what parameter affect back button, but maybe it is multithread rendering as @lindahao mentioned. 
  • MikeSwansonMikeSwanson Posts: 28
    Brain Burst
    FYI that yesterday's Oculus Integration 1.35.0 release mostly fixes this back button issue (without changing any project settings).

    If you press the back button less than once every 1/3 of a second (or so), it'll reliably detect every button press.

    If you press it faster than that, it will still drop events.

    For our use case, this is basically fixed.
  • JacksonGordonJacksonGordon Posts: 100
    Hiro Protagonist
    edited March 1
    To solve the back button behavior to pass the store, I used a custom behavior.  The default will minimize your app and use the Oculus implementation, which I don't think passes the technical review. With the custom dropdown selected you can script your own button behavior, I just used the setTextandNext -> fadeAndLoadScene method to get the behavior I wanted.  You might be able to do it similarly, hope this helps!
Sign In or Register to comment.