Long vibration effects not working on Xbox One gamepads |
||
Issue descriptionChrome Version: 65.0.3325.124 (Official Build) beta (64-bit) OS: OS X 10.13.2 What steps will reproduce the problem? 1. Connect an Xbox One gamepad via microUSB cable 2. Navigate to html5gamepad.com and press a button on the gamepad so it shows up in the list. 3. Open the Developer Tools console and run this command: var pads = navigator.getGamepads(); pads[0].vibrationActuator.playEffect('dual-rumble', { duration: 5000, weakMagnitude: 1.0 }).then(r => {console.log(r)}) What is the expected result? Gamepad vibrates for 5 seconds, then stops vibrating just as "complete" is printed to the console. What happens instead? Gamepad vibrates for ~3 seconds, then stops vibrating. ~2 seconds later, "complete" is printed to the console. The Xbox One rumble packet specifies effect duration as an 8-bit unsigned value. Chrome always sets this to the maximum value (0xff) and issues a second rumble packet with 0 intensity when vibration should be stopped. However, this fails when the effect duration is longer than the maximum supported by the rumble packet. To fix this, Chrome should identify when a vibration effect is longer than the maximum duration supported by the packet and issue a new packet to continue the effect.
,
Nov 4
I was able to get long rumble effects working on the official Xbox One S controllers with https://github.com/torvalds/linux/commit/ae3b4469dbcd3b842a9fd20940946e4d092d8731 It appears that not all third-party Xbox One gamepads have firmware that supports rumbling for that long, so a timer approach is still ideal. Changing the rumble packet may work as a stop-gap though.
,
Nov 5
Thanks for the heads-up. I implemented a similar workaround on Mac but it never made it to the Linux driver: https://chromium.googlesource.com/chromium/src.git/+/fc63d3995a0ebff5dad757e24077fb8c4ac5065b Since this bug was originally Mac-only it should have been closed when the above change landed. But, I'll leave it open so I can double-check the Linux/XboxOneS case (probably it has the same bug). |
||
►
Sign in to add a comment |
||
Comment 1 by mattreynolds@chromium.org
, Mar 14 2018