Difference between revisions of "DSU Client"

From Dolphin Emulator Wiki
Jump to: navigation, search
(Linux)
m (DSU Server Applications)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Since {{revision|5.0-11083}}, Dolphin is compatible with the '''DSU protocol''', which enables the emulator to receive motion and input data from compatible server applications. Those servers works as a middle-man between specific input devices and client applications like Dolphin in order to provide motion data not available through the other input APIs Dolphin supports, like DInput, XInput and SDL, although they also provide normal buttons and axis data as well.
+
Since {{revision|5.0-11083}}, Dolphin can act as a client of the '''[https://v1993.github.io/cemuhook-protocol/ DSU protocol]''' (often referred as ''CemuHook Motion Provider'' protocol), which enables the emulator to receive motion and input data from compatible applications implementing the server-side part of the protocol. Those servers works as a middle-man between specific input devices and client applications like Dolphin in order to provide motion data not accessible through the other input APIs Dolphin supports, like DInput, XInput and SDL, although they also provide data from normal buttons and axes as well.
  
== DSU Protocol Servers ==
+
== DSU Server Applications ==
 
A list of known servers are listed below. Any server not listed here that works with [https://cemuhook.sshnuke.net/ CemuHook] should also work with Dolphin {{revision|5.0-11083}} and newer.
 
A list of known servers are listed below. Any server not listed here that works with [https://cemuhook.sshnuke.net/ CemuHook] should also work with Dolphin {{revision|5.0-11083}} and newer.
  
 
=== Linux ===
 
=== Linux ===
As of {{revision|5.0-1234}}, motion axis of DualShock 3 and 4 controllers can be directly mapped in Dolphin through evdev input API. Additionally, the following servers are available:
+
As of {{revision|5.0-11484}}, motion axes of Wii Remotes, DualShock 3 and DualShock 4 controllers can be directly mapped in Dolphin through evdev input API. Additionally, the following servers are available:
 
* '''[https://github.com/TheDrHax/ds4drv-cemuhook ds4drv] (TheDrHax fork):''' compatible with all DualShock 4 controllers.
 
* '''[https://github.com/TheDrHax/ds4drv-cemuhook ds4drv] (TheDrHax fork):''' compatible with all DualShock 4 controllers.
* '''[https://github.com/v1993/linuxmotehook linuxmotehook]:''' compatible with Wii Remotes. Not recommended, as Dolphin can communicate directly with them.
+
* '''[https://github.com/v1993/linuxmotehook linuxmotehook]:''' compatible with Wii Remotes. For Wii titles, it's recommended to connect the Wii Remotes directly to Dolphin instead of using a DSU Server.
  
 
=== Windows ===
 
=== Windows ===
 
* '''[https://ryochan7.github.io/ds4windows-site/ DS4Windows] (Ryochan7 fork):''' compatible with all DualShock 4 controllers.
 
* '''[https://ryochan7.github.io/ds4windows-site/ DS4Windows] (Ryochan7 fork):''' compatible with all DualShock 4 controllers.
* '''[https://github.com/Davidobot/BetterJoyForCemu BetterJoyForCemu]:''' compatible with Nintendo Switch Joy-con and Pro Controllers.
+
* '''[https://github.com/Davidobot/BetterJoyForCemu BetterJoyForCemu]:''' compatible with Nintendo Switch Joy-Con and Pro Controllers.
 
* '''[https://github.com/FrogTheFrog/steam-gyro-for-cemuhook Steam Gyro for CemuHook]:''' compatible with Steam Controllers.
 
* '''[https://github.com/FrogTheFrog/steam-gyro-for-cemuhook Steam Gyro for CemuHook]:''' compatible with Steam Controllers.
* '''[https://github.com/nefarius/ScpToolkit ScpToolkit] (Nefarius fork, [https://github.com/rajkosto/ScpToolkit/releases requires patching]):''' compatible with DualShock 3 and earlier DualShock 4 controllers (CUH-ZCT1x). If you have a DualShock 4, use DS4Windows instead, as ScpToolkit is unmaintained.
+
* '''[https://github.com/nefarius/ScpToolkit ScpToolkit] (Nefarius fork, [https://github.com/rajkosto/ScpToolkit/releases requires patching]):''' compatible with DualShock 3 and older DualShock 4 controllers (model CUH-ZCT1x). Since ScpToolkit is unmaintained and has connectivity issues with the newer DualShock 4 controllers (model CUH-ZCT2x), its usage is recommended only with DualShock 3 controllers. For DualShock 4 controllers, use DS4Windows instead.
* '''[https://forum.cemu.info/showthread.php/140-WiimoteHook-Nintendo-Wii-Remote-with-MotionPlus-Rumble-and-Nunchuk-support WiimoteHook]:''' compatible with Wii Remotes. Not recommended, as Dolphin can communicate directly with them.
+
* '''[https://www.ppxclub.com/675647-1-1 WiimoteHook]:''' compatible with Wii Remotes. For Wii titles, it's recommended to connect the Wii Remotes directly to Dolphin instead of using a DSU Server.
  
 
=== macOS ===
 
=== macOS ===
Line 20: Line 20:
  
 
=== Android ===
 
=== Android ===
* '''[https://files.sshnuke.net/net.sshnuke.dsu.MotionSource-1.1.2.apk rajkosto's MotionSource]:''' for Android devices, provides only motion data.
+
* '''[https://files.sshnuke.net/net.sshnuke.dsu.MotionSource-1.1.2.apk rajkosto's MotionSource]:''' for Android devices, provides only motion sensor data.
  
 
== Setting up ==
 
== Setting up ==
To do
+
=== DSU Server ===
 +
# Download and install a suitable server application for your OS and input device.
 +
# Follow the application instructions to connect your input device.
 +
# Depending of the application, manually enable the "UDP Server" option (or similar).
  
== Using Placeholder Protocol in Dolphin ==
+
Also, take note of the IP Address and Port where the server will be listening. On most cases, they will default to IP '''127.0.0.1''' at port '''26760''' but this might be completely different, for example, when using an Android device as motion source.
To do
+
 
 +
=== Dolphin ===
 +
# Make sure you're running Dolphin {{revision|5.0-11083}} or newer.
 +
# Go to Controller Settings => Alternate Input Sources.
 +
# On the DSU Client tab, mark the "Enable" checkbox then enter the IP Address and Port where the server application is listening.
 +
If everything is working, you should now see new <code>DSUClient/x/xxxx</code> entries on the Devices drop-down menu shown on Emulated GameCube Controllers, Emulated Wii Remotes and Hotkey Settings windows.
 +
 
 +
== Using DSU devices in Dolphin ==
 +
After finishing the setup of the server and enabling the DSU Client on Dolphin, you can now bind the buttons, axes and motion sensors of the input devices in many places, including Emulated GameCube Controllers, Emulated Wii Remotes and even Hotkey Settings.
 +
 
 +
=== Regular buttons and axes ===
 +
The configuration of regular button and axes are pretty much the same of the other input APIs:
 +
# Select the corresponding <code>DSUClient/x/xxxx</code> entry on the Devices drop-down menu.
 +
# Click on the desired binding.
 +
# Press the desired button / move the desired axis on the input device.
 +
You can also right-click a binding to show advanced options and an existing binding can be quickly cleared with a middle-click.
 +
 
 +
=== Motion sensors ===
 +
The configuration of motion sensors are mostly used on the "Motion Input" tab (since {{revision|5.0-11083}}) and on "Extension Motion Input" tab (since {{revision|5.0-11478}}, visible only when Nunchuk is the currently selected extension) of Emulated Wii Remotes, although nothing prevents you from binding the motion sensor axes in other places as well. By default, the Accelerometer and Gyroscope bindings of the "Motion Input" tab should be already populated with the matching axes from the DSU Server.
 +
 
 +
If they are blank (e.g. the current controller configuration was created by an older Dolphin version), you can manually assign the corresponding motion axes by right-clicking each binding and picking the corresponding axis on the end of the list or you can simply click on the Default button in the main window (but keep in mind this will reset all bindings in all tabs).
 +
 
 +
Additionally, if you're on Linux, you can completely skip the whole setup of DSU Server/Client and directly assign the motion sensor axes of most controllers by selecting the corresponding <code>evdev/x/xxxx</code> entry on the Devices drop-down menu, thanks to the Linux evdev API natively exposing motion axes.
 +
 
 +
=== Emulated pointer ===
 +
On Dolphin {{revision|5.0-11083}} and newer, if the Accelerometer and Gyroscope bindings of the "Motion Input" tab of Emulated Wii Remotes are assigned correctly, the Wii Remote IR Pointer position will be derived from the motion sensors, thus dispensing the need for a sensor bar. To fine-tune the emulated pointer, you can assign a button to recenter the cursor when pressed and can also adjust the maximum rotation of the yaw axis through the bindings present on the "Point" section in the "Motion Input" tab of Emulated Wii Remotes. Also, starting with Dolphin {{revision|5.0-11205}}, this feature can be manually disabled in case you still want to map the IR Pointer through the bindings of the "Motion Simulation" tab.
 +
 
 +
== Troubleshooting ==
 +
=== <code>DSUClient/x/xxxx</code> entries doesn't appear on Dolphin's Devices list ===
 +
Assuming you've set up your DSU Server correctly, here's a common checklist:
 +
* Is the DSU Server running?
 +
* Did you [[DSU_Client#Dolphin|enable the DSU Client in Dolphin]]?
 +
* Did you specify the correct server IP Address and server port in Dolphin?
 +
* Have you checked if both the DSU Server application and Dolphin are whitelisted on your OS firewall?
 +
Additionally, on Windows, you can use the [https://files.sshnuke.net/PadTest_1011.zip DSU Pad Test] application to check if the DSU Server is communicating correctly. If no devices are detected on the DSU Pad Test, you should check your DSU Server settings before trying to use the input devices with Dolphin.
 +
 
 +
=== I can't reach the left/right sides of the screen with the emulated pointer ===
 +
Increasing "Total Yaw" on the Motion Input tab of Emulated Wii Remotes should fix that. Keep in mind there isn't a correct value as the amount of yaw needed for the emulated pointer reach both sides of the screen varies a lot between different games, so finding a value that works with all games is somewhat impossible.
 +
 
 +
=== I'm using a DualShock 3 controller and button presses only register if I press the buttons hard ===
 +
With the exception of the Start, Select, PS, L3 and R3, all DualShock 3 buttons are pressure sensitive. Different from the common input APIs, the amount of pressure being applied to each button is reported back to Dolphin as full analog buttons when accessing DualShock 3 controllers through DSU Protocol.
 +
 
 +
By default, Dolphin will register analog buttons as "pressed" when at least 50% of force is applied to them, but users can fine-tune that threshold individually by right-clicking each binding and adjusting the "Range" slider. For instance, setting the range to 200 will register the buttons as pressed when 25% of force is applied to them, and that value seems to provide a button press feedback very close of other controllers with digital-only face buttons (e.g. DualShock 4, Xbox, Joy-Con, Pro Controller, etc).
 +
 
 +
[[Category:Tutorials]]

Latest revision as of 09:29, 1 April 2020

Since 5.0-11083, Dolphin can act as a client of the DSU protocol (often referred as CemuHook Motion Provider protocol), which enables the emulator to receive motion and input data from compatible applications implementing the server-side part of the protocol. Those servers works as a middle-man between specific input devices and client applications like Dolphin in order to provide motion data not accessible through the other input APIs Dolphin supports, like DInput, XInput and SDL, although they also provide data from normal buttons and axes as well.

DSU Server Applications

A list of known servers are listed below. Any server not listed here that works with CemuHook should also work with Dolphin 5.0-11083 and newer.

Linux

As of 5.0-11484, motion axes of Wii Remotes, DualShock 3 and DualShock 4 controllers can be directly mapped in Dolphin through evdev input API. Additionally, the following servers are available:

  • ds4drv (TheDrHax fork): compatible with all DualShock 4 controllers.
  • linuxmotehook: compatible with Wii Remotes. For Wii titles, it's recommended to connect the Wii Remotes directly to Dolphin instead of using a DSU Server.

Windows

  • DS4Windows (Ryochan7 fork): compatible with all DualShock 4 controllers.
  • BetterJoyForCemu: compatible with Nintendo Switch Joy-Con and Pro Controllers.
  • Steam Gyro for CemuHook: compatible with Steam Controllers.
  • ScpToolkit (Nefarius fork, requires patching): compatible with DualShock 3 and older DualShock 4 controllers (model CUH-ZCT1x). Since ScpToolkit is unmaintained and has connectivity issues with the newer DualShock 4 controllers (model CUH-ZCT2x), its usage is recommended only with DualShock 3 controllers. For DualShock 4 controllers, use DS4Windows instead.
  • WiimoteHook: compatible with Wii Remotes. For Wii titles, it's recommended to connect the Wii Remotes directly to Dolphin instead of using a DSU Server.

macOS

No known servers.

Android

Setting up

DSU Server

  1. Download and install a suitable server application for your OS and input device.
  2. Follow the application instructions to connect your input device.
  3. Depending of the application, manually enable the "UDP Server" option (or similar).

Also, take note of the IP Address and Port where the server will be listening. On most cases, they will default to IP 127.0.0.1 at port 26760 but this might be completely different, for example, when using an Android device as motion source.

Dolphin

  1. Make sure you're running Dolphin 5.0-11083 or newer.
  2. Go to Controller Settings => Alternate Input Sources.
  3. On the DSU Client tab, mark the "Enable" checkbox then enter the IP Address and Port where the server application is listening.

If everything is working, you should now see new DSUClient/x/xxxx entries on the Devices drop-down menu shown on Emulated GameCube Controllers, Emulated Wii Remotes and Hotkey Settings windows.

Using DSU devices in Dolphin

After finishing the setup of the server and enabling the DSU Client on Dolphin, you can now bind the buttons, axes and motion sensors of the input devices in many places, including Emulated GameCube Controllers, Emulated Wii Remotes and even Hotkey Settings.

Regular buttons and axes

The configuration of regular button and axes are pretty much the same of the other input APIs:

  1. Select the corresponding DSUClient/x/xxxx entry on the Devices drop-down menu.
  2. Click on the desired binding.
  3. Press the desired button / move the desired axis on the input device.

You can also right-click a binding to show advanced options and an existing binding can be quickly cleared with a middle-click.

Motion sensors

The configuration of motion sensors are mostly used on the "Motion Input" tab (since 5.0-11083) and on "Extension Motion Input" tab (since 5.0-11478, visible only when Nunchuk is the currently selected extension) of Emulated Wii Remotes, although nothing prevents you from binding the motion sensor axes in other places as well. By default, the Accelerometer and Gyroscope bindings of the "Motion Input" tab should be already populated with the matching axes from the DSU Server.

If they are blank (e.g. the current controller configuration was created by an older Dolphin version), you can manually assign the corresponding motion axes by right-clicking each binding and picking the corresponding axis on the end of the list or you can simply click on the Default button in the main window (but keep in mind this will reset all bindings in all tabs).

Additionally, if you're on Linux, you can completely skip the whole setup of DSU Server/Client and directly assign the motion sensor axes of most controllers by selecting the corresponding evdev/x/xxxx entry on the Devices drop-down menu, thanks to the Linux evdev API natively exposing motion axes.

Emulated pointer

On Dolphin 5.0-11083 and newer, if the Accelerometer and Gyroscope bindings of the "Motion Input" tab of Emulated Wii Remotes are assigned correctly, the Wii Remote IR Pointer position will be derived from the motion sensors, thus dispensing the need for a sensor bar. To fine-tune the emulated pointer, you can assign a button to recenter the cursor when pressed and can also adjust the maximum rotation of the yaw axis through the bindings present on the "Point" section in the "Motion Input" tab of Emulated Wii Remotes. Also, starting with Dolphin 5.0-11205, this feature can be manually disabled in case you still want to map the IR Pointer through the bindings of the "Motion Simulation" tab.

Troubleshooting

DSUClient/x/xxxx entries doesn't appear on Dolphin's Devices list

Assuming you've set up your DSU Server correctly, here's a common checklist:

  • Is the DSU Server running?
  • Did you enable the DSU Client in Dolphin?
  • Did you specify the correct server IP Address and server port in Dolphin?
  • Have you checked if both the DSU Server application and Dolphin are whitelisted on your OS firewall?

Additionally, on Windows, you can use the DSU Pad Test application to check if the DSU Server is communicating correctly. If no devices are detected on the DSU Pad Test, you should check your DSU Server settings before trying to use the input devices with Dolphin.

I can't reach the left/right sides of the screen with the emulated pointer

Increasing "Total Yaw" on the Motion Input tab of Emulated Wii Remotes should fix that. Keep in mind there isn't a correct value as the amount of yaw needed for the emulated pointer reach both sides of the screen varies a lot between different games, so finding a value that works with all games is somewhat impossible.

I'm using a DualShock 3 controller and button presses only register if I press the buttons hard

With the exception of the Start, Select, PS, L3 and R3, all DualShock 3 buttons are pressure sensitive. Different from the common input APIs, the amount of pressure being applied to each button is reported back to Dolphin as full analog buttons when accessing DualShock 3 controllers through DSU Protocol.

By default, Dolphin will register analog buttons as "pressed" when at least 50% of force is applied to them, but users can fine-tune that threshold individually by right-clicking each binding and adjusting the "Range" slider. For instance, setting the range to 200 will register the buttons as pressed when 25% of force is applied to them, and that value seems to provide a button press feedback very close of other controllers with digital-only face buttons (e.g. DualShock 4, Xbox, Joy-Con, Pro Controller, etc).