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
Add SDL motion input and rumble support #10000
Conversation
2e1d921
to
c186c3b
Compare
|
I'm not familiar with Visual Studio so my approach of adding SDL into Externals is probably wrong. Would appreciate if someone can help me with that. |
|
Yeah considering the size of the SDL, it's probably a better idea to instead add an actual git submodule of |
eb70c26
to
3971db9
Compare
Ok, I've done that and fixed the visual studio files also. |
|
I think this is ready for more review now |
3d74faf
to
36623e2
Compare
|
Perhaps if SDL isn't found, the SDL from Externals should be used. (There are checks in |
d06f5b6
to
fff0333
Compare
Just finished that as well. Let me know if there's more changes needed. |
|
This should hopefully fix the FreeBSD build failure. |
|
This should fix unit tests on Windows |
|
This should be everything fixed, just need to run it through CI to confirm that. |
|
I have tested this on Windows 10 v20H1 with my DualShock 4 Controller:
@OatmealDome also tried this on macOS 11 with a Switch Pro Controller, everything works except motion controls. Is there anything special we need to do to get motion controls working? |
|
Maybe it's some background programs that are interfering with it. If you guys have Steam, DS4Windows or other programs that interact with controllers try closing them. Also, the system SDL on the macOS build bot might be too old, version 2.0.14 or newer is required for motion controls. I have personally tested on Windows 10 v21H1 with a DualShock 4 Controller in both bluetooth and wired mode and it works for me. |
|
Also macOS might have permission issues, so the solution to that is going to |
|
Hmm, the universal buildbot uses SDL 2.0.14, so that should be fine. I tried my Pro Controller over Bluetooth and USB with Input Monitoring enabled for Dolphin, and motion isn't being registered in the controller configuration. If I right click on the binding button to look at the list of inputs, none of the |
|
I tested with a DualShock 4 v2 on Windows 10 21H1 and it works (including motion) but:
Those probably are SDL limitations, but not working over Bluetooth kinda defeats the hability of reading the motion sensors. Regardless it's still a great addition especially for macOS, which has a single DSU Server available that I heard is quite finicky to use... |
|
Ah, nevermind, SDL can see the DualShock 4 over BT on Win10 (I forgot to add Dolphin to the HidHide whitelist earlier), however it can't access the motion sensors over BT (they don't appear in the Advanced Mapping window), rumble also doesn't work over BT (it can be selected in the Advanced Mapping windows but the controller doesn't rumble at all)... |
|
Adding touchpad support and individual motor rumble is doable. I'll add support for those after I figure out why it's not working for some people. |
|
Quick update on my issue: a reboot fixed the motion control issues. The pointer works fine now but the actual accelerometer itself shifts heavily to the right. I have tested this with Mario Kart Wii. Calibrating the motion controls doesn't seem to help much. It seems like the accelerometer is shifting further the longer I drive. Not sure if the shifting to the right is an SDL issue or something else with Dolphin. |
|
@jambonmcyeah maybe it's the slightly communication differences between DualShock 4 v1 and v2 bitting again? The v2 (the one I have) is the newer model released with the PS4 Slim, that has the light bar visible through the touchpad, v1 is the model that launched with the PS4 "fat". PR #7614 also exhibited different behavior depending of the DualShock 4 model... |
|
The one I have seems to be the V2 version which may explain things. |
|
Also for the shifting problem I have it as well with the gyroscope. Have no idea what's causing the problem |
|
It shouldn't be SDL's problem since from my testing it doesn't seem to happen with other emulator which uses SDL like yuzu and cemu. |
|
Is this still being worked on? |
|
Sdl2 gamepad also works on linux so I would like to suggest to also enable it on linux as well. I am playing mario odyssey right now with my pro controller, rumble and motion work without joycond and hidnintendo kernel modules. |
|
@infirit If enabled on Linux, this would render evdev nodes of controller unusable due to limits of HIDAPI. While I understand that not needing to install hid_nintendo is handy, breaking working approach is not nice. In addition, on Linux SDL does not build with HIDAPI support by default (it would need to be explicitly enabled during build like it's done in yuzu) exactly to avoid conflict with evdev, so that's something to consider as well. Becuase dolphin already supports evdev motion, only hid_nintendo is needed. Joycond and joycond-cemuhook are not. |
|
While this gets rid of the need for cemuhook and better joy would it also be able to handle TN a wiimotes better since syncing is a problem? |
Looks like native support for switch controllers will land in Linux 5.16, so you won't even need an extra kernel module. It will just work with dolphin's evdev. |
e550e3b
to
f391ce0
Compare
| @@ -42,6 +42,9 @@ | |||
| <Manifest> | |||
| <AdditionalManifestFiles>DolphinQt.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> | |||
| </Manifest> | |||
| <PostBuildEvent> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a Copy task instead (see the end of this file , and add it there)
| @@ -22,6 +22,11 @@ | |||
| <ImportGroup Condition="'$(Platform)'=='ARM64'"> | |||
| <Import Project="DolphinLib.ARM64.props" /> | |||
| </ImportGroup> | |||
| <ItemDefinitionGroup> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this belongs in base.props
| @@ -24,6 +24,9 @@ Source/Core/Common/scmrev.h | |||
| *.VC.db | |||
| .vs*/ | |||
| /Source/enc_temp_folder/ | |||
| /Source/x64 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed (after changing to own vcxproj file)
| @@ -30,6 +30,9 @@ | |||
| <AdditionalLibraryDirectories Condition="'$(Platform)'=='x64'">$(ExternalsDir)ffmpeg\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | |||
| <SubSystem>Console</SubSystem> | |||
| </Link> | |||
| <PostBuildEvent> | |||
| <Command>copy /Y "$(SolutionDir)$(Platform)\$(Configuration)\SDL2.dll" "$(OutDir)"</Command> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|ARM64 = Debug|ARM64 | ||
| Debug|x64 = Debug|x64 | ||
| Debug|x86 = Debug|x86 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert these x86 additions, remove x86 config from sdl
|
tbh I'm not a fan of adding sdl, but i made some comments for improvements of the pr anyway edit: ah, i missed that you're using their vcxproj file from the submodule. unfortunately you need to make a version of the vcxproj file modeled after other things in Externals and use that instead. with that in place, can also just staticly link it. |
|
this PR should be closed now |
I don't know if it's relevant, but on other emulators, SDL for gamepads is enabled under Linux too. |
Add motion input and rumble support for the SDL controller interface, inspired by yuzu-emu/yuzu#6244. This is useful for Windows and MacOS users since it removes the need to have a DSU server to get motion input.