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

[IMPORTANT feature request]: Support multiple input_device, input_device_display_name, input_vendor_id, and input_product_id variables #16907

Closed
davidhedlund opened this issue Aug 21, 2024 · 4 comments · Fixed by #16990

Comments

@davidhedlund
Copy link
Contributor

davidhedlund commented Aug 21, 2024

input_device (linuxraw)

To avoid the need for uploading and maintaining multiple copies of files for linuxraw, which uses input_device to identify the controller, I propose the following:

  • Implement input_device_alt1 and input_device_display_name_alt1
  • Implement input_device_alt2 and input_device_display_name_alt2

After implementation, this can be incorporated into the android and udev autoconfiguration files as well, to significantly enhance their ability to utilize input_device as fallback when the vendor or product ID is unavailable. This feature is unnecessary for sdl2 autoconfig files because they use the same input_device value for both USB and Bluetooth across all Linux kernel versions.

Placed USB lines before Bluetooth lines in the examples below, as the input_device USB name more clearly identifies the hardware device.

Nintendo Switch Pro Controller

  • Device Index for Linux 5.19, and 6.2.0:
    • USB: Nintendo Switch Pro Controller
    • Bluetooth: Nintendo Switch Pro Controller
  • Device Index for Linux 6.8.0:
    • USB: Nintendo Co., Ltd. Pro Controller
    • Bluetooth: Pro Controller

Current

Nintendo Switch Pro Controller.cfg

input_driver = "linuxraw"
input_device = "Nintendo Switch Pro Controller"
input_device_display_name = "Nintendo Switch Pro Controller (Bluetooth/USB)"

Nintendo Co., Ltd. Pro Controller.cfg

input_driver = "linuxraw"
input_device = "Nintendo Co., Ltd. Pro Controller"
input_device_display_name = "Nintendo Switch Pro Controller (USB)"

Pro Controller.cfg

input_driver = "linuxraw"
input_device = "Pro Controller"
input_device_display_name = "Nintendo Switch Pro Controller (Bluetooth)"

Proposed merge

Nintendo Switch Pro Controller.cfg

input_driver = "linuxraw"
input_device = "Nintendo Switch Pro Controller"
input_device_display_name = "Nintendo Switch Pro Controller (Bluetooth/USB)"
input_device_alt1 = "Nintendo Co., Ltd. Pro Controller"
input_device_display_name_alt1 = "Nintendo Switch Pro Controller (USB)"
input_device_alt2 = "Pro Controller"
input_device_display_name_alt2 = "Nintendo Switch Pro Controller (Bluetooth)"

Nintendo Switch Pro Controller (non-HID)

  • Device Index for Linux 5.15:
    • USB[1]: Nintendo Switch Pro Controller
    • Bluetooth: Pro Controller

Notes:

  • 1: Only Bluetooth is avalible for the non-HID version. So there is no need to merge anything.

Sony DualSense

  • Device Index for all Linux versions:
    • USB: Sony Interactive Entertainment DualSense Wireless Controller
    • Bluetooth: DualSense Wireless Controller

Current

Sony Interactive Entertainment DualSense Wireless Controller.cfg

input_driver = "linuxraw"
input_device = "Sony Interactive Entertainment DualSense Wireless Controller"
input_device_display_name = "Sony DualSense (USB)"

DualSense Wireless Controller.cfg

input_driver = "linuxraw"
input_device = "DualSense Wireless Controller"
input_device_display_name = "Sony DualSense (BlueTooth)"

Proposed merge

Sony Interactive Entertainment DualSense Wireless Controller.cfg

input_driver = "linuxraw"
input_device = "Sony Interactive Entertainment DualSense Wireless Controller"
input_device_display_name = "Sony DualSense (USB)"
input_device_alt1 = "DualSense Wireless Controller"
input_device_display_name_alt1 = "Sony DualSense (BlueTooth)"

Sony DualShock 4 v2

  • Device Index for all Linux versions:
    • USB: Sony Interactive Entertainment Wireless Controller
    • Bluetooth: Wireless Controller

Current

Sony Interactive Entertainment Wireless Controller.cfg

input_driver = "linuxraw"
input_device = "Sony Interactive Entertainment Wireless Controller"
input_device_display_name = "Sony DualShock 4 v2 Controller (USB)"

Wireless Controller.cfg

input_driver = "linuxraw"
input_device = "Wireless Controller"
input_device_display_name = "Sony DualShock 4 v2 Controller (BlueTooth)"

Proposed merge

Sony Interactive Entertainment Wireless Controller.cfg

