Motion evdev: Difference between revisions

Jump to navigation Jump to search
(Add notes for the DualSense)
(make it more generic, remove udev rules and add note about permission)
Line 1: Line 1:
These instruction are made with a Nintendo Pro controller and Joy-Cons. While the overall process will be the same the motion axis may not match those found on a Sony DualShock 4 or DualSense. The Sony DualSense also exposes two devices like the Nintendo controllers.  
Dolphin supports the motion evdev devices but setting it up is a bit awkward. Nintendo controllers (JoyCon and Pro controller) are supported through the hid-nintendo driver. Sony DualShock4 and DualSense through hid-playstation.


* Recent dolphin version (do not use 5.0 stable!)
The HID kernel kernel driver exposes 2 (or more) evdev devices, one for the buttons and another for the accelerators/gyroscopes. Do note that Joy-Cons will have 2 devices each (4 in total). The hid-nintendo driver exposes the motion axis on an IMU device while hid-playstation named it "Wireless Controller Motion Sensors". Do note that Nintendo Joy-Cons will have 2 devices each (4 in total).
* HID Nintendo kernel driver (dkms https://github.com/nicman23/dkms-hid-nintendo)
* Switch pro or Joy-Con.


The HID Nintendo kernel driver exposes 2 evdev devices, one for the buttons and another (IMU) for the accelerators/gyroscopes. Do note that Joy-Cons will have 2 devices each (4 in total). For the Sony DualSense controller the accelerators/gyroscopes are on the "Wireless Controller Motion Sensors" evdev device.
You may need to add the users to a specific group to be allowed access. On Arch linux this group is "input".


The IMU input device does not automatically get tagged with `uaccess` while the "regular" device is. If you do not see an IMU device listed in Dolphin's devicelist add the following udev rule to /etc/udev/rules.f/99-hidnintendo.rules. reload udev rules with "udevadm control --reload-rules" and reconnect the device(s).
<pre>
ACTION!="add", GOTO="imuend"
SUBSYSTEM!="input", GOTO="imuend"
KERNEL!="event*", GOTO="imuend"
ATTRS{id/vendor}=="057e", ATTRS{id/product}=="2009", ATTRS{name}=="*IMU*", TAG+="uaccess"
ATTRS{id/vendor}=="057e", ATTRS{id/product}=="2006", ATTRS{name}=="*IMU*", TAG+="uaccess"
ATTRS{id/vendor}=="057e", ATTRS{id/product}=="2007", ATTRS{name}=="*IMU*", TAG+="uaccess"
ATTRS{id/vendor}=="057e", ATTRS{id/product}=="200e", ATTRS{name}=="*IMU*", TAG+="uaccess"
ATTRS{id/vendor}=="057e", ATTRS{id/product}=="2017", ATTRS{name}=="*IMU*", TAG+="uaccess"
LABEL="imuend"
</pre>


It took me a bit of time figuring out which axis corresponds with the right motion control in dolphin. '''These axis might change in the future when evdev standardizes them.
It took me a bit of time figuring out which axis corresponds with the right motion control in dolphin. '''These axis might change in the future when evdev standardizes them.