Intent to Prototype: Gamepad API vibration on Android 12+

545 views
Skip to first unread message

Matt Reynolds

unread,
Jun 28, 2022, 2:50:58 PM6/28/22
to blink-dev

Contact emails

mattre...@google.com


Specification

https://github.com/w3c/gamepad/pull/163


Summary

Enable support for Gamepad API dual-rumble effects through the VibrationManager API added in Android 12.


Blink component

Blink>GamepadAPI


Search tags

gamepad, haptics, vibration, rumble, android


TAG review

Not applicable


Risks



Interoperability and Compatibility



Gecko: No signal


WebKit: No signal


Web developers: No signals


Other signals:


WebView application risks

None



Goals for experimentation

The Chrome team has a limited number of gamepads and Android devices to test with. Implementing this feature behind a flag will enable us to manually test a wider range of devices.


Debuggability

DevTools


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes, it is already implemented on desktop Blink platforms.


Is this feature fully tested by web-platform-tests?

No, this feature cannot be tested using automated tests because it relies on gamepad-specific behavior that can't be mocked.


Flag name

chrome://flags/#enable-android-gamepad-vibration


Requires code in //chrome?

False


Tracking bug

https://crbug.com/1338644


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5144383549079552


Thomas Steiner

unread,
Jun 29, 2022, 6:55:47 AM6/29/22
to Matt Reynolds, blink-dev
On Tue, Jun 28, 2022 at 8:50 PM Matt Reynolds <mattre...@chromium.org> wrote:

Contact emails

mattre...@google.com


Specification

https://github.com/w3c/gamepad/pull/163


Summary

Enable support for Gamepad API dual-rumble effects through the VibrationManager API added in Android 12.


Blink component

Blink>GamepadAPI


Search tags

gamepad, haptics, vibration, rumble, android


TAG review

Not applicable


Risks



Interoperability and Compatibility



Gecko: No signal


WebKit: No signal


Web developers: No signals


Other signals:


WebView application risks

None



Goals for experimentation

The Chrome team has a limited number of gamepads and Android devices to test with. Implementing this feature behind a flag will enable us to manually test a wider range of devices.


Could you share a list of compatible gamepads?
 

Debuggability

DevTools


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes, it is already implemented on desktop Blink platforms.


Is this feature fully tested by web-platform-tests?

No, this feature cannot be tested using automated tests because it relies on gamepad-specific behavior that can't be mocked.


Flag name

chrome://flags/#enable-android-gamepad-vibration


Requires code in //chrome?

False


Tracking bug

https://crbug.com/1338644


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5144383549079552


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGhmGSMrh6gjgPW5Z1eWQWzerZs746V6_xNtBfdLrd57ARztmQ%40mail.gmail.com.


--
Thomas Steiner, PhD—Developer Relations Engineer (https://blog.tomayac.comhttps://twitter.com/tomayac)

Google Germany GmbH, ABC-Str. 19, 20354 Hamburg, Germany
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891

----- BEGIN PGP SIGNATURE -----
Version: GnuPG v2.3.4 (GNU/Linux)

iFy0uwAntT0bE3xtRa5AfeCheCkthAtTh3reSabiGbl0ck0fjumBl3DCharaCTersAttH3b0ttom.hTtPs://xKcd.cOm/1181/
----- END PGP SIGNATURE -----

Matt Reynolds

unread,
Jun 29, 2022, 5:31:21 PM6/29/22
to Thomas Steiner, blink-dev
Compatibility depends on Android's support which isn't documented. The Android implementation relies on a compatible Linux driver exposing the FF_RUMBLE feature. I've tested a Sony DualShock 4 and a Microsoft Xbox 360 wired controller, both worked. I would expect all of these to work based on the current state of Linux gamepad drivers:

Microsoft Xbox 360 compatible gamepads
Microsoft Xbox One compatible gamepads when connected over USB (but not over Bluetooth)
Official Sony PlayStation 3, 4, 5 gamepads over USB or Bluetooth (but not third party PlayStation compatible gamepads)
Official Nintendo Switch gamepads over USB or Bluetooth (but not third party Switch compatible gamepads)

These devices are handled by the xpad, hid-playstation, hid-sony, and hid-nintendo drivers.

https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c
https://github.com/torvalds/linux/blob/master/drivers/hid/hid-playstation.c
https://github.com/torvalds/linux/blob/master/drivers/hid/hid-sony.c
https://github.com/torvalds/linux/blob/master/drivers/hid/hid-nintendo.c

Thomas Steiner

unread,
Jun 30, 2022, 3:45:09 AM6/30/22
to Matt Reynolds, Thomas Steiner, blink-dev
On Wed, Jun 29, 2022 at 11:31 PM Matt Reynolds <mattre...@chromium.org> wrote:
Compatibility depends on Android's support which isn't documented. The Android implementation relies on a compatible Linux driver exposing the FF_RUMBLE feature. I've tested a Sony DualShock 4 and a Microsoft Xbox 360 wired controller, both worked. I would expect all of these to work based on the current state of Linux gamepad drivers:

Microsoft Xbox 360 compatible gamepads
Microsoft Xbox One compatible gamepads when connected over USB (but not over Bluetooth)
Official Sony PlayStation 3, 4, 5 gamepads over USB or Bluetooth (but not third party PlayStation compatible gamepads)
Official Nintendo Switch gamepads over USB or Bluetooth (but not third party Switch compatible gamepads)

These devices are handled by the xpad, hid-playstation, hid-sony, and hid-nintendo drivers.

https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c
https://github.com/torvalds/linux/blob/master/drivers/hid/hid-playstation.c
https://github.com/torvalds/linux/blob/master/drivers/hid/hid-sony.c
https://github.com/torvalds/linux/blob/master/drivers/hid/hid-nintendo.c

Brilliant, thanks for the detailed info. Will give it a try on my Joy-Cons and my old Xbox 360 controllers!

Rik Cabanier

unread,
May 16, 2023, 8:23:15 PM5/16/23
to Matt Reynolds, Thomas Steiner, blink-dev
were there any updates on this list? I just tried this on a pixel 6a and the haptics worked to an XBox controller over bluetooth

Reply all
Reply to author
Forward
0 new messages