input_driver = "linuxraw"
input_device = "Sony Interactive Entertainment Wireless Controller"
input_device_display_name = "Sony DualShock 4 v2 Controller (USB)"
input_device_alt1 = "Wireless Controller"
input_device_display_name_alt1 = "Sony DualShock 4 v2 Controller (BlueTooth)"

input_vendor_id, and input_product_id (android, udev, sdl2)

  • Implement input_vendor_id_alt1 and input_vendor_product_alt1 so we can:
    • Merge DualShock 4 versions 1 and 2 — this task has been on my agenda.
    • Merge Microsoft X-Box pad versions 1 (US) and 2 (US) — thank you for highlighting this.

DualShock 4 v1 and v2

android

Merge Sony Computer Entertainment Wireless Controller.cfg (v1) and Wireless Controller.cfg (v2)

Current

DualShock 4 v1: Sony Computer Entertainment Wireless Controller.cfg

input_driver = "android"
input_device = "Sony Computer Entertainment Wireless Controller"
input_device_display_name = "Sony DualShock 4 Controller v1"
input_vendor_id = "1356"
input_product_id = "1476"

DualShock 4 v2: Wireless Controller.cfg

input_driver = "android"
input_device = "Wireless Controller"
input_device_display_name = "Sony DualShock 4 v2 Controller"
input_vendor_id = "1356"
input_product_id = "2508"

Proposed merge

DualShock 4.cfg

input_driver = "android"
input_device = "Wireless Controller"
input_device_display_name = "Sony DualShock 4 v2 Controller"
input_vendor_id = "1356"
input_product_id = "2508"
input_device_alt1 = "Sony Computer Entertainment Wireless Controller"
input_device_display_name_alt1 = "Sony DualShock 4 Controller v1"
input_vendor_id_alt1 = "1356"
input_product_id_alt1 = "1476"

sdl2

Merge PS4 Controller (v1).cfg (v1) and PS4 Controller.cfg (v2)

Current

DualShock 4 v1: PS4 Controller (v1).cfg

input_driver = "sdl2"
input_device = "PS4 Controller"
input_device_display_name = "PlayStation 4 (PS4) Sony DualShock 4 v1 Controller"
input_vendor_id = "1356"
input_product_id = "1476"

DualShock 4 v2: PS4 Controller.cfg

input_driver = "sdl2"
input_device = "PS4 Controller"
input_device_display_name = "PlayStation 4 (PS4) Sony DualShock 4 v2 Controller"
input_vendor_id = "1356"
input_product_id = "2508"

Proposed merge

PS4 Controller.cfg

input_driver = "sdl2"
input_device = "PS4 Controller"
input_device_display_name = "PlayStation 4 (PS4) Sony DualShock 4 v2 Controller"
input_vendor_id = "1356"
input_product_id = "2508"
input_device_alt1 = "PS4 Controller"
input_device_display_name_alt1 = "PlayStation 4 (PS4) Sony DualShock 4 v1 Controller"
input_vendor_id_alt1 = "1356"
input_product_id_alt1 = "1476"

udev

Merge Sony Computer Entertainment Wireless Controller.cfg (v1) and Sony Interactive Entertainment Wireless Controller.cfg (v2)

Current

DualShock 4 v1: Sony Computer Entertainment Wireless Controller.cfg

input_driver = "udev"
input_device = "Sony Computer Entertainment Wireless Controller"
input_vendor_id = "1356"
input_product_id = "1476"

DualShock 4 v2: Sony Interactive Entertainment Wireless Controller.cfg

input_device = "Sony Interactive Entertainment Wireless Controller"
input_device_display_name = "Sony DualShock 4 v2 Controller"
input_driver = "udev"
input_vendor_id = "1356"
input_product_id = "2508"

Proposed merge

Sony Computer and Interactive Entertainment Wireless Controller.cfg

