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 disconnects when connected via Bluetooth #33

Open
twoxa opened this issue Jan 13, 2022 · 122 comments
Open

Pro Controller disconnects when connected via Bluetooth #33

twoxa opened this issue Jan 13, 2022 · 122 comments

Comments

@twoxa
Copy link

twoxa commented Jan 13, 2022

When using the Pro Controller in Bluetooth mode it will randomly disconnect after some time, it might last a few minutes or a few hours (usually its a couple of minutes), it seems random.
When using combined Joycons there is no issue, they work perfectly every time.
When using the Pro Controller in wired mode it works normally.
Tried pairing without joycond, with different Bluetooth adapters, nothing works.
Logs when the controller connects:

Jan 13 20:04:55 Archer kernel: Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Jan 13 20:04:55 Archer kernel: Bluetooth: HIDP socket layer initialized
Jan 13 20:04:55 Archer bluetoothd[1386]: profiles/input/device.c:ioctl_is_connected() Can't get HIDP connection info
Jan 13 20:04:55 Archer systemd[548]: Reached target Bluetooth.
Jan 13 20:04:58 Archer kernel: hid-generic 0005:057E:2009.0006: unknown main item tag 0x0
Jan 13 20:04:58 Archer kernel: input: Pro Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.1/1-5.1.4/1-5.1.4:1.0/bluetooth/hci0/hci0:1/0005:057E:2009.0006/input/input33
Jan 13 20:04:58 Archer kernel: hid-generic 0005:057E:2009.0006: input,hidraw5: BLUETOOTH HID v0.01 Gamepad [Pro Controller] on 8c:88:2b:40:00:f1
Jan 13 20:04:58 Archer kernel: nintendo 0005:057E:2009.0006: unknown main item tag 0x0
Jan 13 20:04:58 Archer kernel: nintendo 0005:057E:2009.0006: hidraw5: BLUETOOTH HID v80.01 Gamepad [Pro Controller] on 8c:88:2b:40:00:f1
Jan 13 20:05:00 Archer kernel: nintendo 0005:057E:2009.0006: using factory cal for left stick
Jan 13 20:05:00 Archer kernel: nintendo 0005:057E:2009.0006: using factory cal for right stick
Jan 13 20:05:00 Archer kernel: nintendo 0005:057E:2009.0006: using user cal for IMU
Jan 13 20:05:00 Archer kernel: nintendo 0005:057E:2009.0006: controller MAC = 64:B5:C6:44:80:8B
Jan 13 20:05:00 Archer kernel: input: Nintendo Switch Pro Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.1/1-5.1.4/1-5.1.4:1.0/bluetooth/hci0/hci0:1/0005:057E:2009.0006/input/input34
Jan 13 20:05:00 Archer kernel: input: Nintendo Switch Pro Controller IMU as /devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.1/1-5.1.4/1-5.1.4:1.0/bluetooth/hci0/hci0:1/0005:057E:2009.0006/input/input35
Jan 13 20:05:00 Archer joycond[436]: DEVNAME=event257 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.1/1-5.1.4/1-5.1.4:1.0/bluetooth/hci0/hci0:1/0005:057E:2009.0006/input/input34/event257
Jan 13 20:05:00 Archer joycond[436]: Creating new phys_ctlr for /dev/input/event257
Jan 13 20:05:00 Archer joycond[436]: Found Pro Controller
Jan 13 20:05:00 Archer joycond[436]: driver_name: Nintendo Switch Pro Controller
Jan 13 20:05:00 Archer joycond[436]: MAC: 64:B5:C6:44:80:8B
Jan 13 20:05:01 Archer joycond[436]: adding epoll_subscriber: fd=5
Jan 13 20:05:01 Archer kernel: nintendo 0005:057E:2009.0006: compensating for 4 dropped IMU reports
Jan 13 20:05:01 Archer kernel: nintendo 0005:057E:2009.0006: delta=90 avg_delta=15


Logs when the controller disconnects:

Jan 13 20:06:29 Archer kernel: nintendo 0005:057E:2009.0006: compensating for 4 dropped IMU reports
Jan 13 20:06:29 Archer kernel: nintendo 0005:057E:2009.0006: delta=78 avg_delta=14
Jan 13 20:06:33 Archer kernel: nintendo 0005:057E:2009.0006: compensating for 5 dropped IMU reports
Jan 13 20:06:33 Archer kernel: nintendo 0005:057E:2009.0006: delta=78 avg_delta=11
Jan 13 20:06:36 Archer kernel: nintendo 0005:057E:2009.0006: compensating for 5 dropped IMU reports
Jan 13 20:06:36 Archer kernel: nintendo 0005:057E:2009.0006: delta=79 avg_delta=11
Jan 13 20:06:41 Archer kernel: nintendo 0005:057E:2009.0006: compensating for 5 dropped IMU reports
Jan 13 20:06:41 Archer kernel: nintendo 0005:057E:2009.0006: delta=77 avg_delta=11
Jan 13 20:06:50 Archer kernel: nintendo 0005:057E:2009.0006: compensating for 5 dropped IMU reports
Jan 13 20:06:50 Archer kernel: nintendo 0005:057E:2009.0006: delta=78 avg_delta=11
Jan 13 20:06:53 Archer kernel: nintendo 0005:057E:2009.0006: compensating for 5 dropped IMU reports
Jan 13 20:06:53 Archer kernel: nintendo 0005:057E:2009.0006: delta=78 avg_delta=11
Jan 13 20:06:58 Archer kernel: nintendo 0005:057E:2009.0006: timeout waiting for input report
Jan 13 20:06:58 Archer joycond[436]: Lone controller paired
Jan 13 20:06:58 Archer joycond[436]: DEVNAME=event257 ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.1/1-5.1.4/1-5.1.4:1.0/bluetooth/hci0/hci0:1/0005:057E:2009.0006/input/input34/event257
@dogtopus
Copy link

What kind of Bluetooth controller are you using? Judging from the OUI I'm guessing it's one of those cheap USB dongles (probably with very short internal antenna). Could just be signal quality issue then? What does blueman say about the link quality?

@twoxa
Copy link
Author

twoxa commented Jan 19, 2022

I don't think it's a signal issue because then why would the Joycons work normally (they also use Bluetooth with the same adapter), also tried it with the adapter right next to the controller still disconnects. Tried it on a different computer also running Linux with its internal Bluetooth adapter, still disconnects.

@twoxa twoxa closed this as completed Jan 19, 2022
@twoxa twoxa reopened this Jan 19, 2022
@aeghn
Copy link

aeghn commented Mar 5, 2022

