VRMADA / ultimatexr-unity

UltimateXR is a free, open source framework that facilitates the creation of VR applications.
https://www.ultimatexr.io
MIT License
467 stars 60 forks source link

Pico 4e - Inputs stop working after pressing home button #50

Open Gango98 opened 1 year ago

Gango98 commented 1 year ago

Hello, I'm experiecing an issue with an app built on Pico 4e. When I press the home button on the right controller to show the OS menu and I come back to the app, inputs do not work anymore. The same app built on Meta Quest 2 doesn't have this problem.

If I rotate the head, the view updates with no problems and even the controllers are tracked correctly as I can see the hands moving properly. But, since I can't press any button, I'm forced to restart the app.

I'm on Windows using Unity 2021.3.10f1, with UltimateXR 0.9.6, Pico Unity Integration SDK 2.2.0 and the latest version of Pico OS installed.

By the way, congratulations for this SDK. It simply works, it's really easy to use and it's well documented.

mbt1909432 commented 1 year ago

hello, have you solved this problem? I am also encountering this issue

Gango98 commented 1 year ago

Hello. No, the problem is still there. I have no idea how to fix it

Schaeferyn commented 1 year ago

I've been using the Pico Integration v2.1.1 and have had this same problem. I tried upgrading the Pico Integration to v2.3.4 to see if maybe something changed on their end, and it seemed to get worse. I could no longer use any inputs ever, even from a fresh app launch.

Seems like maybe Pico changed something about how they're handing input registration maybe?

Note: I'm on a Pico Neo 3, but someone on my team is on a Neo 4 and has been having the same issues.

Update: After downgrading back to v2.1.1, I'm still no longer able to use any inputs in the project. I have no idea what's different, but something clearly broke. Even doing a fresh clone of my project repo doesn't solve the issue.

chengj78 commented 1 year ago

I solved this problem By change UxrControllerInput line 87 return EnabledComponentsInLocalAvatar.FirstOrDefault(i => i.GetType() != typeof(UxrDummyControllerInput)); to return EnabledComponentsInLocalAvatar.FirstOrDefault(i => i.GetType() != typeof(UxrDummyControllerInput)&&i.GetType() != typeof(UxrGamepadInput));

But I don't know why!

mbt1909432 commented 1 year ago

I've been using the Pico Integration v2.1.1 and have had this same problem. I tried upgrading the Pico Integration to v2.3.4 to see if maybe something changed on their end, and it seemed to get worse. I could no longer use any inputs ever, even from a fresh app launch.

Seems like maybe Pico changed something about how they're handing input registration maybe?

Note: I'm on a Pico Neo 3, but someone on my team is on a Neo 4 and has been having the same issues.

Update: After downgrading back to v2.1.1, I'm still no longer able to use any inputs in the project. I have no idea what's different, but something clearly broke. Even doing a fresh clone of my project repo doesn't solve the issue.

hello, Do you have Pico4 pro or Pico4 ? I have also updated Integration version to V2.3.4 recently, it can work on my Pico 4 pro. But still cannot support handtracking

mbt1909432 commented 1 year ago

Thanks a lot! By the way, do you have any idea of hand tracking using Pico4 and UXR? I found it can support hand-tracking on Oculus but cannot for Pico, Although I saw it has some hand-tracking related scripts attached to the object.

Schaeferyn commented 1 year ago

Guys, there's been another revelation in the lab.

My issue was twofold: Inputs not being detected at launch, then (in another app) inputs not being detected after a pause (little popup menu). Both issues were happing when using a Pico headset. (Neo 3 and Neo 4 in my case. No hand tracking, just the usual controllers.)

In the BigHandsAvatar (which I'm using a variant of), the "BigHandsIntegration" child object has a child object of its own called "Components". Inside there are 9 separate tracking/input scripts, one for each platform. On the Neo 3, when my inputs weren't working, I noticed that there were 9 debug logs specifically telling me that it detected the right controller, but only one (Pico) was not "unknown". So as a test I went and disabled the input objects for each platform except Pico. Now it all works perfectly.

When working in the editor, I have the Oculus object enabled (for testing with Quest Link), and when I make a build, I have the Pico object enabled. All others are disabled. Since I've done this, I've had zero input issues. everything works perfectly now, even after a pause. My best guess is that somehow these scripts for the other platforms were causing a conflict and disabling them resolved it.

(tagging @entromp -- In case this helps with dev or is related to similar issues others are having.)

entromp commented 9 months ago

Hi @Schaeferyn,

I believe the issue could be related to what @chengj78 reported here Without deactivating all components, could you try printing if there is one activated by mistake? Or maybe Pico indeed reports a Gamepad present:

foreach (UxrControllerInput input in UxrControllerInput.AllComponentsInLocalAvatar)
{
    if (input.enabled)
    {    
        Debug.Log($"{input.GetType().Name} is enabled");
    }
}

If for some reason there is more than one controller component enabled it could be that another input is being returned instead of pico. What seems weird is reporting a new gamepad only after resuming a pause and not at the beginning.

entromp commented 9 months ago

Answering myself here. It seems I overlooked the issue here: https://github.com/VRMADA/ultimatexr-unity/issues/32#issuecomment-1674569200 I'll upload a fix right away. What I find weird is why Pico would report a gamepad and why only after pausing.

entromp commented 9 months ago

Should be fixed in #56 Can anyone please test before closing the issue?