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
Games: Stable player assignment #23482
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
garbear
added
Type: Fix
non-breaking change which fixes an issue
Backport: Needed
Component: Input
Component: Games
v21 Omega
labels
Jul 6, 2023
Rechi
previously requested changes
Jul 7, 2023
Example log output is: debug <general>: ===== Peripheral Map ===== debug <general>: /1/game.controller.snes.mouse: debug <general>: peripheral.joystick/0 [Xbox 360-compatible controller] debug <general>: debug <general>: /2/game.controller.snes.multitap/1/game.controller.snes: debug <general>: peripheral.joystick/1 [Xbox 360-compatible controller] debug <general>: debug <general>: /2/game.controller.snes.multitap/2/game.controller.snes: debug <general>: peripheral.joystick/2 [Xbox 360-compatible controller] debug <general>: debug <general>: /2/game.controller.snes.multitap/3/game.controller.snes: debug <general>: peripheral.joystick/3 [Xbox 360-compatible controller] debug <general>: debug <general>: /2/game.controller.snes.multitap/4/game.controller.snes: debug <general>: peripheral.joystick/4 [Wireless Controller] debug <general>: ==========================
garbear
changed the title
Games: Sort controllers by last activation time
Games: Stable player assignment
Jul 9, 2023
I've pushed a new commit. It accomplishes a long-time goal of stable player sorting. When ports or controllers change around, players maintain their port. Even if multitaps are swapped out, when they're swapped back in, the port is remembered. I'll wait for a confirmation that Android joysticks still work with the stable player sorting. |
Android joysticks confirmed working, will merge when I'm ready. |
7 tasks
8 tasks
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Backport: Done
Component: Games
Component: Input
Type: Fix
non-breaking change which fixes an issue
v21 Omega
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In #22036, I pulled in some work from my Player Manager, but unintentionally pulled in an unfinished change that causes a regression in v20.
The change in behavior has to do with how players are sorted into controller ports. In v19, the most recently active controller got port 1, etc. However, in the refactor, new, unfinished behavior was introduced, and the behavior contained an error that caused joysticks to never be sorted; they're simply given a port depending on when they were detected by the OS.
As a result, on some Android boxes, "virtual" joysticks were now sorted in front of legit joysticks, causing input to be dropped.
This PR restores the old behavior of sorting ports by last activated joystick. It's a stop gap measure to solve the phantom joystick problem until the Player Manager is ready to allow control over port mappings.
I also added new logging when the port mapping changes to help debug future issues.
Motivation and context
Reported several places, most recently here: https://forum.kodi.tv/showthread.php?tid=373412
How has this been tested?
Test builds available here: https://github.com/garbear/xbmc/releases
Example logging with 5 controllers connected and a Multitap in port 2:
Example logging when the Multitap in port 2 is changed to a SNES controller:
I also created a stripped-down version of the Player manager that I call "View Players" that simply allows you to view player mappings without changing anything:
The View Players window is included in my test builds, but not in this PR.
What is the effect on users?
Types of change