Closed Bug 1704419 Opened 5 years ago Closed 3 months ago

Nintendo Switch gamepad support

Categories

(Core :: DOM: Device Interfaces, enhancement)

Firefox 87
enhancement

Tracking

()

RESOLVED FIXED
155 Branch
Webcompat Priority P3
Tracking Status
relnote-firefox --- 155+
firefox155 --- fixed

People

(Reporter: picaune, Assigned: jesup)

References

Details

Attachments

(1 external file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0

Steps to reproduce:

I connected an Xbox One S controller, a DualShock 4 controller, and a Nintendo Switch Pro Controller to my PC, http://luser.github.io/gamepadtest/, and exercised all buttons and axes.

Actual results:

XBOX One S controller - Showed up as a standard gamepad, everything was mapped properly.
DualShock 4 controller - Showed up as a standard gamepad, everything was mapped properly.
Nintendo Switch Pro Controller - Showed up as a standard gamepad with one extra button. Standard gamepad buttons 0-11 (face buttons, shoulder buttons and triggers, stick buttons, Back/Start) worked properly. Buttons 12-15 (dpad) and all four axes were completely nonfunctional. Button 16 (Home) showed up as button 12 (dpad up), and nonstandard button 17 (Share) showed up as button 13 (dpad down).

Expected results:

All gamepads should have been recognized as standard gamepads and mapped correctly.

This goes in the Core/DOM: Device Interfaces component.

There is some existing support for Nintendo Switch controllers, including a button remapper for the Pro Controller and both varieties of Joy-Con, but it does not appear to be working properly.

This issue was mentioned briefly in bug #1464940 comment 1, but since its comment zero was about DualShock support it was duplicated to bug #1523351.

The Nintendo Switch Pro Controller has fully-functional mappings in EdgeHTML and Chromium. I don't have a reference for Edge, but the Chrome bug is https://bugs.chromium.org/p/chromium/issues/detail?id=801717.

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Device Interfaces' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → DOM: Device Interfaces
Product: Firefox → Core
Webcompat Priority: --- → P3

This isn't a mapping problem. Nintendo Switch Pro controller is non-standard and requires some initialization logic.

It works in Chromium because they've implemented this https://source.chromium.org/chromium/chromium/src/+/main:device/gamepad/nintendo_controller.h

The Switch Pro (and 8BitDo pads in Switch mode, all VID 057e PID 2009) stream a
0x30 full input report over USB, but their HID report descriptor does not
describe that report's layout, so HidP_GetUsageValue/GetUsages extract garbage
(jittering sticks, phantom buttons from the battery/charging-grip bits). Parse
the 0x30 report bytes directly instead, matching Chromium's NintendoController.
No init handshake is needed since the device already sends 0x30.

Assignee: nobody → rjesup
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch

Did you want to nominate this for the Fx155 relnotes? If so, set the relnote-firefox flag to "?"
https://wiki.mozilla.org/Release_Management/Release_Notes_Nomination

Possible wording:

Nintendo Switch Pro controllers are now supported on Windows and map correctly in web games.

Flags: needinfo?(rjesup)

Release Note Request (optional, but appreciated)

How about: Nintendo Switch Pro and compatible aftermarket controllers are now supported on Windows and map correctly in web games.

relnote-firefox: --- → ?
Flags: needinfo?(rjesup)

Added to the Fx155 relnotes.

QA Whiteboard: [qa-triage-done-c156/b155]
See Also: → 2082306
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: