In the last Amazon prime day, I purchased a PDP Wired Controller - Blue Camo (https://www.pdp.com/en/shop/pdp-wired-controller-048-082-na-cm02). I think PDP controllers offer the “best bang for the buck” and also I was aware that they work with linux from kernel 4.15 onward (https://www.phoronix.com/scan.php?page=news_item&px=PDP-Xbox-One-Linux-4.15).
But the controller did not work, not even the power led was lit. I am running kernel 4.18.
I tested the controller on Windows and it worked, so it was not faulty.
I checked the patch that added support for PDP controllers to XPad and I noticed that the product-ids considered are 0x02AB and 0x02A4:
{ 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE },
{ 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 0, XTYPE_XBOXONE }
My controller has the product-id 0x02A6, so the PDP Wired Controller - Blue Camo is not considered in the patch.
But this is open source, if something is missing, we can add it ourselves.
I had read that PDP controllers have an odd initialization sequence. I can see that sequence in the XPad source code:
/*
* This packet is required for some of the PDP pads to start
* sending input reports. These pads include: (0x0e6f:0x02ab),
* (0x0e6f:0x02a4).
*/
static const u8 xboxone_pdp_init1[] = {
0x0a, 0x20, 0x00, 0x03, 0x00, 0x01, 0x14
};
/*
* This packet is required for some of the PDP pads to start
* sending input reports. These pads include: (0x0e6f:0x02ab),
* (0x0e6f:0x02a4).
*/
static const u8 xboxone_pdp_init2[] = {
0x06, 0x20, 0x00, 0x02, 0x01, 0x00
};
The first step was to check the initialization sequence of my controller, so I needed to see the raw USB data between the Windows driver and the controller. With the help of a friend of mine and Wireshark (and USBPcap https://wiki.wireshark.org/CaptureSetup/USB) , I was able to see the raw data. For my convenience is the same sequence that XPad already considers.
I added a couple of lines to xpad.c, built the XPad module and installed it in my system. The power led lit immediately and the controller now works flawlessly.
I did not know how to build XPad alone. After quick google search I came across a github user called brianguertin, he also modified the XPad module some time ago. I used his makefile (https://github.com/brianguertin/xpad).
I created a patch with my modifications to xpad.c and I submitted it for review. I hope it gets approved.
I am really impressed with this controller, it was relatively cheap and the build quality is top-notch. I get the appeal and the convenience of wireless controllers, but a wired connection will always be faster and more reliable, and if you are playing on your PC, you are probably just a meter away.