Thank you for your efforts for this feature!

Same question here.

The pro controller with vibration will disconnect after a few minutes of connection, while it works fine on Windows (same machine) and on my NS.

The bluetooth adapter is: Intel AX200

I am using Archlinux with linux 5.16.12-arch1-1. The logs are as follows:

journalctl -u bluetooth:

Mar 05 17:12:44 chindpc bluetoothd[25826]: Adv Monitor app :1.369 disconnected from D-Bus
Mar 05 17:12:44 chindpc bluetoothd[25826]: Path / reserved for Adv Monitor app :1.370
Mar 05 17:12:44 chindpc bluetoothd[25826]: profiles/input/device.c:ioctl_is_connected() Can't get HIDP connection info
Mar 05 17:12:44 chindpc bluetoothd[25826]: Adv Monitor app :1.370 disconnected from D-Bus

btmon


> HCI Event: Disconnect Complete (0x05) plen 4         #73275 [hci0] 557.690726
        Status: Success (0x00)
        Handle: 512
        Reason: Connection Terminated By Local Host (0x16)
@ MGMT Event: Device Disconnected (0x000c) plen 8    {0x0001} [hci0] 557.690733
        BR/EDR Address: xx:xx:xx:xx:xx:xx (Nintendo Co.,Ltd)
        Reason: Connection terminated by local host (0x02)
> HCI Event: Number of Completed Pack.. (0x13) plen 5  #73276 [hci0] 557.693726
        Num handles: 1
        Handle: 256
        Count: 1

...

< HCI Command: Disconnect (0x01|0x0006) plen 3         #73569 [hci0] 560.522601
        Handle: 512
        Reason: Authentication Failure (0x05)

...

> HCI Event: Remote Name Req Complete (0x07) plen 255  #73585 [hci0] 560.681756
        Status: Remote User Terminated Connection (0x13)
        Address: xx:xx:xx:xx:xx:xx (Nintendo Co.,Ltd)
        Name:
> HCI Event: Disconnect Complete (0x05) plen 4         #73586 [hci0] 560.682761
        Status: Success (0x00)
        Handle: 512
        Reason: Connection Terminated By Local Host (0x16)
> HCI Event: Number of Completed Pack.. (0x13) plen 5  #73587 [hci0] 560.683760
        Num handles: 1
        Handle: 256
        Count: 1

If the information provided is not enough, I will gladly continue to provide it.

@nfp0
Copy link

nfp0 commented Apr 13, 2022

I have tried my Pro Controllers with 5 different Bluetooth radios and they all presented the same behavior: When used with games that have rumble, they disconnect (specially if more than 1 controller is connected).

I have tried the following Bluetooth radios:

  • ID 1131:1004 Integrated System Solution Corp. Bluetooth Device
  • ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
  • ID 2357:0604 TP-Link TP-Link UB500 Adapter
  • ID 0bda:4852 Realtek Semiconductor Corp. Bluetooth Radio
  • ID 8087:0a2b Intel Corp. Bluetooth wireless interface

All of them are officially certified Bluetooth products, with the exception of the 1st one.

I tested by playing the N64 Super Smash Bros on RetroArch with 2 Pro Controllers and I consistently get a disconnect usually in less than 5 minutes. Sometimes in just a few seconds.

Using the controllers with rumble through Steam on Windows does not cause a disconnection. That, together with the fact that all 5 radios show the same behavior makes me believe this is not an hardware issue.

@DanielOgorchock @nicman23 I would really like to help you debug this issue. Is there any way for me to help?
Any logs I can provide?

@nfp0
Copy link

nfp0 commented Apr 14, 2022

I forgot to mention:
When using the 2 Pro controllers and a 3rd non-Nintendo controller all connected to the same Bluetooth, only the Pro controllers disconnect after a while, while the 3rd controller, keeps connected and functioning.
Furthermore, the 2 Pro Controllers, usually disconnect at the same time or within a few seconds of each other.

This gives weight to the theory that there must be something wrong in the code and not in the hardware. I wish I knew how to debug this, though.

Should I also post this info on nicman23/dkms-hid-nintendo#33 for awareness?

@twoxa
Copy link
Author

twoxa commented Apr 21, 2022

