-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Android joystick fixes #24604
Android joystick fixes #24604
Conversation
Rapid input is dropped when buttonmapping, because some controllers send multiple events per button press with different button IDs. However, on the PS4 controller, two events from the same button are sent, one analog and one digital. Because the digital one is ignored, we shouldn't consider the analog event a case of rapid input.
Likely due to a past format with clang-format that didn't properly de-indent the comment blocks.
AKEYCODE_PROFILE_SWITCH is now the final key in keys.h as of NDK 21.4.7075529.
7da191b
to
3f47f5a
Compare
PR updated. I added a nifty feature, because Android maps most controllers, we initialize the buttonmap with Android's mapping, so controllers work out of the box in the UI and in games without having to map it first. As the PR changes the button counts, it'll wipe out all existing buttonmaps, so it's nice to have the buttonmap regenerated without temporarily losing functionality of the controller. I'm also getting reports that mapped controllers are working as they should. The only problem controllers left are ones that Android can't map. We're hunting down that bug in garbear#137. |
3f47f5a
to
4ebfe84
Compare
4ebfe84
to
95ca75a
Compare
We fixed the last problem I've come across over at garbear#137. The problem was that Android was reporting the button events as coming from a KEYBOARD source. I added a check for this, and now all keyboard keys will first go to the joystick handler, but this should be safe because it mostly ignores non-button keycodes, and the ones it doesn't ignore are automatically mapped to controller actions. |
I think this is ready for merge, with the only outstanding problem being some broken input on a Firestick (which I don't think worked before). I've prepared a backport PR, which I'll open after this is merged. Then hopefully we can get 20.4 out soon to fix controllers for most users. |
I can see that the Android joystick fixes have been reverted. Does that mean that these will not make version 21 at all? Its probably not too representative, but I've been using the build with the fixes for 2 weeks without any problems :) |
I did a mass-revert for v21 because I ran out of Kodi time and have to focus on other projects. Not sure when I can return to Kodi (probably some weekend in the near term) but, as fixes, even if I miss the v21.0 point release, fixes in v22 can be backported to v21. And even if the v21 release branch takes a while to accrue joystick fixes, I'll keep the current ones in my test builds for you and others that don't need remotes. |
This would have been my question whether your will keep this in your test builds. I mean I was prepared to compile my own with your fixes against the main 21 branch but clearly its easier if I dont have to do it :) thanks |
I went through all changes with a fine-toothed comb and broke out most into separate PRs for a much safer process:
The only "unsafe" commit left was the one that touched |
Description
This PR introduces fixes for most of the Android bugs demonstrated in the last few months. The fixes are as follows:
I also added functionality to automatically configure controllers based on the buttonmaps provided by Android (e.g. android knows which button belongs to
AKEYCODE_BUTTON_A
).Note that due to the improved button and axis handling, most Android controllers will need to be remapped. I've provided new mappings for most of our existing buttonmaps in xbmc/peripheral.joystick#297.I also added a feature that automatically maps controllers on Android, so we don't need new buttonmaps anymore.
Motivation and context
Tracking thread: https://forum.kodi.tv/showthread.php?tid=376084
Fixes #24502.
How has this been tested?
Included in my latest round of test builds: https://github.com/garbear/xbmc/releases/tag/retroplayer-21beta2-20240129
Mapping PS4 trigger
See buttonmaps in xbmc/peripheral.joystick#297 for successful map:
Improved logging
garbear#137 shows buttonmapping the D-pad with improved logging (presence of
semiaxis -1
andsemiaxis +0
):Missing keyboard keys
Keys from newer NDK now appear for my media center keyboard:
Generic joysticks that Android can't map
TODO: Report on fix in tracking thread
Problematic controller from debug log in reporting thread (https://forum.kodi.tv/showthread.php?tid=374826):
Problematic controller from debug log in reporting issue (garbear#137):
Input for controllers with only MOUSE source
TODO: Report on fix in tracking thread
Problematic controller(s) from debug log in reporting thread (https://forum.kodi.tv/showthread.php?tid=375790):
What is the effect on users?
See list of fixes in description
Types of change