From 07000bfc331448ce03e56b67de45cde3eb9e45aa Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 2 Mar 2020 17:31:58 -0800 Subject: [PATCH] Fixed bug 5010 - SDL_Init with SDL_INIT_JOYSTICK hangs for 10 seconds when playing audio from another application Jake Breen I have tracked it down to a call on hid_device_info() -> HidD_GetManufacturerString (Line 499 in src\hidapi\windows\hid.c) --- src/hidapi/windows/hid.c | 6 ++++++ src/joystick/SDL_joystick.c | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hidapi/windows/hid.c b/src/hidapi/windows/hid.c index f7069118d49cd..a70b23e3f910c 100644 --- a/src/hidapi/windows/hid.c +++ b/src/hidapi/windows/hid.c @@ -310,6 +310,12 @@ int hid_blacklist(unsigned short vendor_id, unsigned short product_id) return 1; } + // Sound BlasterX G1 - Causes 10 second stalls when asking for manufacturer's string + if ( vendor_id == 0x041E && product_id == 0x3249 ) + { + return 1; + } + return 0; } diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 5f74ec4d6ac6b..406d148e332ce 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -1687,13 +1687,10 @@ static SDL_bool SDL_IsPS4RemapperRunning(void) SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid) { - /* This list (except for marked entries at the top) is taken from: + /* This list is taken from: https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/generate_rules.py */ static Uint32 joystick_blacklist[] = { - /* Sound BlasterX G1 */ - MAKE_VIDPID(0x041E, 0x3249), - /* Microsoft Microsoft Wireless Optical DesktopĀ® 2.10 */ /* Microsoft Wireless Desktop - Comfort Edition */ MAKE_VIDPID(0x045e, 0x009d),