We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4861

Summary: SDL and Steam fight over state of Switch Pro Controller
Product: SDL Reporter: Austin Palmer <austinp>
Component: joystickAssignee: Sam Lantinga <slouken>
Status: WAITING --- QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2 CC: sezeroz
Version: HG 2.1   
Hardware: x86   
OS: Windows 10   

Description Austin Palmer 2019-11-13 22:34:53 UTC
When Steam is running it will try to set the state of a Switch controller in either extended or normal mode based on whether the current focused window is opted in or out of Steam Input. The reason this is done is that over USB the device doesn't send input reports at all until initialized but when the controller is in the extended mode Dinput will be broken and receive lots of random buttons/axis inputs. We want games to be able to read from the device when required without breaking other games by leaving the device in the wrong state.

SDL right now always tries to set the state of the controller to extended mode - which provides gyro and an extended format for the joystick. Since SDL doesn't read the gyro it'd be nice if it detected the state when opening the controller and only ran initialization when required - which to my understanding should only be if the device is connected over USB and not yet initialized by Steam. The shutdown code might also need to conditionally not run if another process is trying to use the controller.


Bug report from dev about Steam/SDL fighting:
https://steamcommunity.com/groups/steamworks/discussions/22/1676938384243676229/
Comment 1 Sam Lantinga 2019-11-17 06:53:03 UTC
Any suggestions on how to detect whether initialization is necessary?