Extend autoconfig matching with a physical identifier#18190
Merged
LibretroAdmin merged 2 commits intolibretro:masterfrom Aug 21, 2025
Merged
Extend autoconfig matching with a physical identifier#18190LibretroAdmin merged 2 commits intolibretro:masterfrom
LibretroAdmin merged 2 commits intolibretro:masterfrom
Conversation
Extend the matching logic to cover also the cases when vid/pid is the same, but still there is some difference between gamepads. These identifiers are highly environment specific and are only meant to be edited locally, not added to any central repository. The controller affinity will now check a "phys" attribute as well. The value of this attribute can be determined from RetroArch debug logs, and can be added to the autoconfig file for better matching. Currently, udev driver will store USB port and serial identifier here, retrieved by EVIOCGPHYS and EVIOCGUNIQ. Co-authored-by: Luther7718 <[email protected]>
3018bbb to
3bc8318
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Extend the matching logic to cover also the cases when vid/pid/name is the same, but still there is some difference between gamepads. These identifiers are highly device/environment specific and are only meant to be edited locally, not added to any central repository.
The controller affinity will now check a
physattribute as well. The value of this attribute can be determined from RetroArch debug logs, and can be added to the autoconfig file to direct the match to a different config with same vid/pid/name, but matchingphysvalue.Currently, udev driver will store USB port and serial identifier here, retrieved by EVIOCGPHYS and EVIOCGUNIQ.
A few examples (serial redacted):
Both identifiers will be queried, but support is not guaranteed, in this case one only has the usb ID, the other only has the serial number, if both are present, they will be concatenated. Partial matches are supported.
To use the physical identifier for matching, copy the existing autoconfig file (to avoid overwriting it when pulling an update), and extend it with the _phys attribute:
input_phys = "usb-0000:04:00.0-2/input0"It is probably also worth to change
display_name, to immediately see if the match went as expected.The alternative matching can also be used (
input_phys_alt1, etc.).Linuxraw driver was not extended, as no way was found to query a serial, and /dev/input/js* entries are not useful by default. (If there is really someone who does more customization like in this old forum thread, let me know and it can be added.)
Related Issues
Does not solve any of these, but it may open the door for:
#3914
#8857
#13520
#13063
Physical ID query can be added to other joypad drivers as seen fit, since the autoconfig files are driver dependent anyway, they do not need to follow the same format as udev.
Reviewers
@luther7718 (original implementation)