cancel
Showing results for 
Search instead for 
Did you mean: 

Oculus Go back button randomly detected

KosTargo
Honored Guest
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 ?
23 REPLIES 23

pnaidu
Honored Guest
Same issue on Unity 2018.3.0f2 with Oculus Integration 1.32 for the Oculus Go Back Button only

AndyBorrell
Protege
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.

MikeSwanson
Protege
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

MikeSwanson
Protege
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.

perceptimagery
Honored Guest
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.

lindahao
Honored Guest
When I disable "multithreaded rendering" , the "Button.Back" problem will happen.

MikeSwanson
Protege
FYI that 1.32.1 was released today, but in my testing, it does not fix this issue.

AndyCoplanar
Explorer
(I am not Oculus staff - ignore flair)

I just filed a bug this : https://developer.oculus.com/bugs/bug/483305815821770/

AndyBorrell
Protege
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

MikeSwanson
Protege
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.