mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-18 15:51:44 +00:00
Wait a bit for devices to initialize before trying to enumerate and open them.
This works around udev event nodes arriving before hidraw nodes and the controller being opened twice - once using the Linux driver and once by the HIDAPI driver. This also fixes a kernel panic on Steam Link hardware due to trying to open the hidraw device node too early. A delay of 10 ms seems to be a good value, tested on Steam Link hardware.
This commit is contained in:
@@ -267,6 +267,10 @@ static void joystick_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_clas
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Wait a bit for the hidraw udev node to initialize */
|
||||
SDL_Delay(10);
|
||||
|
||||
MaybeAddDevice(devpath);
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user