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] Documented that input_vendor_id, and input_product_id are used by udev #16904

Closed
davidhedlund opened this issue Aug 21, 2024 · 5 comments

Comments

@davidhedlund
Copy link
Contributor

davidhedlund commented Aug 21, 2024

Description

Until this issue has been solved it will be impossible to duplicate files and modify the input_device, to make controllers compatible with linuxraw, or udev for with multiple Linux kernel versions, or BlueTooth/USB:

In RetroArch, the linuxraw and udev drivers rely on input_device instead of input_vendor_id and input_product_id. These drivers automatically select the autoconfig file that matches the name used by the active Linux kernel.

However, when using udev, RetroArch still generates input_vendor_id and input_product_id, even though they aren't necessary. This behavior is not present in linuxraw. The issue with udev creates the impression that users need to comment or uncomment these IDs to choose which udev autoconfig file to use, especially when multiple autoconfig files are available—a common scenario for both non-HID and HID autoconfig files.

Expected behavior

The configuration should be as follows:

input_driver = "udev"
input_device = "Pro Controller"

Also, input_driver and input_device should not be required by PR checks for udev (they are not required by linuxraw)

image

Actual behavior

udev: The configuration currently includes unnecessary vendor and product IDs:

input_driver = "udev"
input_device = "Pro Controller"
input_vendor_id = "1406"
input_product_id = "8201"

linuxraw

input_driver = "linuxraw"
input_device = "Pro Controller"

Steps to reproduce the bug

  • Change the controller profile directory.
  • Navigate to Settings -> Drivers -> Controller, and select "udev".
  • Restart RetroArch to apply the new setting.
  • Go to Settings -> Input -> RetroPad Binds -> Port 1 Controls, and click on "Save Controller Profile".
  • Repeat step 1-3 but select "linuxraw" in step 1

Todo list

After resolving the issue, please remove input_driver and input_device from the following autoconfig files that I am maintaining:

  • DualSense
  • Nintendo Switch Pro Controller
  • Nintendo Switch Pro Controller (non-HID)
  • DualShock 4 v2

Newly created PRs that can be used to diagnose this issue:

Version/Commit

  • RetroArch: 1.19.1
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 21, 2024
# Remove input_vendor_id and input_product_id once this issue has been solved: [IMPORTANT] Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
input_vendor_id = "1356"
input_product_id = "2508"
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 21, 2024
# Remove input_vendor_id and input_product_id once this issue has been solved: [IMPORTANT] Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
input_vendor_id = "1406"
input_product_id = "8201"
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 21, 2024
# Remove input_vendor_id and input_product_id once this issue has been solved: [IMPORTANT] Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
input_vendor_id = "1406"
input_product_id = "8201"
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 21, 2024
# Remove input_vendor_id and input_product_id once this issue has been solved: [IMPORTANT] Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
input_vendor_id = "1356"
input_product_id = "3302"
@davidhedlund davidhedlund changed the title [IMPORTANT] Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev [IMPORTANT] Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev Aug 23, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 23, 2024
Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev - libretro/RetroArch#16904
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 26, 2024
…Controller (default-off).cfg

The individual responsible for uploading the file inadvertently swapped the non-HID autoconfig file with the HID autoconfig file. You can access the non-HID file [here](libretro@3abfcb2) and the HID file [here](libretro@3abfcb2).

To address this issue, I:
* Removed "(old)" from the non-HID file and added "(default-off)" to the HID file to align with our updated naming convention.
* Swapped their autoconfig data.

However, he was correct about one detail. He included `input_device = "Pro Controller"` (Bluetooth identifier name), which I mistakenly later changed to `input_device = "Nintendo Co., Ltd. Pro Controller"` (USB identifier name) ([source](libretro@98b1591)). The non-HID driver does not support USB connection for this controller, only Bluetooth.

I made this change because I believed the udev controller driver identified the controller using `input_vendor_id` / `input_product_id`, as generated by "Save Controller Profile" in RetroArch, but later discovered that udev relies on `input_device`, which led me to file a bug report. Consequently, I edited this file:
* I removed the commented variables `input_product_id` and `input_vendor_id` which fail to disable this controller.
* Commented `input_device = Pro Controller` to disable this controller to leave file name space for `Pro Controller.cfg` (HID) since Linux 6.8.0 (Ubuntu 24.04) also identifies this controller as "Pro Controller".

