protonscr

Bug related to Mikrontek/DragonRise USB Gamepad

protonclosed
ValveSoftware/Proton#3502 · opened 2020-02-09 by mberndt123 · updated 2020-02-09 · 1 comments · github
Mmberndt123 2020-02-09 github

Hi,

I recently bought a gamepad off eBay, and it doesn't work correctly on Proton. The problem is that Proton is confused about the axis of the right analog stick. The easiest way to reproduce this is using the Proton control panel. Run these commands to launch the control panel (you'll need to replace the user name and game ID, but any game will do):

export STEAM_COMPAT_DATA_PATH=/home/matthias/.local/share/Steam/steamapps/compatdata/24740/pfx
"/home/matthias/.local/share/Steam/steamapps/common/Proton 5.0/proton" run control

Click on the game controller icon and then select the "test joystick" tab. There are four squares here that are labelled (X, Y), (Rx, Ry), (Z, Rz) and (POV) respectively. There's a dot in each of these that represents the position of the corresponding analog stick. When I move the left analog stick, the dot in the (X, Y) box moves accordingly, e. g. I push it up and the dot will move up. So the left analog stick works fine. However, when I push the right analog stick up and down, it will move the dot in the (Rx, Ry) box left and right. When I push it left and right, it will move the dot in the (Z, Rz) box left and right. This is not correct, a single analog stick should always control the dot in a single box and move it in the corresponding direction.

By contrast, this seems to work fine in Wine. When I run wine control and I go to the same "test joystick" tab, the right analog stick controls only the dot in the (Z, Rz) box and everything works like it's supposed to: I push the analog stick up and the dot moves up, I push it right and the dot moves right etc.

This bug isn't limited to the control panel. In the game "Burnout Paradise", one is supposed to be able to control the camera with the right analog stick. Pushing it up and down should tilt the camera, while pushing it left and right should rotate it. However in Proton, pushing it left and right will do nothing, and pushing it up and down will rotate the camera instead of tilting it.

Another interesting fact is that my gamepad shows up twice in the wine control panel: once as "Microntek USB Joystick (event)" and once as "Microntek USB Joystick (js)". The former works correctly, while the latter shows the same buggy behaviour as in the Proton control panel. This is probably related to the fact that the Linux kernel offers two different ways to interface with game controllers: the evdev interface and the legacy joydev interface. When I rmmod joydev, the (js) device doesn't show up in the wine control panel any longer.
In Proton, the device only shows up once and it doesn't have an (event) or (js) suffix. My first thought was that Proton might be using the joydev interface and thus get it wrong in the same way as the (js) device in Wine, since the behaviour is the same. However that doesn't seem to be the case, because the device doesn't go away when I rmmod joydev. So I'm not quite sure what to make of all that, but perhaps it helps you to fix this issue.

I bought it here:
https://www.ebay.de/itm/Verkabelte-XBOX-Controller-USB-Joypad-Für-Microsoft-PC-Windows-7-Gamepad-st/283600551915?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649

lsusb -v identifies it as follows:

Bus 002 Device 019: ID 0079:0006 DragonRise Inc. PC TWIN SHOCK Gamepad
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0079 DragonRise Inc.
  idProduct          0x0006 PC TWIN SHOCK Gamepad
  bcdDevice            1.07
  iManufacturer           1 Microntek             
  iProduct                2 USB Joystick          
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0029
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     107
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)
Mmberndt123 2020-02-09 github

I just realized that I can reconfigure the controller Axis in Steam and even upload the gamepad layout to steam. So I guess this is solved.