Support us on Patreon to keep GamingOnLinux alive. This ensures all of our main content remains free for everyone. Just good, fresh content! Alternatively, you can donate through PayPal. You can also buy games using our partner links for GOG and Humble Store.
We do often include affiliate links to earn us some pennies. See more here.

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.

Article taken from GamingOnLinux.com.
8 Likes
The comments on this article are closed.
11 comments
Page: 1/2»
  Go to:

afettouhi Jan 27, 2019
Thanks for the guide. A little partly of topic question. I am using my Steam controller mostly for playing games but when I use my controller with a game through proton or wine the screensaver kicks in every 15 minutes, because that is the interval I set it to. How do I get around that issue I am on Arch with KDE btw? I have no issues with native Linux games and the screensaver only wine/dxvk/proton games.
hardpenguin Jan 28, 2019
This is some advanced stuff. For games that only support DirectInput I usually just use Steam Big Picture to map the keyboard buttons to the controller.
Liam Dawe Jan 28, 2019
Quoting: GuestSteam Controller is total trash. I bought that thing a couple of years ago and it only worked for about a moth. Hasn't worked properly since. I tried it out yesterday, after not using it for at least a year, and it works inside steam but not in any games. I tried updating, reverting and recovering firmware and none of it worked. I tried pretty much everything that was suggested by Steam Forums (users only, no comments from Valve).

I hope nobody here gets encourages by this article to buy that piece of crap.
I have two Steam Controllers, used across two different computers and a laptop. Practically never have an issue with it.

If it's not detected in games, sounds like you don't have udev rules setup for it. You can setup that easily by installing steam-devices on Ubuntu, which seriously should be a dependency on the Steam install. I've bugged Canonical about it multiple times.

That, or you may now be experiencing an issue as a result of it now having a driver in the Linux Kernel (noted here.
drmoth Jan 28, 2019
Quoting: GuestSteam Controller is total trash. I bought that thing a couple of years ago and it only worked for about a moth. Hasn't worked properly since. I tried it out yesterday, after not using it for at least a year, and it works inside steam but not in any games. I tried updating, reverting and recovering firmware and none of it worked. I tried pretty much everything that was suggested by Steam Forums (users only, no comments from Valve).

I hope nobody here gets encourages by this article to buy that piece of crap.

I haven't had any problems with it. It's actually really great as a companion to a regular controller, for those games that are keyboard only.
LordDaveTheKind Jan 28, 2019
View PC info
  • Supporter Plus
Quoting: afettouhiThanks for the guide. A little partly of topic question. I am using my Steam controller mostly for playing games but when I use my controller with a game through proton or wine the screensaver kicks in every 15 minutes, because that is the interval I set it to. How do I get around that issue I am on Arch with KDE btw? I have no issues with native Linux games and the screensaver only wine/dxvk/proton games.

It used to happen to me as well. Decided to disable the screensaver at the moment, but I'm looking for a workaround.
LordDaveTheKind Jan 28, 2019
View PC info
  • Supporter Plus
Quoting: hardpenguinThis is some advanced stuff. For games that only support DirectInput I usually just use Steam Big Picture to map the keyboard buttons to the controller.

yes unfortunately the most insidious issue for me was with the triggers and the axes: without any configuration, the RT was mapping the horizontal right axis (and then the camera controls). It was quite some fun to see the whole world spinning around when launching the game.
LordDaveTheKind Jan 28, 2019
View PC info
  • Supporter Plus
Quoting: GuestSteam Controller is total trash. I bought that thing a couple of years ago and it only worked for about a moth. Hasn't worked properly since. I tried it out yesterday, after not using it for at least a year, and it works inside steam but not in any games. I tried updating, reverting and recovering firmware and none of it worked. I tried pretty much everything that was suggested by Steam Forums (users only, no comments from Valve).

I hope nobody here gets encourages by this article to buy that piece of crap.

Hi Feda,
what happens if you try the evtest command? Do you get the expected keys in output for the pressed buttons in input?

$ evtest /dev/input/eventX


Last edited by LordDaveTheKind on 28 January 2019 at 1:05 pm UTC
hardpenguin Jan 28, 2019
Quoting: LordDaveTheKindyes unfortunately the most insidious issue for me was with the triggers and the axes: without any configuration, the RT was mapping the horizontal right axis (and then the camera controls). It was quite some fun to see the whole world spinning around when launching the game.
I remember this issue when I tried to map keys for GTA: San Andreas. I finally discovered a solution although I forgot what was it. It is somewhere in my GTASA Big Picture controller settings :P
officernice Jan 28, 2019
Sorry to totally hijack this... but have anyone had any success with wireless controller for Kodi?
LordDaveTheKind Jan 29, 2019
View PC info
  • Supporter Plus
Quoting: officerniceSorry to totally hijack this... but have anyone had any success with wireless controller for Kodi?

Hi officernice,
I have never used Kodi with a controller before honestly, but I did some checks today.

It seems that the package kodi-peripheral-joystick is missing in the Ubuntu 18.10 official repository. I had to install the Kodi release coming from the development team:

$ sudo add-apt-repository ppa:team-xbmc/ppa
$ sudo apt-get update


I've turned on my gamepad and then run the xboxdrv driver with the same configuration:

$ xboxdrv --evdev /dev/input/event-asus-gamepad --config ~/.config/xboxdrv/native.conf & 

And launched Kody. In the menu Settings / System / Input, I've configured the "Xbox controller (userspace driver)" as a Kodi controller and checked each key mapping. And it worked.


Last edited by LordDaveTheKind on 29 January 2019 at 6:34 pm UTC
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.