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

Handling of 0x20d6 xbox one X/S wired gamepads (avoid bursts and depletion of urbs) #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ykpmusicstudio
Copy link

@ykpmusicstudio ykpmusicstudio commented May 11, 2024

Gamepad of brand "under control" remains stuck at first auth handshake. Some occurences of urb depletions due to interrupt out bursts.
Proposal:

  • Delaying dev/input creation after completion of auth handshake
  • Adding automatic acq urb when authenticating at the end of a chunk (some gamepads do not ask for ack but actually needs it to transmit next auth packet)

This PR is not top quality as it still include some delayed work with fixed delays that should ideally be replaced by triggering each transmission stage based on the interrupt out acknowledgement packet from the gamepad (routing protocol.c completion routines to gamepad.c, I guess) but this implies some future planning.

I've noticed that this kind of behavior was already implemented in the dongle.c implementation, maybe some merging is to be done to keep consistency between wired & dongle implementations.

At least, this PR works. Further improvement can be built on this.

Tested with a native Microsoft XBOX One controller for regressions. Seems fine.

Delaying dev/input creation after completion of auth handshake
Adding automatic acq urb when authenticating at the end of a chunk (some gamepads do not ask for ack but actually needs it to transmit next auth packet)
@ykpmusicstudio
Copy link
Author

ykpmusicstudio commented May 17, 2024

Just to make sure, I tried to apply only the forced ack to URB INTERRUPT Chunked messages in gip_process_pkt (protocol.c) but it's clearly not enough. It is needed to complete the auth phase, but the first issue is that the gamepad.c probe sequence seems to flood some gamepads with too many requests at the same time.

When I compare with the behavior in windows, the original gamepad.c driver sends a bursts of message whereas windows driver clearly waits for INTERRUPT OUT acknowledgements from the gamepad device before proceeding to next message.

So I can gladly confirm that all modification included in the PR are needed to have my gamepad working.

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