Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macos Switch Pro Controller Joystick Input Super Buggy #1627

Open
nickav opened this issue Jan 17, 2020 · 13 comments
Open

Macos Switch Pro Controller Joystick Input Super Buggy #1627

nickav opened this issue Jan 17, 2020 · 13 comments
Labels
bug Bug reports and bugfix pull requests input Keyboard, joystick or mouse macOS

Comments

@nickav
Copy link

nickav commented Jan 17, 2020

Summary

The joystick api is not working for the Nintendo Switch Pro Controller on macos.

Details

Macos Mojave 10.14.3 (18D42)
GLFW 3.3.1

Steps to Repro

  1. Build the glfw tests
  2. Plug in the pro controller via USB
  3. Run tests/joystick.app
  4. Observe joystick responses going haywire:

buggy_pro_controller_macos_glfw

Note that unplugging and re-plugging in the controller makes no difference

@elmindreda elmindreda added bug Bug reports and bugfix pull requests input Keyboard, joystick or mouse macOS labels Jan 18, 2020
@elmindreda
Copy link
Member

That should definitely not happen. Thank you for reporting this.

Unfortunately I don't have access to that model controller. Does the controller work normally with non-GLFW software on that Mac?

@nickav
Copy link
Author

nickav commented Jan 21, 2020

@elmindreda - I was able to get good readings from the controller using SDL2's Joystick / Gamepad API as well as from the web's gamepad api. Happy to help debug however I can! I'd much prefer to stick with GLFW over SDL

@MikeDX
Copy link

MikeDX commented Apr 20, 2020

Just to add to this, I'm getting the same results on a pro controller (wired) with the same ID.

When connected via bluetooth, the same controller appears but no buttons or inputs register at all.

@ghost
Copy link

ghost commented May 4, 2020

Getting the same issue when using a wired pro controller on Windows 10.

@echentw
Copy link

echentw commented May 15, 2020

I run into the same issue

@nickav
Copy link
Author

nickav commented Jul 22, 2020

Interestingly, there's an extra entry for Macos and Linux platforms in the SDL_GameControllerDB library (notice the difference in GUIDs). I wonder if that's the issue

@prideout
Copy link
Contributor

@nickav I don't think it's as simple as adding a line to the DB because I tried re-running the CMake generator script for the mappings header and it didn't help.

I noticed that the Switch controller itself blinks in the same way that it does when the an actual Switch console is "finding" the controller. I feel like the controller expects an initialization phase that is getting skipped.

@prideout
Copy link
Contributor

Gah, it looks like SDL includes an entire mini-driver just for the Switch:

https://github.com/libsdl-org/SDL/blob/main/src/joystick/hidapi/SDL_hidapi_switch.c

@armadillu
Copy link

Same issue here, on Bug Sur 11.6. I feel this used to work?

@hajimehoshi
Copy link

Same issue here

@folays
Copy link

folays commented Sep 30, 2022

on macOS Big Sur 11.6.2, in Bluetooth ONLY with the Switch Pro Controller :

At first it does not work, GLFW's tests/joysticks shows the controller, but none of the input work.
(to be clear : I don't have alls inputs going crazy like in OP post, I just have all inputs showing zero button press / movement)
But the controller is synced : macOS shows it in Bluetooth, the green LED "1st player" on the controller itself is on,
and probably more important : there is a blue ring led around the "home" button on the controller.

When I start Steam on macOS, the blue ring disappear.
and then I QUIT Steam. (I don't have to let it running)

and then the controller works perfectly with GLFW's tests/joysticks

...until the controller goes to sleep (of course) if I don't use it for some time.

Then if I press a button, it connects again in Bluetooth, and the blue led ring appears, and it does not work..
and I just have to run (and quit) Steam again, to make the controller work.

So, Steam seems to correctly initialize a thing, and Steam seems to not be needed once it has been done.
(unless there would be some "service" still running, but that would be in conflict with the observation that I still need to re-run+quit Steam again when the controller is awaken again)

So maybe a full driver is maybe not needed, GLFW seems to already have what's necessary,
maybe just an initilization code similar to what's Steam is doing is necessary..

@Pyrolistical
Copy link

Chromium describes how Switch Pro controller is non-standard https://source.chromium.org/chromium/chromium/src/+/main:device/gamepad/nintendo_controller.h

@Pyrolistical
Copy link

I get the same random inputs when connecting a pair of joycons over usb with the Nintendo Joy-Con Charging Grip.

On Chrome with gamepad-tester.com the joycons work and are detected as "Joy-Con L+R (STANDARD GAMEPAD Vendor: 057e Product: 200e)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports and bugfix pull requests input Keyboard, joystick or mouse macOS
Projects
None yet
Development

No branches or pull requests

9 participants