steam-for-linux icon indicating copy to clipboard operation
steam-for-linux copied to clipboard

Duplicated joystick events when using a DualSense with Steam Input and the Playstation configurator enabled

Open Steffo99 opened this issue 4 years ago • 28 comments

Your system information

  • Steam client version (build number or date): Sep 3 2021, at 21:49:55
  • Distribution (e.g. Ubuntu): Arch Linux
  • Opted into Steam client beta?: 🧪 Yes
  • Have you checked for system updates?: ✅ Yes

The issue in brief:

While using Steam Input with a DualSense, an emulated controller is created, but the original one is never disabled, causing some games to receive controller events twice from two different devices.

Please describe your issue in as much detail as possible:

Today I connected a DualSense controller and tried to play Hollow Knight using Steam Input, but I immediately noticed something was wrong: the game interpreted a button press sometimes as a X press and sometimes as a Y press!

After some troubleshooting using sdl2-jstest, I found out that the game accepts input from all devices connected to the system, and that the DualSense sends two events with every button press: once through the original evdev device (/dev/input/device28) and once through Steam Input.

I tested more games, and found that the same problem appeared elsewhere, such as in Assault Android Cactus+, where two players are added to the game when start is pressed only once.

I then tested with different controllers: everything worked fine with:

  • a Steam Controller
  • a Xbox One Controller
  • two different generic controllers.

I later asked a friend with a DualSense, Arch Linux and Hollow Knight to check if the same thing was happening to him and he encountered the same problem as me.

Steps for reproducing this issue:

  1. Connect a DualSense
  2. Enable the Playstation Configurator Support
  3. Try playing a game such as Hollow Knight

A temporary solution:

Scrolling through the Gamepad page on ArchWiki, which suggested using xboxdrv to obtain the same result as Steam Input, I read an interesting line:

Some apps, for example, Steam inside Geforce NOW inside web browser, may be confused with original joystick events, which shadow the newly created event source. Simply deletion of /dev/input/js0 works this around.

This gave me an idea: what would happen if I deleted the /dev/input/event* files of my DualSense?

# rm /dev/input/event28 /dev/input/event29 /dev/input/event30

Since Steam uses hidraw, the Steam Input controller kept working, while the evdev joystick was correctly disabled!

Wanting to find a cleaner solution, I found python-evdev, and was able to prevent the problem from happening by grab bing the problematic evdev devices:

import evdev
ev28 = evdev.device.InputDevice("/dev/input/event28")
ev28.grab()
ev29 = evdev.device.InputDevice("/dev/input/event29")
ev29.grab()
ev30 = evdev.device.InputDevice("/dev/input/event30")
ev30.grab()

Steffo99 avatar Sep 06 '21 23:09 Steffo99

How is the DualSense controller connected? USB or Bluetooth? It seems odd that you'd get 3 /dev/input devices for a single controller being connected.

slouken avatar Sep 08 '21 03:09 slouken

This happens both via USB and Bluetooth. Actually, I get 5 /dev/input devices by connecting the DualSense (they get listed in by-id only if I connect it via USB, though):

lrwxrwxrwx 1 root root  10  8 set 10.36 usb-Sony_Interactive_Entertainment_Wireless_Controller-event-if03 -> ../event29
lrwxrwxrwx 1 root root  10  8 set 10.36 usb-Sony_Interactive_Entertainment_Wireless_Controller-if03-event-joystick -> ../event28
lrwxrwxrwx 1 root root  10  8 set 10.36 usb-Sony_Interactive_Entertainment_Wireless_Controller-if03-event-mouse -> ../event30
lrwxrwxrwx 1 root root   6  8 set 10.36 usb-Sony_Interactive_Entertainment_Wireless_Controller-if03-joystick -> ../js0
lrwxrwxrwx 1 root root   9  8 set 10.36 usb-Sony_Interactive_Entertainment_Wireless_Controller-if03-mouse -> ../mouse2

I'm not sure, but I think that the event28, event29 and event30 devices correspond:

  • if03-event-mouse to the touchpad
  • event-if03 to the gyroscope
  • if03-event-joystick to the controller itself

Steffo99 avatar Sep 08 '21 08:09 Steffo99

Interesting. I only get the joystick entries here. What kernel version are you running?

slouken avatar Sep 08 '21 16:09 slouken

I'm currently on 5.13.13-arch1-1.

Steffo99 avatar Sep 08 '21 16:09 Steffo99

Okay, I upgraded to 5.14.2, and I'm seeing the additional device entries and am seeing the same problem.

Thanks!

slouken avatar Sep 08 '21 17:09 slouken

I upgraded to 5.14.3-arch1-1, and the gamepad behaviour seems to have changed again.

Now it seems to... interpret each button differently? In Hollow Knight everything gets read as a "Back" button press, while Crawl seems to have the shuffled button mappings that Hollow Knight used to have.

The mouse-touchpad doesn't work anymore, and bluetooth connections are closed by the controller after a few seconds.

Interestingly enough, the controller works perfectly while wired and with Steam in Big Picture, having trouble only when a game is started...

