Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

phire
Copy link
Member

@phire phire commented Jun 29, 2015

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.

namespace evdev
{

void Init(std::vector<Core::Device *> &controllerDevices)

This comment was marked as off-topic.

@CrossVR CrossVR added this to the Dolphin Release 5.0 milestone Jun 29, 2015
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.

std::string evdevDevice::ForceFeedback::GetName() const
{
// We have some default names.
switch(m_type)

This comment was marked as off-topic.

@phire phire force-pushed the evdev branch 2 times, most recently from af37983 to c9befb5 Compare June 29, 2015 12:05
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.

@CrossVR
Copy link
Contributor

CrossVR commented Jun 30, 2015

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.

@phire
Copy link
Member Author

phire commented Jun 30, 2015

@Parlane Could you please install libevdev-dev on the ubuntu buildbots?

phire added 2 commits July 1, 2015 07:35
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.
@randomstuff
Copy link
Contributor

Tested on Debian testing with ThrustMaster, Inc. Dual Trigger 3-in-1 (PC Mode). It's seems to be working well (including rumble).

@CrossVR
Copy link
Contributor

CrossVR commented Jun 30, 2015

@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.

This comment was marked as off-topic.

This comment was marked as off-topic.

@phire
Copy link
Member Author

phire commented Jun 30, 2015

This PR has also been tested with

  • Dual Shock 3
  • Dual Shock 4
  • Older MayFlash Gamecube Adapter
  • Mayflash DolphinBar (in mode 3). There were some issues which have been reported upstream to linux.
  • Random XInput Logitech controller, via xboxdrv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants