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

New information about bluetooth pair issues on Raspberry Pi #449

Open
lukakama opened this issue Jan 3, 2024 · 4 comments
Open

New information about bluetooth pair issues on Raspberry Pi #449

lukakama opened this issue Jan 3, 2024 · 4 comments
Labels
0 | type: enhancement New feature or request 0 | type: hardware support Support third-party hardware and clones
Milestone

Comments

@lukakama
Copy link

lukakama commented Jan 3, 2024

Hi,
I would like to share that I found a way to pass the initial controller pairing issue at least some type of controllers on a Raspberry Pi 3b+.

Background: I have two wireless controllers, one old Xbox One S (USB type A and missing share button) and a newer Xbox Series X one (with share button and USB type C connector). Both controllers has been updated with latest firmwares. The Raspberry is a 3b+ freshly installed with "bullseye" Lite OS on 12-2023, using the built-in adapter with just "disable_ertm" enabled. The Xbox Series X controller paired without much issues (it struggled to connect the first time, but after a bunch of time it paired successfully), but the Xbox One S one persistently refused to pair (bluetoothctl was reporting a connected status, but he controller was still in pairing mode with the led blinking).

To successfully pair the Xbox One S controller I had to:

  1. Set the controller into pairing mode
  2. Perform che standard pairing procedure on the Raspberry using "bluetoothctl"
  3. Once connected with the controller still in pairing mode, disconnect the controller issuing a "disconnect XX:XX:XX:XX:XX" command on "bluetoothctl"
  4. Open the "/var/lib/bluetooth/[ADAPTER_MAC]/[XBOX_CONTROLLER_MAC]/info" file (device metadata file of Bluez)
  5. Add the following section to the file (copied from the "info" file of the Xbox Series X controller):
[ConnectionParameters]
MinInterval=6
MaxInterval=6
Latency=0
Timeout=300
  1. Save and close the file
  2. Re-connect to the controller using "bluetoothctl" (this time the controller successfully moved to the "connected" mode exiting the "pairing" mode without issues) and completing the pairing procedure.

Probably it would works also creating the file manually before the first pairing attempt, but I don't know if the format would be different on different versions of Bluez (I didn't found much info about these files).

Maybe this could be added to the Troubleshooting section. I hope that this could be useful to someone.

@kakra
Copy link
Collaborator

kakra commented Jan 3, 2024

Interesting that copying the interval and latency settings fixes things. This still looks like bluez doesn't propagate these attributes properly to the connection. FWIW, modifying these parameters has been part of the xpadneo documentation but we use a bit more relaxed values so Bluetooth mice and other peripherals would still work correctly.

With fairly recent versions of the kernel (everything from the last 24 months) you should not use disable_ertm any longer because it can cause sticky button inputs or disconnects with rumble.

I'll leave this open to review it and merge into documentation. Please don't close.

@kakra kakra added 0 | type: enhancement New feature or request 0 | type: hardware support Support third-party hardware and clones labels Jan 3, 2024
@kakra kakra added this to the v0.10 milestone Jan 3, 2024
@lukakama
Copy link
Author

lukakama commented Jan 3, 2024

FWIW, modifying these parameters has been part of the xpadneo documentation but we use a bit more relaxed values so Bluetooth mice and other peripherals would still work correctly.

Yeah, I was trying to apply them globally, but Bluez config files of Raspberry bullseye are a bit misleading (placeholders into configuration files are not aligned to actual Bluez used ones) and I had difficulties to apply them.
Anyway, configuring them for the specific device (as Bluez did by itself with the newer controller, which probably send them during the pairing process), instead of globally, should prevents any possible issue with other devices.

@lukakama
Copy link
Author

lukakama commented Jan 3, 2024

With fairly recent versions of the kernel (everything from the last 24 months) you should not use disable_ertm any longer because it can cause sticky button inputs or disconnects with rumble.

Ah, wasn't aware of that. I will disable it. Thanks for the tip :).

@kakra kakra modified the milestones: v0.10, v0.11 Mar 4, 2024
@kakra
Copy link
Collaborator

kakra commented Mar 4, 2024

Deferring to v0.11 to investigate RPi compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 | type: enhancement New feature or request 0 | type: hardware support Support third-party hardware and clones
Projects
Status: Raspberry Pi BT issues
Development

No branches or pull requests

2 participants