Is there a way to use a gamepad on Haiku for now?

Hi, I have a USB gamepad (ten buttons) something like a Playstation one from Logitech. Haiku seem not recognize it in the entrys app. Is there some drivers about it to install? Or change some settings for recognize it?

Hello. I also have a Logitech gamepad. It works perfect under some SDL emulators, like mednafen. In my case, I just needed to switch the mode from “X” to “D”, using a little switch located in the joypad back.

Okay mednaffen, I must put RetroArch to use it? I have attempt to use my gamepad on mgba but seem not recognize…

I didn’t tried RetroArch, but under mgba it also recognized the joypad. Did you check in the “Tools” --> “Settings” --> “Controllers” section?

Hmmm Yes but it’s not recognize here also I don’t find mednaffen without Libretro in the Haiku Depots…Do you use Haiku Dev or the Beta ? My gamepad is a Logitech Precision…something like a standard gamepad.

Hello. I’m using Haiku nightly (32 bit). The mednafen package is available at the Clasqm repo:

https://depot.haiku-os.org/#!/pkg/mednafen/clasqm/0/39/2/-/2/x86_gcc2

Your gamepad had this switch?

The Input preferences does not handle Joysticks yet.
To check if your gamepad is recognized:

  1. Go in /dev/input/joystick and check if a device is there
  2. Use “cat /dev/input/joystick/XXX” (replace XXX with the name of the joystick there of course) to see the incoming data
  3. When you press some buttons on the gamepad, cat should print strange characters

If this works, you are all set from Haiku side and you can see about configuring applications to use it.

If this does not work, you have found a bug in the Haiku HID driver or USB stack that makes it incompatible with your joystick, and it’s bugreport time. In that case we will need:

  • Output of listusb -v for your gamepad
  • HID descriptor (it is normally found in /tmp when your gamepad is connected, and named according to the USB device and vendor id)
  • Extract of syslog with what is printed when you connect the gamepad
1 Like

The directories …/input/joystick dont exist. I have keyboard mouse and touchpad

listusb find it as:
046d:c21a /dev/bus/usb/3/0 "Logitech, Inc." "Precision Gamepad" ver. 0004

No there is not a switch on this gamepad for reply to un_spacyar. The Clamsqm repo don’t working here don’t know why…Is it offline? I use 64bit version of Haiku but I have attempt with the 64bits repo too.

Ok I have find /dev/joystick/usb/0 but the command cat return me a lot of line with the same shema in infinity…something go wron I presume…

Ok, so yes there is a known problem with the Logitech Precision Gamepad indeed. I have one and I could never get it to work reliably either (I’ve been looking into this issue now and then for a few years now…).

There was a fix in https://dev.haiku-os.org/ticket/7651 but maybe it is not enough.It seems the comment says 8 but the code says 4 there. Not sure what I did. Will check again with 8.

Sorry, the mednafen package is only available on 32 bit, on that repo. However, theorically it must compile under 64 bit too.

If I get some time next month, I will try to set a 64 installation and trying to compile it there.

My Logitech model is another one: Logitech Rumble Gamepad F510 (the wired one). Just in case someone find it useful.

Actually both repos are unavailable.

So, I tried again and here the Logitech Precision Gamepad seems to be working fine today on an EHCI port through a rate matching hub (that’s the hardware component that allows using USB1 devices on an EHCI hub). Can you check what type of USB port is used for you? From your example, that would be /dev/bus/usb/3/hub . I can already see that there is no rate matching hub in your case. So it seems there is a problem similar to #7651 for other configurations of USB ports.

How can I check it? The port is Black I supose is USB 2 port but with the listUSB command I have it /dev/bus/usb/3/0 "Logitech, … So this is maybe 3 but it’s a second hand laptop so I imagine it doesn’t have usb 3

Check for /dev/bus/usb/3/hub which is the hub the device is attached to (the number “3” does not relate to USB3, it’s just the “address” of the hub in your system that the gamepad is connected to). What kind of hub is it?

I don’t really know the manipulation to do at the hub stade. It’s not a directories…I have a zero in his side 0 and hub. I don’t know how to know it.

listusb -v give me this about the pad…

    [Device /dev/bus/usb/3/0]
    Class .................. 0x00 (Per-interface classes)
    Subclass ............... 0x00
    Protocol ............... 0x00
    Max Endpoint 0 Packet .. 8
    USB Version ............ 1.16
    Vendor ID .............. 0x046d (Logitech, Inc.)
    Product ID ............. 0xc21a (Precision Gamepad)
    Product Version ........ 0x0004
    Manufacturer String .... "Logitech"
    Product String ......... "Logitech(R) Precision(TM) Gamepad"
    Serial Number .......... ""
    [Configuration 0]
        Configuration String . ""
        [Interface 0]
            [Alternate 0 active]
                Class .............. 0x03 (HID)
                Subclass ........... 0x00
                Protocol ........... 0x00
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 8
                    Interval ......... 10
                    Type ............. Interrupt
                    Direction ........ Input
                [Descriptor 0]
                    Type ............. 0x21
                    Data ............. 10 01 00 01 22 3d 00 
[Device /dev/bus/usb/3/hub]
    Class .................. 0x09 (Hub)
    Subclass ............... 0x00
    Protocol ............... 0x00 (Full speed)
    Max Endpoint 0 Packet .. 64
    USB Version ............ 1.16
    Vendor ID .............. 0x0000
    Product ID ............. 0x0000
    Product Version ........ 0x0110
    Manufacturer String .... "HAIKU Inc."
    Product String ......... "UHCI RootHub"
    Serial Number .......... ""
    [Configuration 0]
        Configuration String . ""
        [Interface 0]
            [Alternate 0 active]
                Class .............. 0x09 (Hub)
                Subclass ........... 0x00
                Protocol ........... 0x00 (Full speed)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 8
                    Interval ......... 255
                    Type ............. Interrupt
                    Direction ........ Input
                [Descriptor 0]
                    Type ............. 0x29
                    Data ............. 02 00 00 00 00 00 ff 
    Hub ports count......... 2
    Hub Controller Current.. 0mA
      Port 1 status....... 0303.0000 Connect Enable Power
      Port 2 status....... 0100.0000 Power

Maybe you see something clear in it.

Yes, I see this:

So I know this is an UHCI (USB1) controller. And this means UHCI probably needs a similar fix to what I did for EHCI (USB2). I will test on another machine where I still have USB1 port and see if I can reproduce and investigate the problem.

2 Likes