toji / chrome-webvr-issues

Stub repository for tracking bugs related to Chrome's experimental WebVR support
53 stars 12 forks source link

Vive controllers not detected #91

Closed Overv closed 6 years ago

Overv commented 8 years ago

VR works fine and the Steam overlay shows the controllers, but none of the WebVR demos detect them. If I run navigator.getGamepads(), then it returns an array with 4 undefined values. (The same happens in the normal version of Chrome.) There are no controllers connected to the system besides the Vive ones.

I have tried:

capnmidnight commented 8 years ago

When you are trying the demo, do you try to hit buttons or do you just wait for the controllers to show up? Gamepad API requires you to hit a button before the gamepad shows up. That's the spec, they rationalized it as a security feature.

On Aug 26, 2016 7:56 PM, "Alexander Overvoorde" notifications@github.com wrote:

VR works fine and the Steam overlay shows the controllers, but none of the WebVR demos detect them. If I run navigator.getGamepads(), then it returns an array with 4 undefined values. There are no controllers connected to the system besides the Vive ones.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/toji/chrome-webvr-issues/issues/91, or mute the thread https://github.com/notifications/unsubscribe-auth/AASMPiU3rlPiKxiPoaL2SdlDISIv227pks5qj304gaJpZM4Jujug .

Overv commented 8 years ago

I've tried pressing the triggers, trackpad, side and menu buttons, and then calling navigator.getGamepads again. That makes no difference. Is a call to navigator.getVRDisplays required for it to show up as well?

spiderworm commented 8 years ago

I am having the same issue with a fresh build downloaded today from webvr.info. Any update on this?

spiderworm commented 8 years ago

I'll provide my own update. I discovered that the controllers' firmware was out of date, and after updating the firmware I was able to discover them through navigator.getGamepads()

Overv commented 8 years ago

I also updated the firmware that day, but it was not working before nor after.

toji commented 8 years ago

It's a somewhat unintuitive quirk of the current setup that you have to call navigator.getVRDisplays() at least once before nagivator.getGamepads() will begin showing VR controllers. If you're testing on, say, html5gamepads.com you'll have to do that manually in the dev tools.

Is that the issue that you're seeing?

mrLoganite commented 8 years ago

Hi, I am having exactly the same issue and it coincides with the latest version of chrome experimental, and I do call navigator.getVRDisplays() many times before I use navigator.getGamepads();

However, and this really is weird so be prepared, I use playcanvas to develop webVr apps in and the editor the controllers work fine but the published one they do not (in the same browser!). I cannot tell you exactly what the differences are but for starters the editor runs in http:/ and the published in https://

ps. I get exactly the same result as above , getGamepads() stays as 4 undefined no matter how many times I call getVRDisplays() but only when running on the https:// published version

Perhaps someone here could try their non working app on a http:// and see if it fixes the problem

capnmidnight commented 8 years ago

For what it's worth, it works completely fine for me.

On Wed, Aug 31, 2016 at 8:04 AM, mrLoganite notifications@github.com wrote:

Hi, I am having exactly the same issue and it coincides with the latest version of chrome experimental.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/toji/chrome-webvr-issues/issues/91#issuecomment-243743465, or mute the thread https://github.com/notifications/unsubscribe-auth/AASMPokV8zZfV7ILCi4lYsw4Odqg2LT0ks5qlW3TgaJpZM4Jujug .

Sean T. McBeth Lead VR Engineer www.notiontheory.com

mrLoganite commented 8 years ago

capnmidnight, If it's not too much trouble could you post up the version of chrome you are using and can you state if you have tested from a http: https: domain or both. Thank you. My version is 55.0.2842.0 (64-bit) and getGamepads() works fine on http:// but not on https://

mrLoganite commented 8 years ago

The more I think about this the more I am leaning towards something along the lines of cross-domain security causing the issue. Is it possible for a cross-domain security issue to result in the getGamepads() staying undefined?

toji commented 8 years ago

I've heard of other sites having issues cross domain, so that may in fact be it. I'm not aware of any changes that would have enforces a restriction there, but it's entirely possible.

On Wed, Aug 31, 2016, 6:09 AM mrLoganite notifications@github.com wrote:

The more I think about this the more I am leaning towards something along the lines of cross-domain security causing the issue. Is it possible for a cross-domain security issue to result in the getGamepads() staying undefined?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/toji/chrome-webvr-issues/issues/91#issuecomment-243758407, or mute the thread https://github.com/notifications/unsubscribe-auth/AAxJmYKDDYoXUIo76QXfjW8s-yv6QEjpks5qlX0ZgaJpZM4Jujug .

Overv commented 8 years ago

Yeah, they've also started working for me since switching to HTTPS. However, I still need to press buttons on the controllers and then reload the page for every separate VR demo to get them detected. Is it possible to add a flag that will always enable the controllers?

I have also noticed that in the Sketchfab VR browser page the controllers are no longer detected once I select a model. However, this may be a bug in their application since navigator.getGamepads still works.

Controllers never show up on: http://threejs.org/examples/webvr_cubes.html Controllers show up on: https://threejs.org/examples/webvr_cubes.html (even though you need to manually ignore the invalid certificate)

mrLoganite commented 8 years ago

Thanks for the update Overv, i think that pretty much concludes where the problem lies.

Perhaps toji could let us know if this is a mistake or a deliberate change? so we know if it's going to be fixed or if we have to start working around it.

ps. I also noticed the Sketchfab site doesn't work anymore , I think stuff like that will only settle down once the main chrome branch has Vive support in.

mrLoganite commented 8 years ago

This latest blow to webVR has hit me hard.

I use PlayCanvas to create projects and I have around 20+ demonstrations of the cool uses you can put webVr to use but I cannot publish any of them due to the controllers no longer being detected.

