benkuper / Chataigne

Artist-friendly Modular Machine for Art and Technology
https://benjamin.kuperberg.fr/chataigne
GNU General Public License v3.0
1.11k stars 55 forks source link

Wireless Xbox 360 gamepad sometimes fails to reconnect in Windows 11 #228

Open Djhg2000 opened 2 months ago

Djhg2000 commented 2 months ago

Environment

Describe the bug A wireless Xbox 360 controller configured in the Gamepad module sometimes fails to reconnect on Windows 11. It doesn't always happen and seems to depend on how long the controller was disconnected for. Also the controller will be missing from the dropdown in the Gamepad module until Chataigne is restarted.

The bug is not reproducible in Linux (Debian Trixie/Sid), the same controller always successfully reconnects. I only tested with reasonable amounts of time and most of it accidentally but at least half an hour.

To Reproduce Steps to reproduce the behavior:

  1. Add the Gamepad module
  2. Select the wireless Xbox 360 controller
  3. Confirm the connection by looking at the live values
  4. Take out the batteries or move far away for longer than a few seconds (maybe a minute?)
  5. Put the batteries back in and power on the controller or move back within range again
  6. Chataigne will now have a chance of being unable to detect the controller at all

Expected behavior I would expect the controller to reconnect. For short interruptions (like quickly swapping batteries) it usually does reconnect.

Additional context It seems to me like the handle for the particular controller gets invalidated by Windows 11 and it's necessary to reproble the XInput API for new controllers. I'm not familiar with the API itself and especially not in Windows 11, but that's the impression I'm getting.

I have not tested if the bug occurs with wired controllers as well but I can test that next time I have access to the Windows 11 machine.

benkuper commented 8 hours ago

Hello, do you still have the problem ? It seems that it's OS dependant... are there other software on windows that behave the same or differently ?