Skip to content

Extend autoconfig matching with a physical identifier#18190

Merged
LibretroAdmin merged 2 commits intolibretro:masterfrom
zoltanvb:autoconfig_phys_id2
Aug 21, 2025
Merged

Extend autoconfig matching with a physical identifier#18190
LibretroAdmin merged 2 commits intolibretro:masterfrom
zoltanvb:autoconfig_phys_id2

Conversation

@zoltanvb
Copy link
Contributor

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 phys attribute 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 matching phys value.

Currently, udev driver will store USB port and serial identifier here, retrieved by EVIOCGPHYS and EVIOCGUNIQ.
A few examples (serial redacted):

[DEBUG] [Autoconf] Config files scanned: driver udev, pad name Microsoft Xbox Series S|X Controller (045e/0b12), phys usb-0000:04:00.0-2/input0, affinity 41
[DEBUG] [Autoconf] Config files scanned: driver udev, pad name Sony Interactive Entertainment Wireless Controller (054c/09cc), phys 28:c1:3c:__:__:__, affinity 50

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)

zoltanvb and others added 2 commits August 21, 2025 07:56
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]>
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.

2 participants