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
Linux: Add an evdev based controller backend, to replace SDL. #2675
Conversation
| namespace evdev | ||
| { | ||
|
|
||
| void Init(std::vector<Core::Device *> &controllerDevices) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| if(NOT APPLE) | ||
| include(FindSDL2 OPTIONAL) | ||
| endif() | ||
| if(ENABLE_SDL OR (NOT APPLE AND NOT ANDROID AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT MSVC)) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| std::string evdevDevice::ForceFeedback::GetName() const | ||
| { | ||
| // We have some default names. | ||
| switch(m_type) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
af37983
to
c9befb5
Compare
| add_definitions(-DHAVE_LIBEVDEV=1) | ||
| include_directories(${LIBUDEV_INCLUDE_DIR} ${LIBEVDEV_INCLUDE_DIR}) | ||
| else() | ||
| message("Could find libevdev/libudev, disabling evdev controller backend") |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
I got a report that the xboxdrv package doesn't work with this PR, but it does work with the SDL backend. Could you look into it? |
| add_definitions(-DHAVE_LIBEVDEV=1) | ||
| include_directories(${LIBUDEV_INCLUDE_DIR} ${LIBEVDEV_INCLUDE_DIR}) | ||
| else() | ||
| message(FATAL_ERROR "Couldn't find libevdev and/or libudev. Can't build evdev controller backend") |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Parlane Could you please install libevdev-dev on the ubuntu buildbots? |
Not deleted, because it's the only option for some other operating systems such as FreeBSD or any other slightly exotic operating system someone might try and run dolphin on.
Dolphin uses threads, but never actually pulled them it. Normally some library we depend on would pull threads in, but there are potential builds that forget to pull in threads.
|
Tested on Debian testing with ThrustMaster, Inc. Dual Trigger 3-in-1 (PC Mode). It's seems to be working well (including rumble). |
|
@phire Would you mind rebasing these changes on stable and submitting a new Pull Request? |
|
|
||
| if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | ||
| option(ENABLE_EVDEV "Enables the evdev controller backend" ON) | ||
| endif() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
This PR has also been tested with
|
We were just using a limited subset of SDL, which essentially amounted to a thin wrapper around the evdev interface (/dev/input/eventX) and was causing us some headaches, introducing extra bugs and adding limitations.
Rather than clean things up, it was much easier to just use the evdev backend directly, which is reasonably well documented and very sane.
All other major operating systems stopped using the SDL backend ages ago, choosing to implement their own plugins which directly accessed the interfaces which SDL was also wrapping on those operating systems. With linux being the last major OS of dolphin to use the sdl backend, all of it's cross-platform advantages were rendered pointless.
However, on some operating systems (like the various BSDs) SDL is about the only solution, so this PR doesn't go as far to completely remove SDL.
Fixes 7486, 8630 and potentially other bugs.