It is getting weirder, now the pro controller connects and if it doesn't disconnect in the first 2 minutes then it'll work until I turn it off manually. It usually takes about 3-5 times before it connects for good (so the way I use it now is: connect wait a minute or two see if it doesn't disconnect in that time its good and i can use it for how ever long I want, if it does disconnect then try again until it stays connected for those 1-2 minutes). It works but i have to keep trying to connect until the connection "sticks", not sure if its related but, I did change some settings in /etc/bluetooth/main.conf:

FastConnectable = true
JustWorksRepairing = always
ReconnectAttempts=3
ReconnectIntervals=1,1,2,3,5,8,13,21,34,55
AutoEnable=true

Forgot to mention I am also using Arch Linux on both the machines I tested it on, so it might be an Arch specific issue.

@nfp0
Copy link

nfp0 commented Apr 21, 2022

@twoxa Arch user here too.
Interesting finds. I'll see if I arrive at the same pattern as you.

@nicman23
Copy link

@nfp0 sorry i currently do not have any switch controllers to test with. btw what is your system specs and usb controller

@nfp0
Copy link

nfp0 commented May 12, 2022

I have tested this on 3 different systems:

  • A desktop with an AMD Ryzen 7 3700X (with 3 different USB Bluetooth dongles, listed below)
  • A Lenovo Miix 520 laptop with an Intel i5-8250U (integrated Intel Bluetooth)
  • A Lenovo P14s laptop with an AMD Ryzen 7 PRO 5850U (integrated Realtek Bluetooth)

On my desktop I have these USB controllers:

  • 06:00.0 USB controller: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset USB 3.1 XHCI Controller (rev 01)
  • 0f:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller

I imagine the Intel laptop has other controllers but I can't get those right now.

The USB Bluetooth dongles tested:

  • Old cheap chinese dongle -> ID 1131:1004 Integrated System Solution Corp. Bluetooth Device
  • TP-Link UB4A -> ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
  • TP-Link UB500 -> ID 2357:0604 TP-Link TP-Link UB500 Adapter

The laptop integrated Bluetooth radios:

  • Lenovo Miix 520 -> ID 8087:0a2b Intel Corp. Bluetooth wireless interface
  • Lenovo P14s -> ID 0bda:4852 Realtek Semiconductor Corp. Bluetooth Radio

All Bluetooth certified except the cheap chinese one.

The OS is Manjaro KDE, but I also tested this on Arch.
I always get the exact same problem with the same behavior, regardless of system or Bluetooth dongle: a simultaneous disconnection of all HID-Nintendo managed controllers when using rumble after a few seconds or minutes. Non-HID-Nintendo controllers remain working perfectly.
That's quite a lot of different hardware this fails on, and this does not happen on Windows when using rumble through Steam.

sorry i currently do not have any switch controllers to test with

@nicman23 I would like to help. I can test with multiple controllers and easily trigger the disconnection after a few seconds.
How can I provide you with information to try and fix this? Any kind of logging or debugging?

@SuperSamus
Copy link

SuperSamus commented Jul 7, 2022

I don't know if it's just me, but it seems that games with a strong rumble intensity tend to disconnect more frequently.
For example, Rocket League rumbles the controller basically all the time, but it's low intensity. I played it quite a lot of hours, and I only ever got one disconnection.
Another game, Wondersong, almost never uses rumble, but when it does, it's of high intensity, and I got quite a lot of disconnections on that game (and only in the parts where there is that rumble). There is one section of the game where rumble is instead done all the time, with the same high intensity, and the controller couldn't stay connected one minute in that section.

Does my experience match yours?

EDIT: Maybe it's related: DanielOgorchock/joycond#104.

@SuperSamus
Copy link

I submitted a bug on Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=216218.

@nfp0
Copy link

nfp0 commented Jul 8, 2022

@SuperSamus Interesting!

RetroArch allows to choose the intensity of the vibration. I'll test it at max and minimum vibration intensity and report back if there is a pattern or not.

@Labaman
Copy link

Labaman commented Sep 6, 2022

I have the same problem.
@SuperSamus You're right, I checked with Yuzu - there you can control the intensity of vibration, as well as turn it off.
In games where vibration is used often (e.g. Super Mario Oddesey) - the controller is turned off within a few minutes after the start of the game.
In games where vibration is used infrequently (such as Legend Of Zelda BOTW), the controller can run for up to several hours without turning it off.
If you completely disable vibration in the control settings, the controller does not turn off during the game at all.
And similarly, with a wired connection, the controller does not turn off regardless of whether vibration is on or not.
It's not a hardware problem - the problem is reproduced on 2 different controllers. And not a problem with bluetooth - I also have an Xbox One controller that does not turn off with vibration on.

@nfp0
Copy link

nfp0 commented Sep 6, 2022

@Labaman Yeah, it's certainly not a hardware problem. I've tested with 5 different bluetooth radios with 2 different Pro Controllers.
Same problem happens in any of them.

@Labaman
Copy link

Labaman commented Sep 7, 2022

So is there any hope of improving the situation?

@nfp0
Copy link

nfp0 commented Sep 7, 2022

Since we can easily reproduce the bug, we could provide debug help to @nicman23, but he's been absent for a while. 😞

@DanielOgorchock
Copy link
Owner

DanielOgorchock commented Sep 7, 2022

Does there appear to be any correlation with the strength of the rumble? Does higher rumble intensity seem to cause disconnects more frequently than light rumble events?

If so, I can try decreasing the driver's maximum amplitude. I wonder if there's a power supply brownout occurring when connected via bluetooth that doesn't occur over USB (since the controllers can draw power from USB instead of battery in the latter case)

@Labaman
Copy link

Labaman commented Sep 7, 2022

@DanielOgorchock I'm afraid not. Well, or the effect is insignificant.
I tested on Yuzu + Super Mario Oddesey with vibration intensity 100%, 50%, 40% and 30% - the controller still disconnects. I did not notice any noticeable difference in the frequency of controller disconnects.
The most interesting thing is that on Windows with the same controller on the same Bluetooth adapter - a similar problem is not observed.

@nfp0
Copy link

nfp0 commented Sep 7, 2022

@Labaman And is the perceived rumble intensity on Yuzu the same between Windows and Linux?

@Labaman
Copy link

Labaman commented Sep 14, 2022

@nfp0 yep.
@DanielOgorchock It is highly unlikely that it is related to the USB power supply, with a wired connection:
Did the following test: connected an external charger to the Pro Contronller - same result - controller disconnects when vibration is on.

@a-priestley
Copy link

I think it may also have to do with gyro. After turning rumble and haptic feedback off, it still happens. But it seems to correlate with gyro use. I really think it is the bluetooth stack though, and not hid_nintendo, because I can blacklist the module, passing the responsibility to steam, and it still occurs. Every time it does, I get:

Bluetooth: Frame is too long (len 54, expected len 51)

I think it might go deeper than steam input or hid_nintendo

@nfp0
Copy link

nfp0 commented Oct 29, 2022

I really think it is the bluetooth stack though, and not hid_nintendo, because I can blacklist the module, passing the responsibility to steam, and it still occurs.

Interesting... If that's the case then it should not be hid_nintendo. I'm gonna try and test the same way you did.

@a-priestley
Copy link

I really think it is the bluetooth stack though, and not hid_nintendo, because I can blacklist the module, passing the responsibility to steam, and it still occurs.

Interesting... If that's the case then it should not be hid_nintendo. I'm gonna try and test the same way you did.

I don't think I blacklisted the module properly. It was still being loaded with the kernel, but after (I think) solving that, rumble off + haptics off in Steam, I'm not having the issue any longer. Gyro seems to be fine.
This is a really inconsistent issue though in my experience so I can't be sure about any of this.

@nfp0
Copy link

nfp0 commented Oct 31, 2022

Bluetooth: Frame is too long (len 54, expected len 51)

@a-priestley Where are you getting this error message? I've checked the logs from bluetooth.service but I don't see it anywhere when the controller disconnects.

@a-priestley
Copy link

Bluetooth: Frame is too long (len 54, expected len 51)

@a-priestley Where are you getting this error message? I've checked the logs from bluetooth.service but I don't see it anywhere when the controller disconnects.

journalctl prints it out.

@psycho-driver
Copy link

psycho-driver commented Jul 27, 2023 via email

@nfp0
Copy link

nfp0 commented Jul 28, 2023

@psycho-driver It definitely had problems before, yes. If you do a search online, there's lots of people complaining about the Pro Controller disconnecting on the Steam Deck.

You think it's fixed now?

I remember someone mentioning here that Steam uses SDL, so shouldn't the fix be visible here in the SDL repository?
https://github.com/libsdl-org/SDL/blob/main/src/joystick/hidapi/SDL_hidapi_switch.c#L53

@TriVoxel
Copy link

Just going to add my experiences here.

I've observed my (nearly brand new) controller working perfectly on macOS and a real Switch without problems, so I know it is good hardware. On Linux, indeed it will disconnect within a few minutes usually, sometimes multiple times in a row. I am not sure of using multiple controllers, or especially Switch controllers, makes a difference, I only have the one Switch controller and often several Wii U controllers connected. I don't think I've noticed a difference when having Wii U controllers connected via BT, so perhaps it is the driver running two Switch protocols at once which is problematic?

I wouldn't entirely discount the Switch controller hw as problematic, though. I haven't had any problems with bluetooth controllers on Linux for years. I've had success with PlayStation 3-5 controllers, Wiimotes, Wii U Pro Controllers, Xbox Series, etc. Of all my BT controllers, the Switch is the only one which is problematic. And it isn't just Linux which suffers with supporting this device. Here is an issue from BlueRetro, an open source controller firmware which allows hardware to be built that facilitates using modern Bluetooth controllers on retro game consoles. I ran into this issue using a Power-A GameCube style controller for Switch, Bluetooth using the Switch protocol. Their software also has major issues with supporting this hardware, and it doesn't have rumble either. I suspect they have problems with rumble and so opted to disable it. I'm not entirely sure what software BlueRetro uses, but it's a much smaller program than the Linix kernel, and if they share some components with Linux, that would probably be a good place to start looking for this problem. Perhaps there is also something about the Switch's bt protocol that is obfuscated somehow? I would not put it past Nintendo to intentionally design an anti open software controller in this day and age...

@nfp0
Copy link

nfp0 commented Aug 17, 2023

@TriVoxel Interesting. I'll subscribe to that issue to see what they changed if it gets fixed.

@andsouto
Copy link

andsouto commented Aug 22, 2023

I have a Pro Controller (with original firmware as I don't have a switch to update it) and it also suffers of the same disconnection issues that are described here when using rumble. Later I bought a [GuliKit KingKong 2 Controller])https://www.gulikit.com/productinfo/828615.html) and although it exposed itself using the switch protocol and uses also this driver in Linux, no disconnection occurs. So I guess something "special" has to be in the controller itself...

@DanielOgorchock
Copy link
Owner

DanielOgorchock commented Nov 26, 2023

I've been digging into these bluetooth issues more, and I may have stumbled across a way to improve reliability without allowing rumble quality to suffer.

I'd appreciate if anyone else is able to give this a try to see if it improves things for them.

First, to properly test, it's required to modify the hid-nintendo driver slightly. These changes will revert the driver to a state where it attempts to match USB rumble performance for bluetooth controllers:

  1. Set JC_SUBCMD_VALID_DELTA_REQ equal to 0 (disables the primary disconnect workaround currently used by the driver).
  2. Set JC_SUBCMD_RATE_LIMITER_BT_MS to 20 (matching the USB rate limiter values).
  3. Search for the only msleep call in the driver, and comment it out.

Now I have been testing 2 bluetooth-related tweaks.

The first one I'm not so sure if it actually matters, but it shouldn't hurt. I thought I saw more disconnects without it, but that may have been pure chance.

Edit the bluez main configuration file: /etc/bluetooth/main.conf
You should see a line commented out with "LinkSupervisionTimeout". Uncomment it, and set it to:

LinkSupervisionTimeout=3200

You'll see two lines related to min/max sniff intervals. Uncomment them, and set them to the below values:

MinSniffInterval=6
MaxSniffInterval=6

Frankly, I'm not sure if these make any real difference when factoring in the next step using hcitool...

Be sure to restart bluez (systemctl restart bluetooth) and then reconnect your usb dongle.

Now, after you connect your controller, and the hid-nintendo driver probes, check dmesg output to see your controller's MAC address.

Now for the step which I can tell definitely improves reliability. Make sure that you have hcitool installed. We're going to use it to disable BT sniff mode with the controller. I'm not sure how drastically this will impact battery life, since from what I understand this will basically keep bluetooth constantly in active mode.

Observe the current link policy used with the connected controller:

hcitool lp <your_controller_mac_string>

You should see this:

Link policy settings: RSWITCH HOLD SNIFF PARK

Now, disable SNIFF functionality like so:

hcitool lp <your_controller_mac_string> RSWITCH,HOLD,PARK

Now, running hcitool lp <your_controller_mac_string> should yield:

Link policy settings: RSWITCH HOLD PARK

Note that the link policy needs to be set again each time the controller is reconnected.
In my stress testing (mario kart on yuzu is my go-to), I'm no longer seeing pro controller disconnects, and the rumble performance is FAR better than the in-kernel workaround (not as good as USB due to apparent packet drops, but pretty close).

I do still get disconnects when using both joycons. I think a single usb bt adapter just isn't good enough typically to handle multiple connected controllers while using rumble.

I think a good compromise may be to expose those in-kernel driver rate limit definitions as module params. That way they can default to something conservative, but someone using a single controller per BT adapter can tweak them to be more performant.

Please let me know if anyone else is able to reproduce my results. If it's consistent, we can figure out a way to try applying the link policy tweak automatically (maybe udev rules, as part of joycond, or maybe even a bluez plugin). I suppose we also would need to figure out the battery life impact.

EDIT:
Honestly, I'm not sure anymore. Sometimes the controller just really wants to disconnect anyway, even with these tweaks. The BT connection just isn't stable. I'm pretty sure this is an improvement in performance though, so it'd be good for others to try validating still.

EDIT 2:
Added one more thing to experiment with in the bluez conf (might just be random chance that I saw improvement with it though)

@benjamimgois
Copy link

benjamimgois commented Nov 27, 2023

@DanielOgorchock since i don't know how to modify the driver, i tried the change in bluez maind config file. And i still got disconects. Some observations that might be usefull to you:

1- I'm using the original joycons
2- It's much more common that the disconection occurs on the righ joycon, it's very rare to have a disconection on the left one.
3- The right joycon seems to drain a lot more battery, since it alway dryout first.
4- This isn't a hardware issue, since i replaced the unit that i bought from amazon the first time i noticed the disconections (also the righ one had a worse time).
5- Here is the dmesg since i connect the joycons on yuzu until the right one disconects https://pastecode.dev/s/SvARPSLO

Let me know if there's any other thing i can do.

@nfp0
Copy link

nfp0 commented Nov 27, 2023

@DanielOgorchock Good to see you back on this issue! 🙂
I'll give this a try as soon as I can.

@benjamimgois If the disconnections occur much more frequently on the right joycon, could this be related to the joycon's NFC or IR features? The Pro Controller also has NFC functionality.

@nfp0
Copy link

nfp0 commented Nov 28, 2023

@DanielOgorchock I'm sorry, but even after following your instructions, I got disconnects after 1 or 2 minutes.

For convenience (and because I don't know any other way to test it), I'm using this repo as a base, with the hid-nintendo.c file from your repo. (Please tell me if I'm doing it wrong or if there's a more correct or convenient way to test.)

The code changes you suggested indeed make the rumble quality excelent, but changing the link policy and BlueZ config didn't seem to help.

I still have the feeling the problem is in the Bluetooth stack because of what I mentioned (about there not being a connection time-out) a few post back here.

Shouldn't we open an issue with the BlueZ folk? Or perhaps is an issue open already?

@benjamimgois
Copy link

benjamimgois commented Nov 28, 2023

@benjamimgois If the disconnections occur much more frequently on the right joycon, could this be related to the joycon's NFC or IR features? The Pro Controller also has NFC functionality.

I haven't thought about that... it's a good point. Any idea how nfc is handle on the kernel ? I'm not sure the problem is with the bluetooth stack, since i use a xbox-series controller over bluetooth and the connection is perfect.

I tracked the guy that reverse enginered the joycon protocol, maybe he might be able to help in this issue.
https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering

There's also a software that emulated the switch controller over bluetooth. I don't have the expertise to analyse this, but maybe someone here can.
https://github.com/mart1nro/joycontrol

@TriVoxel
Copy link

TriVoxel commented Nov 28, 2023

The 8BitDo Pro controller, and the GuliKit pro controller have no connection issues in Switch Bluetooth mode. Neither have NFC. I think the Power A GameCube wireless controller might not have the disconnection issues either, at least not in relation to rumble. Anyone needing an NFC reader would be better off getting a dedicated device.

@andsouto
Copy link

Gulikit KingKong 2 (NS08) doesn't have NFC and I can assure it perfectly works in switch mode via bluetooth using vibration. You can even play mario kart in Yuzu without a disconnection.

It would be interesting knowing if the GuliKit KingKong 2 Pro (NS09) has disconnections as it seems to support NFC (it lists amibo support -> https://www.gulikit.com/productinfo/737791.html)

@nfp0
Copy link

nfp0 commented Nov 28, 2023

@benjamimgois

I haven't thought about that... it's a good point. Any idea how nfc is handle on the kernel ?

I don't think NFC is ever enabled by this driver.
I've also tested disabling the IMU by removing the joycon_enable_imu call, but the result was the same.
I checked on btmon that indeed the IMU was not sending any info. Even though the Bluetooth packet lenght was still the same (50), but filled with zeroes on the IMU section.

I'm not sure the problem is with the bluetooth stack, since i use a xbox-series controller over bluetooth and the connection is perfect.

Sure, all other controllers work fine, but I find it strange that the Bluetooth stack detects the disconnection instantaneously with no timeout, contrary to what happens when you press the sync button to turn the controller off, where the controller simply silences itself completely with no disconnect message, causing a timeout after 10 or so seconds.
So, how would the BT stack know that the controller crashed?
You can check this behavior with btmon.

I tracked the guy that reverse enginered the joycon protocol, maybe he might be able to help in this issue.
https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering

I've sent him an email a few months ago to try and get him to help on this issue, but got no answer. 🙁

@DanielOgorchock I've enabled debug mode on BlueZ and captured the output of the disconnection.
Not sure if this helps, but here goes:

kernel: nintendo 0005:057E:2009.001B: compensating for 4 dropped IMU reports
kernel: nintendo 0005:057E:2009.001B: delta=60 avg_delta=11
kernel: nintendo 0005:057E:2009.001B: compensating for 4 dropped IMU reports
kernel: nintendo 0005:057E:2009.001B: delta=60 avg_delta=11
bluetoothd[67411]: src/shared/mgmt.c:can_read_data() [0x0000] event 0x000c
bluetoothd[67411]: src/adapter.c:dev_disconnected() Device 98:B6:E9:3E:FB:16 disconnected, reason 0
bluetoothd[67411]: src/adapter.c:adapter_remove_connection()
bluetoothd[67411]: plugins/policy.c:disconnect_cb() reason 0
bluetoothd[67411]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr 98:B6:E9:3E:FB:16 type 0 status 0xe
bluetoothd[67411]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
bluetoothd[67411]: src/device.c:device_bonding_failed() status 14
bluetoothd[67411]: src/adapter.c:resume_discovery()
kernel: nintendo 0005:057E:2009.001B: timeout waiting for input report
bluetoothd[67411]: profiles/input/device.c:ctrl_watch_cb() Device 98:B6:E9:3E:FB:16 disconnected
bluetoothd[67411]: profiles/input/device.c:intr_watch_cb() Device 98:B6:E9:3E:FB:16 disconnected
bluetoothd[67411]: src/service.c:change_state() 0x55cf23a065b0: device 98:B6:E9:3E:FB:16 profile input-hid state changed: connected -> disconnected (0)
bluetoothd[67411]: profiles/input/device.c:input_device_enter_reconnect_mode() path=/org/bluez/hci0/dev_98_B6_E9_3E_FB_16 reconnect_mode=device

@Readek
Copy link

Readek commented Nov 30, 2023

I've always had Joycon disconnects when playing on Yuzu, Ring Fit Adventure (a game that heavily uses rumble). Since disconnecting the joycon mid-emulation meant that the ring connection would be broken until game restart, this made it unplayable, so I switched to Windows, where I never got disconnects, until I had some other driver issues there.

Then I switched to playing on Steam Deck, where the game kinda ran ok. Surprisingly, I never had joycon disconnects there? Though, very rarely, I would lose connection with the ring, so it could be likely that the joycon disconnected and reconnected while I wasn't looking, since on the SD it will reconnect 75% of the time without needing to repair the controllers, something that I never managed to do on my desktop.

But recently, the SD got a massive update, that introduced a new issue (that was fixed months ago on my desktop) where the entire system will crash when connecting a second joycon. So I went back to my desktop to see if things improved, and sadly I got a right joycon disconnect about 10 minutes after game start.

It is as @benjamimgois said, the right joycon will almost always disconnect first, and its battery will be drained much faster than the left one (this also happened on the SD).

@nfp0
Copy link

nfp0 commented Nov 30, 2023

I'm currently using NXBT to simulate a Pro Controller from the computer side and I'm snooping on the Switch <-> Pro Controller conversation to see if I understand what the driver does different than the console to cause the disconnections.
I'll report back if I find anything noteworthy.

@Readek

since on the SD it will reconnect 75% of the time without needing to repair the controllers, something that I never managed to do on my desktop.

I also had this problem, where I always needed to put the controllers in pair mode to be able to reconnect even though they were paired already.
I found out just yesterday that you can set FastConnectable = true on /etc/bluetooth/main.conf or your user config file to solve that issue. Now the controllers connect instantaneously.
It might come at the cost of higher power consumption on your Bluetooth dongle/card though.

@nfp0
Copy link

nfp0 commented Dec 1, 2023

I'm back with some curious observations.

As I said, I've setup NXBT and observed what the Switch does different than hid_nintendo. I've analyzed the traffic on Wireshark.
This was with some limitations, as NXBT only simulates controller reports at a rate of 15Hz.

I've tried a few things with no luck, but found some more interesting stuff I haven't tried anything against because I'm not sure how to do it, as I'm not well versed in C.

First, here's the sequence of subcommands sent by the Switch console:

02	Request device info
08	Set shipment low power state
10	SPI flash read
10	SPI flash read
03 30	Enable Full mode (has rumble data on it)	
04	Trigger buttons elapsed time	
10	SPI flash read
10	SPI flash read
	a rumble command
10	SPI flash read
10	SPI flash read
10	SPI flash read
	a rumble command
40 01	Enable IMU
48 01	Enable vibration
	a rumble command
21 21	Set NFC/IR MCU configuration
30	Set player lights
	a rumble command
22 01	Set NFC/IR MCU state

And here's hid_nintendo's sequence:

80 02	(USB?)
80 02	(USB?)
10	SPI flash read
10	SPI flash read
10	SPI flash read
10	SPI flash read
10	SPI flash read
10	SPI flash read
03 30	Enable Full mode (no rumble data)
48 01	Enable vibration
40 01	Enable IMU
02	Request device info
30	Set player lights
38 01	Set HOME Light

Of note is the fact that the Switch console:

  1. Sends a Set shipment low power state. I don't know what for.
  2. Sends rumble data inside the Enable Full mode subcommand.
  3. Sends aTrigger buttons elapsed time subcommand.
  4. Sends a Set NFC/IR MCU configuration subcommand.
  5. Sends a Set NFC/IR MCU state subcommand.
  6. Sends a few rumble commands in the middle of the sequence.

I think it would be worthwhile trying to replicate this sequence.

I'm attaching here the full Switch console Wireshark capture:
Switch-NXBT.log
(Had to switch the original .pcapng extension to .log because Github doesn't allow it.)

There should be a few non-silent rumble commands in there, as I've tried causing rumble in-game, but I don't see them anywhere in the capture. I'm not sure why. Maybe the game did not generate the rumble I was expecting. I have to try it again.

Now, I wish I had a way to sniff the traffic between a real Pro Con and the Switch console, instead of having to use NXBT. NXBT has a few issues and I'm not sure if the Switch is sending rumble commands to the simulated controller, other than the silent ones.

Other interesting things I found out but haven't tried anything about them:

  1. I've noticed the Pro Controller reports at about 55~70Hz, both at full report mode (0x30) and non-full mode (0x3f).
    Here is mentioned the Pro Con should report at 120Hz when in full report mode.
    Does this perhaps mean that the full mode is not being correctly initialized?

  2. The time delta between hid_nintendo packages is very inconsistent when sending rumble commands and JC_SUBCMD_TX_OFFSET_MS does not seem like it's being honored.
    I'm not sure if I can trust the Wireshark's timestamps, but I've seen a lot of deltas as low as 0.000001 seconds, and even some negative deltas! Not sure what to make of that.

  3. The Switch console seems to send a silent rumble report about every 4 seconds. hid_nintendo does not.

  4. The Switch console's subcommands have a fixed size, padded with zeroes. hid_nintendo trims the zeroes and sends messages with variable length.

@DanielOgorchock Can you please take a look at the above ones? I'm not sure how to deal with those.

Things I've tried:

  1. I've made it so that rumble commands only be sent if the Vibrator input report (byte 12 of the standard report as described here) is between the most common values of 0x09 and 0x0c.
    I'm not sure what this byte is for, but it seems to deviate from those values occasionally, so I blocked rumble packets when outside that interval.
    No luck. Disconnections persisted.

  2. hid_nintendo sends 2 USB related subcommands (0x80) even when using the controller in Bluetooth mode.
    I figured maybe this was a mistake and removed the part of the code that does that to test out.
    It stopped sending the USB subcommands, but the disconnect problem persisted.

  3. The Switch and hid_nintendo send the enable vibration and enable IMU in a reversed order from each other, so I inverted the order on hid_nintendo.
    No luck.

@DanielOgorchock
Copy link
Owner

I'm back with some curious observations.

As I said, I've setup NXBT and observed what the Switch does different than hid_nintendo. I've analyzed the traffic on Wireshark. This was with some limitations, as NXBT only simulates controller reports at a rate of 15Hz.

I've tried a few things with no luck, but found some more interesting stuff I haven't tried anything against because I'm not sure how to do it, as I'm not well versed in C.

First, here's the sequence of subcommands sent by the Switch console:

02	Request device info
08	Set shipment low power state
10	SPI flash read
10	SPI flash read
03 30	Enable Full mode (has rumble data on it)	
04	Trigger buttons elapsed time	
10	SPI flash read
10	SPI flash read
	a rumble command
10	SPI flash read
10	SPI flash read
10	SPI flash read
	a rumble command
40 01	Enable IMU
48 01	Enable vibration
	a rumble command
21 21	Set NFC/IR MCU configuration
30	Set player lights
	a rumble command
22 01	Set NFC/IR MCU state

And here's hid_nintendo's sequence:

80 02	(USB?)
80 02	(USB?)
10	SPI flash read
10	SPI flash read
10	SPI flash read
10	SPI flash read
10	SPI flash read
10	SPI flash read
03 30	Enable Full mode (no rumble data)
48 01	Enable vibration
40 01	Enable IMU
02	Request device info
30	Set player lights
38 01	Set HOME Light

Of note is the fact that the Switch console:

1. Sends a `Set shipment low power state`. I don't know what for.

2. Sends rumble data inside the `Enable Full mode` subcommand.

3. Sends a`Trigger buttons elapsed time` subcommand.

4. Sends a `Set NFC/IR MCU configuration` subcommand.

5. Sends a `Set NFC/IR MCU state` subcommand.

6. Sends a few rumble commands in the middle of the sequence.

I think it would be worthwhile trying to replicate this sequence.

I'm attaching here the full Switch console Wireshark capture: Switch-NXBT.log (Had to switch the original .pcapng extension to .log because Github doesn't allow it.)

There should be a few non-silent rumble commands in there, as I've tried causing rumble in-game, but I don't see them anywhere in the capture. I'm not sure why. Maybe the game did not generate the rumble I was expecting. I have to try it again.

Now, I wish I had a way to sniff the traffic between a real Pro Con and the Switch console, instead of having to use NXBT. NXBT has a few issues and I'm not sure if the Switch is sending rumble commands to the simulated controller, other than the silent ones.

Other interesting things I found out but haven't tried anything about them:

1. I've noticed the Pro Controller reports at about 55~70Hz, both at full report mode (0x30) and non-full mode (0x3f).
   [Here](https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/bluetooth_hid_notes.md#input-0x30) is mentioned the Pro Con should report at 120Hz when in full report mode.
   Does this perhaps mean that the full mode is not being correctly initialized?

2. The time delta between hid_nintendo packages is very inconsistent when sending rumble commands and `JC_SUBCMD_TX_OFFSET_MS` does not seem like it's being honored.
   I'm not sure if I can trust the Wireshark's timestamps, but I've seen a lot of deltas as low as 0.000001 seconds, and even some negative deltas! Not sure what to make of that.

3. The Switch console seems to send a silent rumble report about every 4 seconds. hid_nintendo does not.

4. The Switch console's subcommands have a fixed size, padded with zeroes. hid_nintendo trims the zeroes and sends messages with variable length.

@DanielOgorchock Can you please take a look at the above ones? I'm not sure how to deal with those.

Things I've tried:

1. I've made it so that rumble commands only be sent if the Vibrator input report (byte 12 of the standard report as described [here](https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/bluetooth_hid_notes.md#standard-input-report-format)) is between the most common values of `0x09` and `0x0c`.
   I'm not sure what this byte is for, but it seems to deviate from those values occasionally, so I blocked rumble packets when outside that interval.
   No luck. Disconnections persisted.

2. hid_nintendo sends 2 USB related subcommands (`0x80`) even when using the controller in Bluetooth mode.
   I figured maybe this was a mistake and removed the part of the code that does that to test out.
   It stopped sending the USB subcommands, but the disconnect problem persisted.

3. The Switch and hid_nintendo send the enable vibration and enable IMU in a reversed order from each other, so I inverted the order on hid_nintendo.
   No luck.

Thanks, this is really helpful.

If I have some time soon I'll experiment with NXBT as well. I didn't realize it existed.

What I'm really interested in is how the switch console reacts when its rumble packets are lost or discarded in transmit.

I'm also curious if the switch configures the BT controller somehow to never send more than 1 packet per period (e.g. never more than one packet per 15ms). I think a potential source of the disconnect problem could be that the BT controller itself is buffering pending rumble TX packets from hid-nintendo, and if the link has some issues, it may be sending multiple at once (hence the occasional tiny deltas).

@nfp0
Copy link

nfp0 commented Dec 4, 2023

If I have some time soon I'll experiment with NXBT as well. I didn't realize it existed.

@DanielOgorchock I did another capture with NXBT but unfortunately I don't think the Switch console is sending any rumble commands other than the silent ones every 4 seconds.
I get the feeling NXBT is not replying what the console is expecting after a rumble command is sent.
There's also the problem of NXBT only working at a very low frequency (15hz?). But maybe that's because I only managed to get it working using the remote_tui option. The normal TUI was not reading any inputs from my keyboard (maybe because I'm using Wayland), and I couldn't get the web version to work.

There's also another alternative we can use to simulate a Pro Controller: Joycontrol
I'm currently trying to get it to work, but it only connected once and I can't seem to get it to connect again.

I think a potential source of the disconnect problem could be that the BT controller itself is buffering pending rumble TX packets from hid-nintendo, and if the link has some issues, it may be sending multiple at once (hence the occasional tiny deltas).

That's interesting. Could there be any setting on BlueZ that disables buffering?

@nfp0
Copy link

nfp0 commented Dec 4, 2023

@DanielOgorchock I've managed to get Joycontrol to connect once and successfully captured the Switch console rumble conversation! 😃
Not sure how I managed to get it to connect but it might be related to this.

The Wireshark capture:
joycontrol.txt
(Rename it to .pcapng)

Sorry, couldn't capture the initial controller setup this time.
You can observe actual rumble commands starting, for example, at packet nr 144580.

The game sending the rumble is Super Mario Bros Wonder.

My observations:

  1. Rumble commands arrive at about 10~20ms from each other. The strange thing is that they seem to come in pairs (0ms from each other) and the pair has different rumble values.
  2. The console sends silent rumble commands (00 01 40 40 00 01 40 40) every 80~90ms. Not sure if this varies by game.

Even if we don't find a way to control the Bluetooth buffering, I think it would be worthwhile to mimic these conditions, namely the periodic silent rumbles, and see if the controller behaves any better.

@Trippixyz
Copy link

Hi everyone!
I tried to fully read through this long issue but from my observations there still isnt a good fix for this issue(?)

My experience:
I run into a very similar issue when I want to pair any Switch Controller (first or third party) with Linux over bluetooth. Upon connecting for the first time, it partially works. However with an XInput Controller I also dont have any functionality until I turn it off and back on again. However When I tried to do the same with any Switch Controller, I experience a never ending loop of blueman apparently connecting and instantly disconnecting from the controller. This does not freeze blueman but just doesnt end, except the Controller turns off or I manually intercept.

Reproduce:
Honestly I did not really do something different than other people did, who got their Controllers to work fine.
But here is what I did:

  1. Obtained and installed Manjaro XFCE onto my hdd partition (arch).
  2. Installed steam, yuzu, ryujinx, vs code, chrome and various (unrelated(?)) software.
  3. Began to attempt connecting Switch Controllers.

I was informed that Switch Controller support already is in the latest linux kernel. However before that I did try to install dkms-hid-nintendo manually a couple of times. This was redundant and I uninstalled them ever since.

@nfp0
Copy link

nfp0 commented Jan 21, 2024

@Trippixyz I'm sorry but that seems to be a completely different issue than this one.
Maybe we should rename the issue to something like "Pro Controller randomly disconnects during rumble on Bluetooth"

@Trippixyz
Copy link

@nfp0 Whoops now I see. In that case I'll consider opening up a new issue for that!

@addy419
Copy link

addy419 commented Mar 29, 2024

Hi @Trippixyz did you get a solution on that issue. I have the same issue and while searching for a solution, I stumbled upon this thread.

@thebeardedchild
Copy link

Did this issue (the Switch Pro Controller rumble disconnects) ever get fixed? I thought I saw a patch commit to the 6.4 version of the kernel so I was hoping it was fixed (and would eventually hit SteamOS which is what I'm gaming on), but then I saw reports of people saying it was NOT fixed, even on kernel 6.8

@nfp0
Copy link

nfp0 commented Apr 2, 2024

@thebeardedchild It was "fixed" in the sense that it does not disconnect anymore (at least for me), but to achieve that, the rumble quality had to be degraded considerably. On some games I can feel heavy latency on the rumble effect.

@addy419
Copy link

addy419 commented Apr 5, 2024

@thebeardedchild It's weird, because I had the disconnection issue until I connected the pro controller to my switch, then disconnected again and then paired with my linux machine. It has been working well since.

@veldenb
Copy link

veldenb commented Apr 6, 2024

I haven't connected my pro controller to the switch for while, but possibly there is a firmware update for the pro controller that fixes things. Worth a try :)

@benjamimgois
Copy link

Hey guys, i haven't used my joycons in a while. But i just decided to make some tests yesterday and i realised that the disconnect problem doesn't happen to a pair of chinese joycon copycat. It's a very low quality joycon when compared to nintendo original one, but it's recognized by the kernel as a standard joycon device. Everything works, rumble and gyro with no disconnects what so ever

@GTcreyon
Copy link

I have an issue that resembles this one, although might be separate.

When connecting my pro controller over Bluetooth (by holding down the pairing button, pressing Search in Blueman, and double-clicking Pro Controller), it connects fine, after a little bit of light flashing. Input works both with and without Steam running. However, after what seems to be exactly 30 seconds of being connected (I timed it a few times), all the lights turn off and it disconnects. This occurs without rumble being used at all.

dmesg log:

[ 9598.980784] nintendo 0005:057E:2009.002C: unknown main item tag 0x0
[ 9598.981057] nintendo 0005:057E:2009.002C: hidraw6: BLUETOOTH HID v80.01 Gamepad [Pro Controller] on 10:68:38:1d:1f:2d
[ 9599.178485] nintendo 0005:057E:2009.002C: controller MAC = DC:68:EB:3E:61:68
[ 9599.212401] nintendo 0005:057E:2009.002C: using factory cal for left stick
[ 9599.259404] nintendo 0005:057E:2009.002C: using factory cal for right stick
[ 9599.352353] nintendo 0005:057E:2009.002C: using factory cal for IMU
[ 9599.514774] input: Pro Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.0/bluetooth/hci0/hci0:5/0005:057E:2009.002C/input/input111
[ 9599.514942] input: Pro Controller (IMU) as /devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.0/bluetooth/hci0/hci0:5/0005:057E:2009.002C/input/input112
[ 9605.607452] nintendo 0005:057E:2009.002C: joycon_enforce_subcmd_rate: exceeded max attempts
[ 9610.115286] nintendo 0005:057E:2009.002C: compensating for 4 dropped IMU reports
[ 9610.115293] nintendo 0005:057E:2009.002C: delta=64 avg_delta=11
[ 9610.227241] nintendo 0005:057E:2009.002C: compensating for 4 dropped IMU reports
[ 9610.227251] nintendo 0005:057E:2009.002C: delta=64 avg_delta=11
[ 9610.452235] nintendo 0005:057E:2009.002C: compensating for 4 dropped IMU reports
[ 9610.452242] nintendo 0005:057E:2009.002C: delta=63 avg_delta=11
[ 9610.789372] nintendo 0005:057E:2009.002C: compensating for 4 dropped IMU reports
[ 9610.789389] nintendo 0005:057E:2009.002C: delta=62 avg_delta=11
[ 9611.014340] nintendo 0005:057E:2009.002C: compensating for 4 dropped IMU reports
[ 9611.014344] nintendo 0005:057E:2009.002C: delta=61 avg_delta=11
[ 9611.239520] nintendo 0005:057E:2009.002C: compensating for 5 dropped IMU reports
[ 9611.239529] nintendo 0005:057E:2009.002C: delta=74 avg_delta=11
[ 9611.357291] nintendo 0005:057E:2009.002C: compensating for 4 dropped IMU reports
[ 9611.357305] nintendo 0005:057E:2009.002C: delta=68 avg_delta=11
[ 9611.962437] nintendo 0005:057E:2009.002C: joycon_enforce_subcmd_rate: exceeded max attempts
[ 9613.152378] nintendo 0005:057E:2009.002C: compensating for 5 dropped IMU reports
[ 9613.152394] nintendo 0005:057E:2009.002C: delta=74 avg_delta=11
[ 9613.828292] nintendo 0005:057E:2009.002C: compensating for 4 dropped IMU reports
[ 9613.828308] nintendo 0005:057E:2009.002C: delta=65 avg_delta=11
[ 9614.277416] nintendo 0005:057E:2009.002C: compensating for 5 dropped IMU reports
[ 9614.277430] nintendo 0005:057E:2009.002C: delta=74 avg_delta=11
[ 9618.228588] nintendo 0005:057E:2009.002C: joycon_enforce_subcmd_rate: exceeded max attempts
[ 9624.831418] nintendo 0005:057E:2009.002C: compensating for 4 dropped IMU reports
[ 9624.831426] nintendo 0005:057E:2009.002C: delta=65 avg_delta=11

btmgmt tells me my Bluetooth adapter is on v5.3, but the store page for my laptop claims it's v4.2, which is odd.

However! This only occurs when my Bluetooth headset is also connected. Disconnecting it fixes the issue entirely, and the messages about dropped IMU reports and joycon_enforce_subcmd_rate also (mostly) disappear from the log. Rumble does not seem to trigger the issue.

This could be related to a paragraph on this page: https://en-americas-support.nintendo.com/app/answers/detail/a_id/27784/~/unable-to-pair-or-sync-nintendo-switch-pro-controller

When a Bluetooth audio device is connected, no more than two wireless controllers can be connected to the system. Disconnect the Bluetooth audio device in order to connect a third controller.

It's possible that my Bluetooth adapter is just not capable of handling multiple devices in this way, but the precise 30-second disconnect time feels strange for that kind of thing, especially since the controller works fine before the disconnect.

Pairing the gamepad first, then waiting a while, then pairing the headset also seems to work.

I don't know how relevant this information is, and perhaps this should be its own issue report, but maybe it'll be useful.

@nfp0
Copy link

nfp0 commented May 17, 2024

@GTcreyon Yes, that is likely a different issue unrelated to this DKMS. I would check on BlueZ's issues.

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