-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
ControllerInterface: Fix crashes when using SDL controllers #4343
Conversation
Wiimote::Initialize(reinterpret_cast<void*>(win), | ||
Wiimote::InitializeMode::DO_NOT_WAIT_FOR_WIIMOTES); | ||
HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(win)); | ||
void *win = reinterpret_cast<void*>(X11Utils::XWindowFromHandle(GetHandle())); |
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.
Wiimote::Initialize(reinterpret_cast<void*>(GetHandle()), | ||
Wiimote::InitializeMode::DO_NOT_WAIT_FOR_WIIMOTES); | ||
HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(GetHandle())); | ||
void *win = reinterpret_cast<void*>(GetHandle()); |
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.
void ControllerEmu::RefreshDevices() | ||
{ | ||
ControllerInterface face; | ||
UpdateReferences(face); |
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.
9086415
to
6d4e400
Compare
Aren't these changes duplicated in one of your more recent PRs? |
@dolphin-emu-bot rebuild |
{ | ||
if (!m_is_init) | ||
return; | ||
|
||
Shutdown(); | ||
Initialize(m_hwnd); | ||
m_devices.clear(); |
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.
m_devices.clear(); | ||
|
||
#ifdef CIFACE_USE_DINPUT | ||
ciface::DInput::GetDevices((HWND)m_hwnd); |
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.
@@ -184,6 +184,12 @@ void Init() | |||
StartHotplugThread(); | |||
} | |||
|
|||
void GetDevices() |
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.
@@ -15,6 +15,7 @@ namespace ciface | |||
namespace evdev | |||
{ | |||
void Init(); | |||
void GetDevices(); |
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.
b2dbf84
to
ee859c1
Compare
@dolphin-emu-bot rebuild |
Reviewed 5 of 24 files at r2, 1 of 1 files at r3, 2 of 2 files at r4. Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp, line 187 at r3 (raw file):
|
Review status: 2 of 21 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp, line 187 at r3 (raw file):
|
@dolphin-emu-bot rebuild Reviewed 7 of 19 files at r5. Comments from Reviewable |
The SDL backend faults if it tries to close a joystick after SDL_Quit has been called.
The SDL backend crashes when you close a joystick after SDL_Quit has been called. Some backends don't need to be shutdown and re-initialized everytime, we can just ask to enumerate devices again.
Rebased on master and fixed conflicts. |
If nobody has any more comments in a couple hours I'll merge this. @dolphin-emu-bot rebuild Reviewed 1 of 24 files at r2, 18 of 19 files at r5, 2 of 3 files at r6. Comments from Reviewable |
OS: I can confirm it was commit 3e69d06. Here is a backtrace of the hang. |
It seems to wait for the hotplug thread to stop, but it's stuck in select() waiting for an event, even though we wrote to the eventfd to wake up the thread… I can't manage to reproduce it, with libevdev 1.5.5. flacs can reproduce it consistently though with the same libevdev version. Not sure why/how 3e69d06 introduced this issue… |
I can't reproduce either, on Debian Jessie amd64 (libudev1 215-17+deb8u5 / libevdev2 1.3+dfsg-1). What is "flacs"? |
flacs is @Tilka. |
Pushed some stuff into my evdev branch, still need to make s_devnode_name_map threadsafe, feel free to cherrypick or whatever. |
Couple changes across the codebase, the end result should be that no handles to controllers exist after
ControllerInterface::Shutdown
is called.This change is