protonscr

Incorrect button mapping for Sony DS4 over Steam Link from Android

steamopen StreamingGeneral controller / Steam Input
ValveSoftware/steam-for-linux#6682 · opened 2019-11-11 by cschreib · updated 2019-11-24 · 3 comments · github
Ccschreib 2019-11-11 github

Your system information

  • Steam client version (build number or date): Nov 6 2019 at 03:10:31
  • Distribution (e.g. Ubuntu): Linux Mint 19.2
  • Opted into Steam client beta?: No
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

I have the following setup:

  • Host: Linux Mint 19.2, on Wifi
  • Client: Android 9 tablet (Samsung Galaxy Tab S4), on Wifi
  • Controller: Sony DS4 connected to the tablet (via Bluetooth or USB)

I have just started trying to play my games on the tablet using that setup. I am able to connect to Steam on the host machine using the Android Steam Link app. The controller is correctly recognized, in that I can use it to navigate in Steam Big Picture menus and use the controller in two other games I have currently installed (Hollow Knight and Celeste). However, for one of the games (Cross Code) the button mapping is incorrect, which makes the game unplayable (the game does not allow remapping buttons). In particular, while the left analog stick is mapped correctly, the right analog stick and the d-pad are non-functional (the d-pad doesn't seem to do anything, and the right analog stick seems to only register vertical movements, and only as "full up" or "full down", with no in-between). Connecting the DS4 directly to the host via USB works flawlessly (all the buttons are mapped as expected and I can play the game). Unfortunately I do not own a Windows license, so I cannot check if the problem also occurs with a Windows host.

Exploring the Cross Code discussion on Steam, it seems their game uses the HTML5 controller API and they have no control over button mapping. I do not know of any other game making use of that API, so I cannot test if this HTML5 API is the culprit. When I open html5gamepad.com on the tablet (in it's native browser, not through Steam Link), all the mappings are correct. When I try to open that same page through the Link, it says no controller detected.

Steps for reproducing this issue:

  1. Install Steam Link on Android device
  2. Pair Sony DS4 Controller to Android device via Bluetooth, or plug it in via USB
  3. Start Steam on Linux host
  4. Initiate Steam Link session
  5. Make sure Steam Link sees the DS4 controller
  6. Start playing Cross Code (or other HTML5 games? to be confirmed)
  7. Observe how button mapping is incorrect compared to playing on the host directly with the same controller via USB
Ccschreib 2019-11-22 github

Based on what I could read of the HTML5 API, it seems the API provides a "standard" mapping for controllers that it manages to identify (with vendor ID and such).

https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API

Controllers not recognized by the API must be mapped by the game explicitly. So I guess it has to do with Steam Link creating an input device on the host that is not in the list of known controllers of the HTML5 API.

Any suggestion on how I could get more information on that input device to confirm this?

Ccschreib 2019-11-22 github

Here is what I get if I run jstest-gtk on the host with Steam Link running and the controller paired with the tablet on Bluetooth:
Screenshot from 2019-11-22 17-24-11

It I then plug in the controller directly to the host via USB I get:
Screenshot from 2019-11-22 17-25-15

NB: I do not have an XBox controller. It is a fake device created by Steam (if I close Steam, the device disappears).

In that last setup, I can get the HTML5 Gamepad Tester webpage to recognize the controller as "054c-05c4-Sony Computer Entertainment Wireless Controller". Paired to the tablet, I can also get it recognized in the tablet's browser as just "android" (but it all works). However through Steam Link (on the host browser) it does not register at all, even if I launch CrossCode and Alt+Tab to the webpage.

Ccschreib 2019-11-24 github

Update: just checked the issue also happens when the controller is connected to the tablet via an on-the-go USB cable, so the problem is not related to Bluetooth.

Nothing extracted yet.