Motion evdev: Difference between revisions

From Dolphin Emulator Wiki
Jump to navigation Jump to search
(WIP inital text dump. TODO styling, formatting and upload images)
 
m (DualShock4 and DualSense use the same axis)
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
I only have a switch pro controller and joy-cons so below may be inaccurate for other controllers like Sony Dualshock 4.
Dolphin supports the motion [https://en.wikipedia.org/wiki/Evdev evdev] devices but setting it up is a bit awkward. Nintendo Switch controllers (Joy-Con and Pro controller) are supported through the hid-nintendo driver. Sony DualShock 4 and DualSense through hid-sony/hid-playstation.


* Recent dolphin version (do not use 5.0 stable!)
The HID kernel driver exposes 2 (or more) evdev devices, one for the buttons and another for the accelerators/gyroscopes. 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 (check your Linux distribution)
* Switch pro or joycons.


The HID Nintendo kernel driver exposes 2 evdev devices, one for the buttons and another (IMU) for the accelerometers/gyroscopes. Do note that joy-cons will have 2 devices each (4 in total).
You may need to add the users to a specific group to be allowed access. On Arch Linux this group is ''input''.
 
It took me a bit of time figuring out which axis corresponds with the right motion control in dolphin.


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.
'''
{| class="wikitable"
{| class="wikitable"
!Dolphin motion
!Dolphin motion
!Evdev
!Switch controllers
!Sony DualSense/DualShock4
|-
|-
|Accel Up
|Accel Up
|Accel Z+
|Accel Z+
|Accel Y+
|-
|-
|Accel Down
|Accel Down
|Accel Z-
|Accel Z-
|Accel Y-
|-
|-
|Accel Left
|Accel Left
|Accel Y+
|Accel Y+
|Accel X-
|-
|-
|Accel Right
|Accel Right
|Accel Y-
|Accel Y-
|Accel X+
|-
|-
|Accel Forward
|Accel Forward
|Accel X+
|Accel X+
|Accel Z-
|-
|-
|Accel Backward
|Accel Backward
|Accel X-
|Accel X-
|Accel Z+
|-
|-
|Pitch Up
|Pitch Up
|Gyro Y-
|Gyro Y-
|Gyro X+
|-
|-
|Pitch Down
|Pitch Down
|Gyro Y+
|Gyro Y+
|Gyro X-
|-
|-
|Roll Left
|Roll Left
|Gyro X-
|Gyro X-
|Gyro Z+
|-
|-
|Roll Right
|Roll Right
|Gyro X+
|Gyro X+
|Gyro Z-
|-
|-
|Yaw Left
|Yaw Left
|Gyro Z+
|Gyro Z+
|Gyro Y+
|-
|-
|Yaw Right
|Yaw Right
|Gyro Z-
|Gyro Z-
|Gyro Y-
|}
|}


To configure the motion controls you have to use the advanced config window. Right click on each motion button in the wii remote configure window. Select the appropriate IMU device at the top and find the corresponding evdev key. So for Accel Up in dolphin you need to configure Accel Z+.
As the default buttons are all wrong reset all buttons in the Wii Remote configuration. To configure the motion controls you have to use the advanced config window. Right click on each motion button in the Wii Remote configure window. Select the appropriate IMU device at the top in the device selection.
 
[[File:Select_imu_device.png]]
 
Select the corresponding Accel or Gyro axis, select it and click OK. For example for ''Accel Up'' in Dolphin you need to select ''Accel Z+''. The end result should look like below.


IMAGE
[[File:Advanced_config_result.png]]


The end result should look like below.
Repeat this for every motion.


IMAGE
[[Category:Tutorials]]

Revision as of 12:30, 14 May 2022

Dolphin supports the motion evdev devices but setting it up is a bit awkward. Nintendo Switch controllers (Joy-Con and Pro controller) are supported through the hid-nintendo driver. Sony DualShock 4 and DualSense through hid-sony/hid-playstation.

The HID kernel driver exposes 2 (or more) evdev devices, one for the buttons and another for the accelerators/gyroscopes. 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).

You may need to add the users to a specific group to be allowed access. On Arch Linux this group is input.

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.

Dolphin motion Switch controllers Sony DualSense/DualShock4
Accel Up Accel Z+ Accel Y+
Accel Down Accel Z- Accel Y-
Accel Left Accel Y+ Accel X-
Accel Right Accel Y- Accel X+
Accel Forward Accel X+ Accel Z-
Accel Backward Accel X- Accel Z+
Pitch Up Gyro Y- Gyro X+
Pitch Down Gyro Y+ Gyro X-
Roll Left Gyro X- Gyro Z+
Roll Right Gyro X+ Gyro Z-
Yaw Left Gyro Z+ Gyro Y+
Yaw Right Gyro Z- Gyro Y-

As the default buttons are all wrong reset all buttons in the Wii Remote configuration. To configure the motion controls you have to use the advanced config window. Right click on each motion button in the Wii Remote configure window. Select the appropriate IMU device at the top in the device selection.

Select imu device.png

Select the corresponding Accel or Gyro axis, select it and click OK. For example for Accel Up in Dolphin you need to select Accel Z+. The end result should look like below.

Advanced config result.png

Repeat this for every motion.