Steffo99 avatar Sep 17 '21 01:09 Steffo99

Can you retry this in the current beta (dated Sep 23 or newer?)

slouken avatar Sep 23 '21 15:09 slouken

The first problem with Hollow Knight seems to be still happening, while Assault Android Cactus works correctly! :rocket:

Please tell me if there's any debug information I can provide to help diagnose the first bug :)

Steffo99 avatar Sep 23 '21 15:09 Steffo99

I just tested with the Windows version of Hollow Knight (via Proton Experimental) and the controller works fine.

I'm starting to think that the first one is a bug with the Linux build of the game and not Steam Input...

(It wouldn't be the first: the Linux build also has broken cloud saves, no VSync or frame limit, and broken controller remapping...)

Steffo99 avatar Sep 23 '21 15:09 Steffo99

Should I close this?

Steffo99 avatar Sep 28 '21 01:09 Steffo99

Yes, go ahead and close this. Thanks!

slouken avatar Sep 29 '21 23:09 slouken

@Steffo99 Has this regressed for you? I'm experiencing the same issue with a Bluetooth-connected DualSense, but with a different game (Lego Jurassic World).

~~The only thing I haven't checked yet is whether deleting/grabbing the specific /dev/input/event/* files for the controller fixes the issue, since I don't see any entries for the controller in the output of ls /dev/input/by-id/ or ls /dev/input/by-path/.~~

EDIT: Hmm, the controller shows up in /proc/bus/input/devices but deleting the corresponding entries in /dev/input/ didn't solve the issue, so I wonder if it's a different issue...

>cat /proc/bus/input/devices  | grep -P '^[NH]: ' | paste - - 
...
N: Name="Wireless Controller"	H: Handlers=event29 js2 
N: Name="Wireless Controller Motion Sensors"	H: Handlers=event30 js3 
N: Name="Wireless Controller Touchpad"	H: Handlers=event31 mouse2

ammgws avatar Dec 25 '21 08:12 ammgws

I can confirm that the problem seems to be back, but I haven't checked if the cause was the same or not.

I am reopening this issue so that the problem may hopefully be fixed.

Steffo99 avatar Dec 30 '21 10:12 Steffo99

I also can confirm that this issue is present on Manjaro 21.2.1 (kernel 5.15.12) with Steam Client ver. 1639697812. I experience issues in some unity games (namely Monster Prom and Monster Prom 2: Monster Camp) that access those original devices via UnityEngine.Input.GetJoystickNames(), which leads to incorrect behavior(incorrect controller to player assignment) or even crashes. Removing /dev/input/event* files fixes those issues but it's pretty ugly(using python-evdev to grab devices doesn't work).

Komoszek avatar Jan 04 '22 13:01 Komoszek

If it is helpful, I'm currently on the kernel 5.15.12-arch1-1.

Steffo99 avatar Jan 04 '22 15:01 Steffo99

After further testing I've found that on newer kernels (e.g. 5.15) hid-playstation module is automatically loaded when you connect DualSense controller. Blacklisting this module helps with some issues like duplicated touchpad movements in desktop, but it doesn't fix issues in Unity where DualSense gets listed twice when using UnityEngine.Input.GetJoystickNames() (which I think is more of a Steam and not Unity issue?).

Komoszek avatar Jan 05 '22 10:01 Komoszek

I believe I'm having the same issue. In Rocket League for example, if I press the "Options" key on the PS4 controller it adds a second player. Interestingly if I go to the options, you see options for both players and the primary player has xbox button icons, the newly added player has playstation icons:

image

They both act simultaneously on the same press (for example pressing R1 moves both settings screens to the next tab).

I'm seeing similar issues in other games. Red Dead Redemption 2 shows xbox button icons but when I press something on the controller it switches to playstation icons, when I release, it switches back to xbox button icons.

Lovers in a Dangerous Spacetime shows two controllers as well.

My point is that it is not related to the game I chose, but how Steam / Linux handles input from this controller. My guess is that these games see both the original PS4 input device, as well as the simulated controller from Steam. I suppose steam is supposed to hide the original PS4 input device, but it doesn't seem to work? I'm fairly sure I had the exact same configuration earlier, which seemed to work. No clue what has changed.

I haven't really found a solution to this yet. I tried disabling the hid_sony kernel module, but then Steam is not aware of any controller connected. I tried disabling PlayStation Configuration Support in Steam which works quite well for most games (interestingly the icons are then still xbox icons; since it is passing the raw playstation controller as input I was expecting it would show playstation icons). However some games (Flat Heroes) seem to have completely wrong keybindings (R2 seems to be left / right for example). In addition I like the configuration I get within Steam, so I prefer to enable Playstation Configuration Support if possible.

My system: Arch Linux kernel: 5.16.4-arch1-1 (also tried LTS 5.15-18-1 and LTS 5.10.95-1). Steam (runtime) package versions: 1642451672 (also tried Steam Beta). PS4 DualSense4 controller over bluetooth (also tried USB).

Controller settings in Steam: image

(note: no double controllers are listed there)

hgaiser avatar Jan 31 '22 11:01 hgaiser