https://playcanvas.com/mrloganite

Major setback.

capnmidnight commented 8 years ago

I finally got back in to the office to try it out again with the latest build (as of September 8th, so the August 30th build) on my own code from a secure domain and had no issue with the controllers. I didn't have time to try out your demos, I'm sorry.

Perhaps there was a regression with PlayCanvas? Or maybe there is an issue with your setup? How does PlayCanvas handle gamepads? How does it differentiate between regular gamepads and motion controllers? There used to be a WebVR-specific extension to Gamepad API that put a capabilities property on the gamepad object that had a hasOrientation property, but that property is now a member of the pose property and the capabilities one is gone.

mrLoganite commented 8 years ago

Thanks for the reply capnmidnight. I did some additional tests. I reduced the problem down to the minimum. A script which simply logs to the console the contents of navigator.getGamepads (). I am find that on one playcanvas domain it works and on another it doesnt. I am hearing of others having similar results. Something in the latest build causes navigator.getGampads () to act differently depending on some property of the domain but i am not sure what

mrLoganite commented 8 years ago

Did some additional testing and reduces the problem down even further.

I simply navigated to chrome://about

and then started spamming navigator.getVRDisplays() and navigator.getGamepads()

results are as follows: navigator.getVRDisplays() shows a htc vive but navigator.getGamepads() contantly comes back with 4 undefined no matter how many times i get the display or press the buttons. Also interestingly if I plug in an xbox360 controller it will also not detect that either

now if I shut down steamVR so that the headset and controllers shut down. then I try to use navigator.getGamepads() then the xbox controller is detected.

I am getting identical results with multiple machines and multiple HTV vive setups. The only common denominator at the moment is the version of chrome experimental they are all running.

EDIT: Latest version of Chromium Sep 17th now shows getGamepads() in Chrome://about but it's still not working on other url's.

d3x0r commented 8 years ago

I never get anything except an array of 4 nulls from getGamepads() I tried navigating to a secure domain... scratch that https://threejs.org/examples/#webvr_vive_paint doesn't work. I plugged in a logitech chillstream and it immediately showed in the list. the HTC controllers were showing in the steam VR lobby before clicking on the Enter VR...

I did read on the webvr list there were changes to force enter vr to be on user action.... maybe this is one of those complications?

romise__proto__: Promise[[PromiseStatus]]: "resolved"[[PromiseValue]]: Array[1]0: VRDisplaycapabilities: VRDisplayCapabilities
depthFar: 10000
depthNear: 0.01
displayId: 1
displayName: "HTC Vive MV"isConnected: true
isPresenting: false
stageParameters: VRStageParameters

it is in VR with a state of (Exit VR)

chrome 55.0.2869.0

(aug 7 archive works, discovers controllers powered on, after starting webvr, and then navigator.getGamepads() returns some gamepads!) https://drive.google.com/open?id=0BzudLt22BqGRQ0dvVGZHV2Njdkk


(signature for the day - why is it every time I pick up a project and hope to get it into some new area, the new area has under construction blockades?)

micahstubbs commented 8 years ago

experience this issue as well

Chromium Version 55.0.2869.0 (64-bit)

steamvr

navigator-getgamepads

d3x0r commented 8 years ago

(I think your test should show 'navigator' not 'nagivator' )

micahstubbs commented 7 years ago

'>< @d3x0r you're totally right

should be more careful when I copy-paste from up the thread 😅

d3x0r commented 7 years ago

Edit2 : This thread is older than I thought ; maybe I should have started a new thread- it showed for searching 'gamepad pose' though...

Think initially my failure to find any controllers in Sept 23 was failing to turn on the flag. I reverted to Aug 7 build, enabled the flag and then my controllers worked. I did some investigating today and learned that Sept 23 build does not have 'pose' field in the gamepad.

image


Aug 7 build... image

aug 7 also has 'hand' I learned the three.js controller code silently does nothing if 'pose' is missing from the gamepad.


Edit3 I read the realease notes inbetween better and saw

To better stay in sync with ToT Chrome the VR-centric gamepad APIs (Pose, Hand, Haptics) are now behind the “Gamepad Extensions” flag in about:flags. I know it sucks to have to flip more switches but this is the cleanest way for me to move forward.

But I don't have 'Gamepad' anything in sept23 build, so after September 17, 2016, and before spet23 I guess I could have used that flag to get the extended properties back? And since there sin't a gamepad flags in 23, I guess they work now, because I'm using the same data-dir and user-dir for the two and Aug 7 was able to turn it on?
possible workaround? So if I had sept 17 I could turn it on for sept 23 ?

vkalpias commented 7 years ago

Just wanted to say that in PlayCanvas published apps, navigator.getGamepads() did not return any connected controllers and that was because we were calling this in the page that loaded the iframe with the published app:

if (iframe.contentWindow)
    iframe.contentWindow.focus()

Now we do

iframe.addEventListener('load', function () {
    iframe.contentWindow.focus():
});

and navigator.getGamepads() works OK again... Maybe this is not related but might help someone.

toji commented 6 years ago

Closing all bugs in this issue tracker.

This repo was created to track issues in the experimental builds WebVR Chromium builds, which are now deprecated. Chrome Canary for Windows now has much more secure (and hopefully more performant) support for WebVR behind a flag, and Android has had WebVR support as an Origin Trial and behind a flag for a while now.

If this is a performance or correctness bug and you suspect it's still happening, please test against the latest Canary build of Chrome to verify and then file a bug at https://crbug.com. If this is an issue with the API, please review the latest WebXR explainer to see if it's been resolved and file a bug there if not.

Thanks for your interest in VR on the web! We've got an exciting year ahead of us! --Brandon