Patching the Linux kernel to get the MadCatz Arcade FightStick TE2 working

Mon, Apr 11, 2016 | tags: C kernel USB drivers

One reason for me wanting to buy Street Fighter V is because I played Super Street Fighter 2 in the 90s. Another one is that nowadays I am not very patient with games and a fighting game certainly seems like a good fit for me due to their 2-minute matches.

Reading up about fighting games online I started getting interested in owning a fight stick to play them with since those remind me of the arcades of my childhood. I did not visit those often but I always enjoyed them a big deal and think back to them fondly to this day.

After shifting through a few reviews I found the MadCatz TE2 to be a solid choice. That’s how it looks like.

MadCatz Arcade FightStick TE2

The newest TE2 model comes in two versions, one for PlayStation 4 and one for Xbox One. Online I found some references to the PlayStation 4 version potentially not being compatible with certain mainboard chipsets (though I can’t seem to find any more-concrete examples online anymore). I did not want to take that risk and because I knew that Xbox One gamepads were already supported in Linux I assumed that the Xbox One version would be recognized automatically as a compatible device and that I would be ready to play immediately after plugging it in.

To my great dismay, after buying the Xbox One version and connecting it to my PC, dmesg just showed me the following message and nothing else.

[12293.077720] usb 1-1.2.1: new full-speed USB device number 9 using
ehci-pci

After that blow I had a look at a few drivers in the kernel to see if I could just add the USB vendor and product ids to them to get the stick to work. The first thing I tried was adding the line

{ 0x0738, 0x4a01, "Mad Catz FightStick TE 2", 0, XTYPE_XBOXONE },

to the xpad_device array in the xpad.c Xbox gamepad driver. I was hoping that would be all that is needed for the stick to be recognised but, alas, that wasn’t the case. I ended up asking the kernelnewbies mailing list for help where I was told to send a mail directly to the kernel-input list (by Greg KH, helpful as ever!).

From the linux-input list I received the advice to look at which bytes the xpad driver sends to the USB device to activate it. The idea was that maybe after sending some activation bytes the device would identify itself and then be recognised automatically. While searching for the bytes being sent in the xpad driver, I realized that I forgot to add the vendor USB ID to the module device table (xpad_table) where it is needed for the driver to be associated with the Mad Catz FightStick.

As soon as I added the vendor id to that array, the FightStick was recognized and its functionality was on par with what the Windows drivers provide (which isn’t perfect. You also have to rewire one of the buttons in order to get the layout you need for fighting games working. The same issue is present on Windows though).

I sent the patch to the people responsible for the driver (keyword get_maintainer.pl) and it was applied after a few weeks (and a ping mail). Now I only have to wait for Street Fighter V to finally be released for Linux …

Edit: Since Linux 4.6 the patch has been applied to mainline and plugging in the TE2 FightStick gets it recognized and working. You still have to rewire one of the buttons if you want the standard 3-over-3 button configuration for fighting games (because only 6 out of the main 8 buttons are recognized, just like on Windows).

There is still no Linux version of Street Fighter V as of the 18th of June 2016 …

Don’t hesitate to send comments and/or questions to my public-inbox (view).