Hi. I was told that your issue might be the same as mine. Please try this workaround. Edit the game properties for games having problems causes by steam input and add this environment variable.

'SDL_GAMECONTROLLER_IGNORE_DEVICES="0x054c/0x0268,0x2dc8/0x3106" %command%

The device ids can easily be found from lsusb. I don't know what it is for non-usb controllers.

JacobBrownAustin avatar Oct 31 '23 00:10 JacobBrownAustin

Will try soon, both without and with the workaround!

(I kinda have been wanting to get back to completing Hollow Knight...)

Steffo99 avatar Oct 31 '23 17:10 Steffo99

Does not work without the workaround, but does work with the fix!

I wonder what the device id for Bluetooth devices is...

Steffo99 avatar Nov 05 '23 22:11 Steffo99

It's interesting to me that your tried multiple controllers and only see this with Dualsense. I've been using 2 Sixaxis controllers for many years and never ran into problems until I got an 8bitdo Ultimate and immediately had this problem. Once I found this sdl env variable workaround for it, my Sixaxis had the same problem even though I've never seen it before, so if I want to play multiplayer and my 8bitdo is plugged in, then I have to add both devices to the sdl env variable to ignore. I'm pretty sure that the big is inside steam somewhere in the steam input.

JacobBrownAustin avatar Nov 06 '23 00:11 JacobBrownAustin

Hi!

I'm currently experiencing this issue. I only started using CachyOS for about a month, and the only games I noticed this issue were actually on the Final Fantasy Pixel Remasters, which I found out were Unity Games.

RJQuitugua avatar Jul 30 '25 17:07 RJQuitugua

Was having issues with yakuza 3 remastered seeing my duelsense controller instead of using the steam controller interface. Found this on reddit after digging thru tons of ai crap during my search online.

https://www.reddit.com/r/linux_gaming/comments/1h9v2r8/is_there_a_way_to_hide_a_controller_from_a_game/

~~Run: protontricks 1088710 --gui Select default wineprefix and choose explorer. Navigate to C:\windows\syswow64 Launch control.exe, open Game Controllers and move everything to disabled.~~ Edit: Found better way look below...

Once I disabled the dualsense controller and left the"360 pad" active, everything works now. Proton/wine needs to sense that steam controller interface is being used and block the source controller from getting thru.

TheRealYasri avatar Aug 02 '25 21:08 TheRealYasri

That sounds a lot more complicated than just setting SDL_GAMECONTROLLER_IGNORE_DEVICES once you know the USB vendor & device ids, but glad it works for you.

JacobBrownAustin avatar Aug 03 '25 02:08 JacobBrownAustin

That sounds a lot more complicated than just setting SDL_GAMECONTROLLER_IGNORE_DEVICES once you know the USB vendor & device ids, but glad it works for you.

That might work for sdl games, but mine should be universal.


I figured out how to do it easier...

protontricks -l

Find your game and the id number next to the name

protontricks -c 'wine control joy.cpl' GAMEIDHERE

Then pick the controller you want to disable.


Be nice if there was a way in the games properties in steam to access panels like this. Took me way to long to figure out the needed command to jump to the right panel needed.

TheRealYasri avatar Aug 04 '25 08:08 TheRealYasri

I just set up Bazzite on my gaming PC and it's having this double input issue with Dualshock 4. I don't get it. How can a gaming distro exist and not work with one of the most popular controllers?

phly95 avatar Nov 27 '25 05:11 phly95

@phly95 What game did you encounter this issue in?

Steffo99 avatar Nov 27 '25 06:11 Steffo99

@phly95 What game did you encounter this issue in?

Sonic and All-stars Racing Transformed, but also in the Steam game mode UI. This was on Bazzite. I did end up fixing it with these three commands that Gemini (Google AI) came up with (Though a human solution can also be found here https://github.com/libretro/ludo/issues/273 ):

sudo nano /etc/udev/rules.d/51-disable-ds4-motion.rules

# Disable DS4/DS5 Motion Sensors from being treated as a Joystick
# (This hides the extra /dev/input/js* node)

SUBSYSTEM=="input", ATTRS{name}=="*Motion Sensors", ENV{ID_INPUT_JOYSTICK}=""
SUBSYSTEM=="input", ATTRS{name}=="*Motion Sensors", ENV{ID_INPUT_ACCELEROMETER}=""

sudo udevadm control --reload-rules && sudo udevadm trigger


I think I also disabled the touchpad as mouse earlier, so that may be needed as well.


sudo nano /etc/udev/rules.d/72-ds4-touchpad.rules

# Disable DS4 touchpad acting as a system mouse (USB)
ATTRS{name}=="Sony Interactive Entertainment Wireless Controller Touchpad", ENV{LIBINPUT_IGNORE_DEVICE}="1"

# Disable DS4 touchpad acting as a system mouse (Bluetooth)
ATTRS{name}=="Wireless Controller Touchpad", ENV{LIBINPUT_IGNORE_DEVICE}="1"

sudo udevadm control --reload-rules && sudo udevadm trigger


phly95 avatar Nov 28 '25 19:11 phly95