Silksong on Linux controller fix
Background
On the native Linux version of Silksong, the game acts very strangely once you
get abilities using the right or left triggers. This includes, but is not
limited to, the 8BitDo Ultimate 2C Wireless controller.
The game is normal on startup before right trigger has ever been pressed. Once
it has been pressed, it seems to activate on a soft pull and not deactivate, or
briefly deactivate then reactivate unpredictably. When Hornet climbs up a ledge,
Swift Steps will be reactivated even if it is off and the button is not pressed
in.
The same issue affected Hollow Knight, with the Crystal Dash ability. However,
this could be worked around by setting the SDL_DYNAMIC_API environment variable
in the launch options in Steam. For example:
SDL_DYNAMIC_API=/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 %command%
The same does not work in Silksong, however. Occurrences of SDL_DYNAMIC_API
are present in UnityPlayer.so in Hollow Knight, but not in Silksong. Running
Hollow Knight with LD_DEBUG on with no launch options results in no mention of
SDL, indicating a statically linked version was used. With the launch option, it
shows that the library provided is loaded. For Silksong, no system SDL is
loaded, whether or not an SDL_DYNAMIC_API or SDL3_DYNAMIC_API environment
variable is set.
Fix
Requirements:
- SDL3
- gcc, or another C compiler
In the file ~/.config/unity3d/Team\ Cherry/Hollow\ Knight\ Silksong/AppConfig.ini, change NativeInput=1 to NativeInput=0.
2. Get SDL3 game controller config and modify it to be compatible with Silksong
For controllers with known configs
Check the known configs page to see if a config for your
controller has already been recorded. If so and the config works, you can skip
the compilation process and proceed to step 3.
For other models
C code is provided that simplifies this as much as possible.
- Acquire the code provided in this repository, either by cloning or by downloading
get_controller_config.c directly
cd into the folder in which you downloaded the C source file.
- Compile the C source:
cc -o get-controller-config get_controller_config.c -lSDL3
- Ensure the controller you want to use with Silksong is connected to you computer and not idle
- Run the program
./get-controller-config
This produces an output like the following:

3. Apply the configuration
If you are using Steam, you can copy the provided launch options string into the
Steam launch options. If you are running Silksong directly, you will need to set
the environment variable for whatever command you are using to start it.
4. Share your configuration (optional)
If your controller was not already in the known configs list and you got a
configuration that worked from running the program provided, feel free to share
it and I will add it to the known configs list!
Acknowledgements
Many thanks to kakonema for finding the fix. C code implementing this provided by me.
评论