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

fix: handshake stalls on PDP/A controllers (undercontrol and some other noname brands) #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ykpmusicstudio
Copy link

@ykpmusicstudio ykpmusicstudio commented Sep 15, 2024

Added an authenticated callback to gamepad device that delays rumble/input initialization after authentication is finished.

bus/protocol: add handling of final ACME on chunked reliable messages (as per microsoft spec)
auth/gamepad: add authenticated event to delay input initialization after gamepad has successfully finished its handshake
wired: increase USB DATA URB to 12 to prevent starving in key exchanges during handshake (urb depletions for less than 12)
.gitignore: remove Microsoft spec from git repo

…chunks and rumble initialization too early (before handshake is properly handled)

Added an authenticated callback to gamepad device that triggers rumble/input initialization.

TODO: handle authentication failure in newly created authenticated callback in gamepad.

bus/protocol: add handling of final ACME on chunked reliable messages
auth/gamepad: add authenticated event to enable input only when gamepad has finished its handshake
wired: increase USB DATA URB to 12 to prevent starving in key exchanges during handshake
.gitignore: remove Microsoft spec from git repo
@ykpmusicstudio
Copy link
Author

ykpmusicstudio commented Sep 15, 2024

This is a pull request for the issue I had with a generic gamepad (id 20d6/a01a) which failed during handshake.
After reviewing Microsoft spec, protocol.c was missing an automatic ACME on last message of chunked transmissions.

When I corrected that behavior I had ENOSPC errors due to all URBs beeing consumed in the pub key exchange that took more than the initial 8. Increased to 12.

These controller abort current command when submitted with a new one, so I needed to delay rumble initialization & input handling initialization after the handshake phase is done otherwise the handshake would break down.

This is a cleaner PR than the initial one submitted a few month earlier.

@ykpmusicstudio ykpmusicstudio changed the title Fixes bad handshake on PDP/A controllers due to missing ACME on last chunks… fix: handshake stalls on PDP/A controllers (undercontrol and some other noname brands) Nov 11, 2024
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

Successfully merging this pull request may close these issues.

1 participant