I filed this issue just a few days ago:
* [GitHub Issue](libretro/RetroArch#16904)

Additionally, I removed the comments as a standard procedure. "non-HID" is included in `input_device_display_name`.
@zoltanvb
Copy link
Contributor

zoltanvb commented Sep 2, 2024

Hello,

I'd like to ask about this statement:
In RetroArch, the linuxraw and udev drivers rely on input_device instead of input_vendor_id and input_product_id.
Linuxraw driver has no way of retrieving vendor/product ID, as we have concluded under an earlier ticket. But udev seems to retrieve it and supply it for the autoconfig matching logic, so why would it be unnecessary?

if (ioctl(fd, EVIOCGID, &inputid) >= 0)

and
input_autoconfigure_connect(

@davidhedlund
Copy link
Contributor Author

davidhedlund commented Sep 2, 2024

Hello,

I'd like to ask about this statement: In RetroArch, the linuxraw and udev drivers rely on input_device instead of input_vendor_id and input_product_id. Linuxraw driver has no way of retrieving vendor/product ID, as we have concluded under an earlier ticket. But udev seems to retrieve it and supply it for the autoconfig matching logic, so why would it be unnecessary?

if (ioctl(fd, EVIOCGID, &inputid) >= 0)

and

input_autoconfigure_connect(

Could you please review and confirm the following steps?

  1. Generate an autoconfig file for the udev controller driver for your controller.
  2. Remove input_vendor_id and input_product_id from the autoconfig file.
  3. Restart RetroArch. Test the controller in: Main Menu -> Load Core -> Start Remote RetroPad.
  4. It works, correct?
  5. Modify input_device in the autoconfig file.
  6. Repeat step 3.
  7. It does not work, correct?

I am curious about what the code does in the lines you mentioned.

If input_vendor_id and input_product_id are essential, we should include this information in our joypad user guide by adding something like : The udev controller uses the input_device as well as input_vendor_id/input_product_id. input_device is used to identify and connect the controller, and the input_vendor_id and input_product_id variables are used for [arguments].

@zoltanvb
Copy link
Contributor

zoltanvb commented Sep 3, 2024

Doing the above, I get the following with my controller:

  • after step 1, I get the new autoconfig file (created by me) during connection
  • after removing the input_vendor_id and input_product_id from the autoconfig file generated by me, I get another match (this is an XBox One pad, there is already a suitable autoconfig with same vid/pid, but slightly different name)
  • if I remove the other autoconfig files, but keep the one generated by me, it will be found even with vendor and product ID removed

All in all, it works according to the affinity rules:

/* Returns a value corresponding to the

@davidhedlund
Copy link
Contributor Author

davidhedlund commented Sep 3, 2024

Doing the above, I get the following with my controller:

* after step 1, I get the new autoconfig file (created by me) during connection

* after removing the input_vendor_id and input_product_id from the autoconfig file generated by me, I get another match (this is an XBox One pad, there is already a suitable autoconfig with same vid/pid, but slightly different name)

* if I remove the other autoconfig files, but keep the one generated by me, it will be found even with vendor and product ID removed

All in all, it works according to the affinity rules:

/* Returns a value corresponding to the

davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
…ition.cfg to Sony Dualshock 4 Wireless - 500 Million Limited Edition (default-off).cfg

Solved: libretro/RetroArch#16904
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
@davidhedlund davidhedlund changed the title [IMPORTANT] Unnecessary input_vendor_id, and input_product_id in autoconfig files generated by udev Documented that input_vendor_id, and input_product_id are used by udev Sep 4, 2024
@davidhedlund davidhedlund changed the title Documented that input_vendor_id, and input_product_id are used by udev [IMPORTANT] Documented that input_vendor_id, and input_product_id are used by udev Sep 4, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Sep 4, 2024
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

No branches or pull requests

2 participants