Emulator Issues #13164
closedAbout SDL controller backend being disabled by default on Linux (ENABLE_SDL)
0%
Description
On the July and August 2022 progress report, it was announced that Dolphin now has a SDL controller backend, with the highlight being multiple controller support and out of the box motion input.
However, Linux doesn't have the CMake argument ENABLE_SDL enabled by default.
The justification for it was written here, with the main points being problems with HIDAPI, and the fact that Linux already supports multiple controllers and motion inputs.
However, in my opinion, evdev is not very plug and play:
- evdev didn't really succeed at standardizing button labels: most notably, BTN_WEST is intuitively the square button on DualShock, but for some reason it's the Y button on Xbox. SDL labels are instead standardized, meaning that if someone uses different controllers, it will be easier to reuse the same configuration for multiple controllers. Also, you can share profiles from/to Windows.
- Motion inputs are even less friendly:
- Often, the IMU device is hidden by default by udev rules (e.g. Nintendo Switch Pro Controller), and fiddling with them isn't exactly what the average user strives for (or, to take a shortcut, you can add the user to the
input
group, but it isn't really recommended). - Even then, you have to map all the axes manually, and adding to the tedium, the axes are not even standardized between controllers.
- Often, the IMU device is hidden by default by udev rules (e.g. Nintendo Switch Pro Controller), and fiddling with them isn't exactly what the average user strives for (or, to take a shortcut, you can add the user to the
Also, with SDL_ENABLE, the evdev device is still visible, meaning that there will be no breakage for existing users. Furthermore, other emulators like DuckStation, PCSX2 (Qt) and Flycast already use SDL for their controller backend.
I don't know however how much of a con are the HIDAPI limitations though, so that's why I'm leaving this as a discussion.
Updated by infinitymdm 11 months ago
SuperSamus wrote:
- SDL labels are instead standardized
- with SDL_ENABLE, the evdev device is still visible
- no breakage for existing users
- other emulators like DuckStation, PCSX2 (Qt) and Flycast already use SDL for their controller backend.
In my opinion, these are great reasons to enable SDL out-of-the-box. Other emulators, such as Cemu, yuzu, citra, etc. all use SDL. Cemu even uses HIDAPI for Wiimote support now, so I wonder if problems with HIDAPI are still a concern.
I ran into this issue today when trying to set up motion controls on Linux using a Switch Pro controller. I ended up recompiling dolphin using -DENABLE_SDL
as a cmake argument, as that was easier than faffing about with udev rules. IMO it's time to enable SDL on Linux builds.
Updated by SuperSamus 11 months ago
FYI, this PR enables it and adds support for the GameController API: https://github.com/dolphin-emu/dolphin/pull/12085.
It still needs some feedback before it can be merged (see the threads in the PR). If you could give some, it would be helpful!