xpadneo icon indicating copy to clipboard operation
xpadneo copied to clipboard

Prevent Xbox Controller from Auto-Reconnecting After Programmatic Disconnect

Open EnriqueWood opened this issue 7 months ago • 1 comments

Version of xpadneo

Controller Model

  • [ ] Xbox One S controller
  • [ ] Xbox Elite 2 controller
  • [x] Xbox Series X|S controller
  • [ ] Other:

Connection mode

  • [x] Bluetooth connection
  • [ ] USB cable (not yet supported)
  • [ ] Xbox Dongle connection (not yet supported)

Describe your feature request

  • [ ] I'd like to see support for a specific model
  • [ ] I'd like to see support for a specific hardware feature
  • [x] I'd like to see support for a specific software feature

Is your feature request related to a problem? Please describe. Yes. Xbox Bluetooth controllers behave differently from most others when disconnected programmatically—they immediately attempt to reconnect.

This is problematic when implementing automation, such as a triggerhappy shortcut that issues bluetoothctl disconnect $device_address, or when building an idle timeout feature to disconnect unused controllers. While this approach works reliably with PlayStation, 8BitDo, and nearly all non-Xbox controllers, Xbox controllers automatically reconnect, rendering the functionality ineffective.

Worse, if your Bluetooth adapter is configured to wake the system from suspend, the controller’s automatic reconnection can cause an unintended wake-up immediately after suspension.

Describe the solution you’d like When the controller is disconnected via software, it should remain disconnected unless the user explicitly reconnects it (e.g., by pressing the Xbox button).

Describe alternatives you’ve considered Avoiding Xbox controllers altogether. I'd prefer to keep using mine, but this behavior is a significant blocker.

Additional context Tested with Xbox Controller Model 1708.

EnriqueWood avatar May 17 '25 14:05 EnriqueWood

We cannot control power behavior with Xbox controllers over HID: The GIP power-off command is not available in HID protocol. Trying to turn the controller off by disconnecting it, is not expected behavior for Xbox controllers: They auto-reconnect automatically. You need to send and explicit power-off command, which we can't with HID.

xpadneo even can't do anything here: It doesn't know about Bluetooth at all - it's just a HID driver. With future development, I'm looking into supporting the GIP protocol instead (this only works via USB or the Xbox dongle).

If you want to turn the controller off, you need to assign each controller a dedicated Bluetooth radio, and turn Bluetooth radio off instead. Then, after 30s, the controller should turn off.

The controller will also turn off if it idles for 15 minutes.

Everything you ask for can only work with the GIP protocol which Bluetooth doesn't offer.

kakra avatar May 17 '25 17:05 kakra