From 956f6cfbd263498136ccaa573484a954d4eaf983 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sat, 27 Sep 2025 02:43:45 -0500 Subject: [PATCH 1/2] SDL: Name the hotplug thread. --- Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index da6e829bd1..f530c98730 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -16,6 +16,7 @@ #include "Common/Event.h" #include "Common/Logging/Log.h" #include "Common/ScopeGuard.h" +#include "Common/Thread.h" #include "InputCommon/ControllerInterface/ControllerInterface.h" #include "InputCommon/ControllerInterface/SDL/SDLGamepad.h" @@ -139,6 +140,8 @@ InputBackend::InputBackend(ControllerInterface* controller_interface) SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED, "0"); m_hotplug_thread = std::thread([this] { + Common::SetCurrentThreadName("SDL Hotplug Thread"); + Common::ScopeGuard quit_guard([] { // TODO: there seems to be some sort of memory leak with SDL, quit isn't freeing everything up SDL_Quit(); From c11132d2a602a3efe1a63aa4ebdbe6569d199189 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sat, 27 Sep 2025 02:44:20 -0500 Subject: [PATCH 2/2] SDL: Disable DirectInput handling to work around hangs with the "8BitDo Ultimate 2" controller. --- Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index f530c98730..2778066084 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -139,6 +139,12 @@ InputBackend::InputBackend(ControllerInterface* controller_interface) // Disable DualSense Player LEDs; We already colorize the Primary LED SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED, "0"); + // Disabling DirectInput support apparently solves hangs on shutdown for users with + // "8BitDo Ultimate 2" controllers. + // It also works around a possibly related random hang on a IDirectInputDevice8_Acquire + // call within SDL. + SDL_SetHint(SDL_HINT_JOYSTICK_DIRECTINPUT, "0"); + m_hotplug_thread = std::thread([this] { Common::SetCurrentThreadName("SDL Hotplug Thread");