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

Pro Controller connected with USB, doesn't reconnect after computer resumes from suspend #42

Closed
SuperSamus opened this issue Jul 10, 2022 · 4 comments

Comments

@SuperSamus
Copy link

SuperSamus commented Jul 10, 2022

Normally, if you connect a Nintendo Switch Pro Controller via USB, it is automatically connected when turning the computer on.
If however the computer is suspended, when resuming the computer, the controller won't reconnect, even if you press a button. The ways to reconnect it are either:

  • Press the sync button on the controller;
  • Unplug and plug the USB cable;
  • Reboot the computer.

Relevant logs from journalctl when suspending:

lug 11 00:39:44 nixos kernel: nintendo 0003:057E:2009.000F: compensating for 37 dropped IMU reports
lug 11 00:39:44 nixos kernel: nintendo 0003:057E:2009.000F: delta=504 avg_delta=13

When resuming:

lug 11 00:39:44 nixos kernel: leds 0003:057E:2009.000F:green:player-1: Setting an LED's brightness failed (-110)
lug 11 00:39:45 nixos kernel: leds 0003:057E:2009.000F:green:player-2: Setting an LED's brightness failed (-110)
lug 11 00:39:45 nixos kernel: leds 0003:057E:2009.000F:green:player-3: Setting an LED's brightness failed (-110)
lug 11 00:39:46 nixos kernel: leds 0003:057E:2009.000F:green:player-4: Setting an LED's brightness failed (-110)
lug 11 00:39:46 nixos kernel: leds 0003:057E:2009.000F:blue:player-5: Setting an LED's brightness failed (-110)

After pressing the sync button on the controller (still plugged in via USB):

lug 11 00:49:21 nixos kernel: usb 3-2: USB disconnect, device number 17
lug 11 00:49:22 nixos kernel: usb 3-2: new full-speed USB device number 18 using xhci_hcd
lug 11 00:49:22 nixos kernel: usb 3-2: New USB device found, idVendor=057e, idProduct=2009, bcdDevice= 2.10
lug 11 00:49:22 nixos kernel: usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
lug 11 00:49:22 nixos kernel: usb 3-2: Product: Pro Controller

...etcetera.

@DanielOgorchock
Copy link
Owner

Thanks for pointing this out. Yeah the driver doesn't have pm hooks implemented. I should really add those.

@SuperSamus
Copy link
Author

SuperSamus commented Jul 9, 2023

Well, I tried it myself.
After trying to compile the Linux kernel to load a module (first time), I finally did it.
I didn't test it much, but it seems to work well.
Here is the patch: pro-controller-suspend.txt
EDIT: pro-controller-suspend.txt

If no one has anything against it, I'll send it after a week. (My first kernel contribution)

@SuperSamus
Copy link
Author

SuperSamus commented Jul 20, 2023

@SuperSamus
Copy link
Author

Fixed on Linux 6.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants