Fixed bug 5010 - SDL_Init with SDL_INIT_JOYSTICK hangs for 10 seconds when playing audio from another application
authorSam Lantinga <slouken@libsdl.org>
Mon, 02 Mar 2020 17:31:58 -0800
changeset 1358388068887c25d
parent 13582 85c4a2f0464d
child 13584 fcecab4713f7
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
src/joystick/SDL_joystick.c
     1.1 --- a/src/hidapi/windows/hid.c	Mon Mar 02 15:24:10 2020 -0800
     1.2 +++ b/src/hidapi/windows/hid.c	Mon Mar 02 17:31:58 2020 -0800
     1.3 @@ -310,6 +310,12 @@
     1.4  		return 1;
     1.5  	}
     1.6  
     1.7 +	// Sound BlasterX G1 - Causes 10 second stalls when asking for manufacturer's string
     1.8 +	if ( vendor_id == 0x041E && product_id == 0x3249 )
     1.9 +	{
    1.10 +		return 1;
    1.11 +	}
    1.12 +
    1.13  	return 0;
    1.14  }
    1.15  
     2.1 --- a/src/joystick/SDL_joystick.c	Mon Mar 02 15:24:10 2020 -0800
     2.2 +++ b/src/joystick/SDL_joystick.c	Mon Mar 02 17:31:58 2020 -0800
     2.3 @@ -1687,13 +1687,10 @@
     2.4  
     2.5  SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid)
     2.6  {
     2.7 -    /* This list (except for marked entries at the top) is taken from:
     2.8 +    /* This list is taken from:
     2.9         https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/generate_rules.py
    2.10       */
    2.11      static Uint32 joystick_blacklist[] = {
    2.12 -        /* Sound BlasterX G1 */
    2.13 -        MAKE_VIDPID(0x041E, 0x3249),
    2.14 -
    2.15          /* Microsoft Microsoft Wireless Optical DesktopĀ® 2.10 */
    2.16          /* Microsoft Wireless Desktop - Comfort Edition */
    2.17          MAKE_VIDPID(0x045e, 0x009d),