Recently I solved an issue for setting up my Wireless (via Bluetooth) controller on Steam for Linux (distr. Ubuntu 18.10), and decided to elaborate my experience a little better, and share my results and observations with you all.
In my previous article on the same topic, I dealt with the basic setup of the driver and the application for games which run natively on Linux. In the following sections I have considered instead the cases of games running with Wine or Proton (via Steam Play).
The relevant steps mentioned in the previous article are the ones that enabled us to launch the xboxdrv with the following command:
$ xboxdrv --evdev "/dev/input/event-asus-gamepad" --config xboxdrv.config
And that consequently enabled us to launch the Steam environment with a similar script:
#!/bin/sh if [ -h /dev/input/event-asus-gamepad ] then # remove any previous instance: killall -KILL xboxdrv # start the new driver in userspace mode: xboxdrv --evdev "/dev/input/event-asus-gamepad" \ --config xboxdrv.config & fi /usr/bin/steam %U
The configuration steps might vary according to the specific input API used in the game implementation.
Games running on Wine/Proton with DirectInput support
Most of the games issued until 2015 used to have support for the DirectInput API, which used to be the first Microsoft API (available in the DirectX library package) to process data from a joystick, or other game controller. Additional information on the API are available in the official Microsoft API documentation.
Few games such as Dark Souls (the original release and the Prepare to Die edition, but not the Remastered), Dark Souls II (both the original and Scholar of the First Sin releases), One Piece Pirate Warriors 3 and several else I tried are actually still using this API.
Before setting up the DirectInput controller configuration, make sure to turn the controller on and launch the xboxdriver as shown in the section above, with the following statement:
$ xboxdrv --evdev "/dev/input/event-asus-gamepad" --config xboxdrv.config
Then, in order to access to the driver setup, you have to run the following command:
$ WINEPREFIX={path to the Wine Prefix for the specific game} wine control
Please keep in mind that in case of use of Steam Play (Proton) the WINEPREFIX is usually the following:
$ export WINEPREFIX=~/.steam/steam/steamapps/compatdata/${GAME_ID}/pfx
and the wine executable to use is under the following path:
~/.steam/steam/steamapps/common/Proton\ ${VERSION}/dist/bin/
where:
- ${GAME_ID} is the Unique App ID of the specific game in the Steam Store (i.e. 211420 for Dark Souls: Prepare to Die, 335300 for Dark Souls II: Scholar of the First Sin, etc.);
- ${VERSION} is the version of Proton that Steam Play uses specifically for that game, available with the following statement:
$ cat .steam/steam/steamapps/compatdata/${GAME_ID}/version
I.e., for "Dark Souls II: Scholar of the First Sin", the wine control statement above would look like this:
$ WINEPREFIX=~/.steam/steam/steamapps/compatdata/335300/pfx/ ~/.steam/steam/steamapps/common/Proton\ 3.16/dist/bin/wine control
Once you launch the wine control statement, select the Game Controllers app from the newly opened window:
In the list, select the entry corresponding to the hardware controller (in my case "ASUS Gamepad") and press Disable, as show in the picture here below:
Press then OK and close the wine control application. This will make sure that DirectInput will get the Input just from the virtual controller defined via the xboxdrv driver.
Open them Steam and run the game to try the applied settings.
Alternatively to the guided procedure above, more skilled users might perform the same activity via the Registry Keys defined for that specific Wine Prefix. All the documentation is available at this link.
Games running on Wine/Proton with Xinput support
Most recent games (such as The Witcher 3: Wild Hunt, Dark Souls Remastered, Dark Souls 3 and generally all the games running just for the Windows 64bit architecture) use the Microsoft Xinput API. Additional information for this API are available in the official Microsoft documentation.
If the Xbox Controller Support has been correctly configured in Steam (as shown in the picture here below), there is nothing else you need to do. The in-game Xinput API will recognise the controller automatically as soon as you press any button or move any axis.
Conclusions
The observations I have collected in these two articles have just the purpose to share my favourite procedure and setup for using the same controller (and keeping the same configuration) in several cases.
I find this procedure particularly useful either if I am looking for a casual gaming day (where I swap between several games in my Steam library) or when I decide to focus for just one of them for the whole day.
The two main reasons I decided to migrate (100% successfully) to a Bluetooth controller are of course the following:
- It's wireless
- It's a standard
But of course feel free to add your own comments and observations about the topic. I'll be pretty glad to answer and discuss about the topic.
I'll have a look for the Arch equivalent, thank you very much, and sorry for the late answer! :)