input_device = "Sony Interactive Entertainment Wireless Controller"
input_device_display_name = "Sony DualShock 4 v2 Controller"
input_driver = "udev"
input_vendor_id = "1356"
input_product_id = "2508"
input_device_alt1 = "Sony Computer Entertainment Wireless Controller"
input_device_display_name_alt1 = "Sony DualShock 4 v1 Controller"
input_vendor_id_alt1 = "1356"
input_product_id_alt1 = "1476"
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 21, 2024
# The files "Sony Interactive Entertainment Wireless Controller.cfg" and "Wireless Controller.cfg" should have identical content except for the input_device variable until they can be merged when this issue has been solved: [IMPORTANT feature request]: Support multiple input_device names for controller compatibility across Linux kernels - libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 21, 2024
# The files "Nintendo Co., Ltd. Pro Controller.cfg" and "Nintendo Switch Pro Controller.cfg" should have identical content except for the input_device variable until they can be merged when this issue has been solved: [IMPORTANT feature request]: Support multiple input_device names for controller compatibility across Linux kernels - libretro/RetroArch#16907
@davidhedlund davidhedlund changed the title [IMPORTANT feature request]: Support multiple input_device names for controller compatibility across Linux kernels [IMPORTANT feature request]: Support multiple input_device and input_device_display_name variables for controller compatibility across Linux kernels Aug 21, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 21, 2024
# The files "Sony Interactive Entertainment Wireless Controller.cfg" and "Wireless Controller.cfg" should have identical content except for the input_device variable until they can be merged when this issue has been solved: [IMPORTANT feature request]: Support multiple input_device names for controller compatibility across Linux kernels - libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
It seems more straightforward for a single pull request to remove input_vendor_id from all udev files once we reach a consensus on the issue discussed in: libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
It seems more straightforward for a single pull request to remove input_vendor_id from all udev files once we reach a consensus on the issue discussed in: libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
It seems more straightforward for a single pull request to remove input_vendor_id from all udev files once we reach a consensus on the issue discussed in: libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
It seems more straightforward for a single pull request to remove input_vendor_id from all udev files once we reach a consensus on the issue discussed in: libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
It seems more straightforward for a single pull request to remove input_vendor_id from all udev files once we reach a consensus on the issue discussed in: libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
It seems more straightforward for a single pull request to remove input_vendor_id from all udev files once we reach a consensus on the issue discussed in: libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
It seems more straightforward for a single pull request to remove input_vendor_id from all udev files once we reach a consensus on the issue discussed in: libretro/RetroArch#16907
@zoltanvb
Copy link
Contributor

zoltanvb commented Sep 3, 2024

As discussed in other, related tickets: autoconfig matching is rather flexible, so if the vendor/product ID matches, it will still find the proper autoconfig file, without the need to add multiple names. (This is not valid for the linuxraw driver - that one has no way of knowing vid/pid).

There can be limits to this approach, like the one mentioned in #15994 (when not only the name, but also the button layout changes), but that is hopefully a rare occurrence.

@davidhedlund
Copy link
Contributor Author

As discussed in other, related tickets: autoconfig matching is rather flexible, so if the vendor/product ID matches, it will still find the proper autoconfig file, without the need to add multiple names. (This is not valid for the linuxraw driver - that one has no way of knowing vid/pid).

There can be limits to this approach, like the one mentioned in #15994 (when not only the name, but also the button layout changes), but that is hopefully a rare occurrence.

Understood. I've completely rewritten the top post to concentrate on linuxraw. Could you please review it again?

@davidhedlund davidhedlund changed the title [IMPORTANT feature request]: Support multiple input_device and input_device_display_name variables for controller compatibility across Linux kernels [IMPORTANT feature request]: Support multiple input_device and input_device_display_name variables Sep 4, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
Avoid input_vendor_id/input_product_id conflict. Support multiple input_device and input_device_display_name variables - libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
Avoid input_vendor_id/input_product_id conflict. Support multiple input_device and input_device_display_name variables - libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
Avoid input_vendor_id/input_product_id conflict. Support multiple input_device and input_device_display_name variables - libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
Avoid input_vendor_id/input_product_id conflict. Support multiple input_device and input_device_display_name variables - libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
Avoid input_vendor_id/input_product_id conflict. Support multiple input_device and input_device_display_name variables - libretro/RetroArch#16907
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
Avoid input_vendor_id/input_product_id conflict. Support multiple input_device and input_device_display_name variables - libretro/RetroArch#16907
@zoltanvb
Copy link
Contributor

zoltanvb commented Sep 5, 2024

Checked, makes sense.

@davidhedlund davidhedlund changed the title [IMPORTANT feature request]: Support multiple input_device and input_device_display_name variables [IMPORTANT feature request]: Support multiple input_device, input_device_display_name, input_vendor_id, and input_product_id variables Sep 12, 2024
@davidhedlund
Copy link
Contributor Author

davidhedlund commented Sep 12, 2024

Checked, makes sense.

  • Big thanks for the PR! The issue title now includes "input_vendor_id" and "input_product_id," and a section has been added to the top post detailing these identifiers for merging autoconfigs:
    • Combine DualShock 4 versions 1 and 2 — this task has been on my agenda.
    • Integrate Microsoft X-Box pad versions 1 (US) and 2 (US) — thank you for highlighting this.

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 a pull request may close this issue.

2 participants