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 - SDL and Steam fight over state of Switch Pro Controller
Summary: SDL and Steam fight over state of Switch Pro Controller
Status: WAITING
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.1
Hardware: x86 Windows 10
: P2 critical
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-13 22:34 UTC by Austin Palmer
Modified: 2019-12-03 12:00 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?