4

I have a Trust GTX YULA controller which I would also like to use on my Ubuntu laptop.

The controller has a switch between Direct mode and X mode, where it pretends to be an XBOX controller. X mode works fine on Windows. I don't want to use D mode because the analog sticks provide discrete inputs in that mode, pretending to be buttons, and one overlaps with the ABXY buttons.

The output to lsusb contains this line:

Bus 001 Device 013: ID 045e:028e Microsoft Corp. Xbox360 Controller

Which I assume is my controller since I have no other controllers. It is connected through an USB hub.

I have installed jstest-gtk, and it also sees the controller as an XBOX 360 pad, but clicking properties and pushing buttons on the controller does not make the corresponding software icons light up.

window of `jstest-gtk', having selected *properties* of the only available controller

I have tried using xboxdrv, but this is the output:

$ sudo xboxdrv
xboxdrv 0.8.8 - http://pingus.seul.org/~grumbel/xboxdrv/ 
Copyright © 2008-2011 Ingo Ruhnke <[email protected]> 
Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 
This program comes with ABSOLUTELY NO WARRANTY. 
This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details. 

Controller:        Microsoft X-Box 360 pad
Vendor/Product:    045e:028e
USB Path:          001:013
Controller Type:   Xbox360

Your Xbox/Xbox360 controller should now be available as:
  /dev/input/js0
  /dev/input/event18

Press Ctrl-C to quit, use '--silent' to suppress the event output
[ERROR] USBController::on_read_data(): USB read failure: 32: LIBUSB_TRANSFER_ERROR
[ERROR] USBController::on_write_data(): USB write failure: 3: LIBUSB_TRANSFER_ERROR

With this running, evtest gives the following output (pushing buttons on the controller does nothing)

$ evtest /dev/input/event18
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "Xbox Gamepad (userspace driver)"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 304 (BTN_SOUTH)
    Event code 305 (BTN_EAST)
    Event code 307 (BTN_NORTH)
    Event code 308 (BTN_WEST)
    Event code 310 (BTN_TL)
    Event code 311 (BTN_TR)
    Event code 314 (BTN_SELECT)
    Event code 315 (BTN_START)
    Event code 316 (BTN_MODE)
    Event code 317 (BTN_THUMBL)
    Event code 318 (BTN_THUMBR)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min   -32768
      Max    32767
    Event code 1 (ABS_Y)
      Value      0
      Min   -32768
      Max    32767
    Event code 3 (ABS_RX)
      Value      0
      Min   -32768
      Max    32767
    Event code 4 (ABS_RY)
      Value      0
      Min   -32768
      Max    32767
    Event code 9 (ABS_GAS)
      Value      0
      Min        0
      Max      255
    Event code 10 (ABS_BRAKE)
      Value      0
      Min        0
      Max      255
    Event code 16 (ABS_HAT0X)
      Value      0
      Min       -1
      Max        1
    Event code 17 (ABS_HAT0Y)
      Value      0
      Min       -1
      Max        1
Properties:
Testing ... (interrupt to exit)

One user suggested removing xserver-xorg-input-joystick.*, but I don't have any installed.

How can I make my controller work?

Is this site effective as a check?

Thank you.

1
  • Try selecting DInput mode using the switch on the back.
    – user253751
    Mar 13, 2021 at 12:54

1 Answer 1

2

The same issue was reported about xpad driver: https://github.com/paroj/xpad/issues/119 The python srcipt (fixcontroller.py) mentioned in the description solved the problem. Here is a copy of the script:

#!/usr/bin/env python3

import os
import sys


try:
    import usb.core
    import usb.util
except ImportError:
    print("First, install the pyusb module with PIP or your package manager.")
else:
    if os.geteuid() != 0:
        print("You need to run this script with sudo")
        sys.exit()

    dev = usb.core.find(find_all=True)

    for d in dev:
        if d.idVendor == 0x045e and d.idProduct == 0x028e:
            d.ctrl_transfer(0xc1, 0x01, 0x0100, 0x00, 0x14)
finally:
    sys.exit()
1
  • thanks that worked for me, can you explain this line ? d.ctrl_transfer(0xc1, 0x01, 0x0100, 0x00, 0x14) , i think the original script creator analyzed these hex codes from usbmon and seems like these are universal Mar 19, 2022 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .