libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.33k stars 1.84k forks source link

linuxraw: "[Controller] Motion Sensors (0/0) not configured" error confusion #16828

Open davidhedlund opened 3 months ago

davidhedlund commented 3 months ago

Expected behavior

Image manipulated screenshots. Each option below is represented for both the Appimage, and the Flatpak package.

This may prevent users from mistakenly thinking their autoconfig files are broken. For instance, Linuxraw does not generate input_product_id and input_vendor_id in the autoconfig file, which may mislead users into believing this is a bug and that these variables should be added (see "(0/0)" on the screenshots), as I previously did. This has lead to incorrectly uploaded to https://github.com/libretro/retroarch-joypad-autoconfig -- even if these variables does not cause any harm, they should simply not be there.

Option 1

Add a note stating "Linuxraw does not support motion sensors"

linuxraw

Option 2

Remove the "[Controller] Motion Sensors (0/0) not configured" error message.

Appimage

Actual behavior

Appimage 1.19.1

354860948-ec6c5e0b-6e71-459b-b095-37637d512c7e

Flatpak 1.19.1

Screenshot at 2024-08-04 04-24-59

Steps to Reproduce

Issue reproduced with a Sony DualSense controller.

For Flatpak first set Settings -> Directories -> Controller Profiles to ~/.var/app/org.libretro.RetroArch/config/, otherwise you will not be able to Save Controller Profile later.

  1. Launch RetroArch.
  2. Go to Settings -> Drivers and select linuxraw for the Controller option.
  3. Restart RetroArch by navigating to Settings -> Restart RetroArch to apply the new driver settings.
  4. Access Settings -> Input -> RetroPad Binds -> Port 1 Binds and click on Set All Controls.
  5. Save the controller profile by returning to Settings -> Input -> RetroPad Binds -> Port 1 Binds and selecting Save Controller Profile.
  6. Restart RetroArch

Version/Commit

You can find this information under Information/System Information

zoltanvb commented 3 months ago

The linuxraw driver uses an interface that does not provide product and vendor IDs, just a name - see JSIOCGNAME. I am not sure where the existing linuxraw autoconfig values came from, but since driver always sets these as 0, those extra identifiers can not help in matching the correct profile. On the other hand, they do not cause problem either.

davidhedlund commented 3 months ago

The linuxraw driver uses an interface that does not provide product and vendor IDs, just a name - see JSIOCGNAME. I am not sure where the existing linuxraw autoconfig values came from, but since driver always sets these as 0, those extra identifiers can not help in matching the correct profile. On the other hand, they do not cause problem either.

Thank you very much for this useful information.

I added this to controller-autoconfiguration.md :

It's important to note an exception involving the linuxraw driver. This driver uses an interface that does not provide Vendor ID (VID) and Product ID (PID) information. Instead, it only supplies a device name, which can be accessed using the JSIOCGNAME ioctl command from the Linux kernel. As a result, matching for controllers using the linuxraw driver relies more heavily on the device name rather than the usual vid:pid identifiers.

I change the title of this issue and updated the top post. Please re-read it from scratch.

zoltanvb commented 3 months ago

I was wondering why my DS3 controller does not behave like that - and it turns out that Linux kernel explicitly blacklists a few specific motion sensors: https://github.com/torvalds/linux/blob/a5dbd76a89423eca9f8de338350f2666aacfb432/drivers/input/joydev.c#L777 This includes DS3, DS4, Switch Pro controller, but not DS5. Hmm. In any case, I guess an alternative could be to add a simple blacklist also to RetroArch, where DS5 motion sensors are disabled from the linuxraw driver. Not very flexible, but may be still worth the effort.