Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | xpad - Linux USB driver for X-Box gamepads |
| 2 | |
| 3 | This is the very first release of a driver for X-Box gamepads. |
| 4 | Basically, this was hacked away in just a few hours, so don't expect |
| 5 | miracles. |
| 6 | In particular, there is currently NO support for the rumble pack. |
| 7 | You won't find many ff-aware linux applications anyway. |
| 8 | |
| 9 | |
| 10 | 0. Status |
| 11 | --------- |
| 12 | |
| 13 | For now, this driver has only been tested on just one Linux-Box. |
| 14 | This one is running a 2.4.18 kernel with usb-uhci on an amd athlon 600. |
| 15 | |
| 16 | The jstest-program from joystick-1.2.15 (jstest-version 2.1.0) reports |
| 17 | 8 axes and 10 buttons. |
| 18 | |
| 19 | Alls 8 axes work, though they all have the same range (-32768..32767) |
| 20 | and the zero-setting is not correct for the triggers (I don't know if that |
| 21 | is some limitation of jstest, since the input device setup should be fine. I |
| 22 | didn't have a look at jstest itself yet). |
| 23 | |
| 24 | All of the 10 buttons work (in digital mode). The six buttons on the |
| 25 | right side (A, B, X, Y, black, white) are said to be "analog" and |
| 26 | report their values as 8 bit unsigned, not sure what this is good for. |
| 27 | |
| 28 | I tested the controller with quake3, and configuration and |
| 29 | in game functionality were OK. However, I find it rather difficult to |
| 30 | play first person shooters with a pad. Your mileage may vary. |
| 31 | |
| 32 | |
| 33 | 1. USB adapter |
| 34 | -------------- |
| 35 | |
| 36 | Before you can actually use the driver, you need to get yourself an |
| 37 | adapter cable to connect the X-Box controller to your Linux-Box. |
| 38 | |
| 39 | Such a cable is pretty easy to build. The Controller itself is a USB compound |
| 40 | device (a hub with three ports for two expansion slots and the controller |
| 41 | device) with the only difference in a nonstandard connector (5 pins vs. 4 on |
| 42 | standard USB connector). |
| 43 | |
| 44 | You just need to solder a USB connector onto the cable and keep the |
| 45 | yellow wire unconnected. The other pins have the same order on both |
| 46 | connectors so there is no magic to it. Detailed info on these matters |
| 47 | can be found on the net ([1], [2], [3]). |
| 48 | |
| 49 | Thanks to the trip splitter found on the cable you don't even need to cut the |
| 50 | original one. You can buy an extension cable and cut that instead. That way, |
| 51 | you can still use the controller with your X-Box, if you have one ;) |
| 52 | |
| 53 | |
| 54 | 2. driver installation |
| 55 | ---------------------- |
| 56 | |
| 57 | Once you have the adapter cable and the controller is connected, you need |
| 58 | to load your USB subsystem and should cat /proc/bus/usb/devices. |
| 59 | There should be an entry like the one at the end [4]. |
| 60 | |
| 61 | Currently (as of version 0.0.4), the following three devices are included: |
| 62 | original Microsoft XBOX controller (US), vendor=0x045e, product=0x0202 |
| 63 | original Microsoft XBOX controller (Japan), vendor=0x045e, product=0x0285 |
| 64 | InterAct PowerPad Pro (Germany), vendor=0x05fd, product=0x107a |
| 65 | |
| 66 | If you have another controller that is not listed above and is not recognized |
| 67 | by the driver, please drop me a line with the appropriate info (that is, include |
| 68 | the name, vendor and product ID, as well as the country where you bought it; |
| 69 | sending the whole dump out of /proc/bus/usb/devices along would be even better). |
| 70 | |
| 71 | In theory, the driver should work with other controllers than mine |
| 72 | (InterAct PowerPad pro, bought in Germany) just fine, but I cannot test this |
| 73 | for I only have this one controller. |
| 74 | |
| 75 | If you compiled and installed the driver, test the functionality: |
| 76 | > modprobe xpad |
| 77 | > modprobe joydev |
| 78 | > jstest /dev/js0 |
| 79 | |
| 80 | There should be a single line showing 18 inputs (8 axes, 10 buttons), and |
| 81 | it's values should change if you move the sticks and push the buttons. |
| 82 | |
| 83 | It works? Voila, your done ;) |
| 84 | |
| 85 | |
| 86 | 3. Thanks |
| 87 | --------- |
| 88 | |
| 89 | I have to thank ITO Takayuki for the detailed info on his site |
| 90 | http://euc.jp/periphs/xbox-controller.ja.html. |
| 91 | |
| 92 | His useful info and both the usb-skeleton as well as the iforce input driver |
| 93 | (Greg Kroah-Hartmann; Vojtech Pavlik) helped a lot in rapid prototyping |
| 94 | the basic functionality. |
| 95 | |
| 96 | |
| 97 | 4. References |
| 98 | ------------- |
| 99 | |
| 100 | 1. http://euc.jp/periphs/xbox-controller.ja.html (ITO Takayuki) |
| 101 | 2. http://xpad.xbox-scene.com/ |
| 102 | 3. http://www.xboxhackz.com/Hackz-Reference.htm |
| 103 | |
| 104 | 4. /proc/bus/usb/devices - dump from InterAct PowerPad Pro (Germany): |
| 105 | |
| 106 | T: Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=12 MxCh= 0 |
| 107 | D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs= 1 |
| 108 | P: Vendor=05fd ProdID=107a Rev= 1.00 |
| 109 | C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA |
| 110 | I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=(none) |
| 111 | E: Ad=81(I) Atr=03(Int.) MxPS= 32 Ivl= 10ms |
| 112 | E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl= 10ms |
| 113 | |
| 114 | -- |
| 115 | Marko Friedemann <mfr@bmx-chemnitz.de> |
| 116 | 2002-07-16 |