blob: aae0d404c5666a15aba9f56703b4fdb997f009aa [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001xpad - Linux USB driver for X-Box gamepads
2
3This is the very first release of a driver for X-Box gamepads.
4Basically, this was hacked away in just a few hours, so don't expect
5miracles.
Dominic Cerquettideb8ee42006-10-10 14:42:48 -07006
Linus Torvalds1da177e2005-04-16 15:20:36 -07007In particular, there is currently NO support for the rumble pack.
8You won't find many ff-aware linux applications anyway.
9
10
Dominic Cerquettideb8ee42006-10-10 14:42:48 -0700110. Notes
12--------
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Dominic Cerquettideb8ee42006-10-10 14:42:48 -070014Driver updated for kernel 2.6.17.11. (Based on a patch for 2.6.11.4.)
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Dominic Cerquettideb8ee42006-10-10 14:42:48 -070016The number of buttons/axes reported varies based on 3 things:
17- if you are using a known controller
18- if you are using a known dance pad
19- if using an unknown device (one not listed below), what you set in the
20 module configuration for "Map D-PAD to buttons rather than axes for unknown
21 pads" (module option dpad_to_buttons)
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
Dominic Cerquettideb8ee42006-10-10 14:42:48 -070023If you set dpad_to_buttons to 0 and you are using an unknown device (one
24not listed below), the driver will map the directional pad to axes (X/Y),
25if you said N it will map the d-pad to buttons, which is needed for dance
26style games to function correctly. The default is Y.
27
28dpad_to_buttons has no effect for known pads.
29
300.1 Normal Controllers
31----------------------
32With a normal controller, the directional pad is mapped to its own X/Y axes.
33The jstest-program from joystick-1.2.15 (jstest-version 2.1.0) will report 8
34axes and 10 buttons.
35
36All 8 axes work, though they all have the same range (-32768..32767)
Linus Torvalds1da177e2005-04-16 15:20:36 -070037and the zero-setting is not correct for the triggers (I don't know if that
38is some limitation of jstest, since the input device setup should be fine. I
39didn't have a look at jstest itself yet).
40
41All of the 10 buttons work (in digital mode). The six buttons on the
42right side (A, B, X, Y, black, white) are said to be "analog" and
43report their values as 8 bit unsigned, not sure what this is good for.
44
45I tested the controller with quake3, and configuration and
46in game functionality were OK. However, I find it rather difficult to
47play first person shooters with a pad. Your mileage may vary.
48
49
Dominic Cerquettideb8ee42006-10-10 14:42:48 -0700500.2 Xbox Dance Pads
51-------------------
52When using a known dance pad, jstest will report 6 axes and 14 buttons.
53
54For dance style pads (like the redoctane pad) several changes
55have been made. The old driver would map the d-pad to axes, resulting
56in the driver being unable to report when the user was pressing both
57left+right or up+down, making DDR style games unplayable.
58
59Known dance pads automatically map the d-pad to buttons and will work
60correctly out of the box.
61
62If your dance pad is recognized by the driver but is using axes instead
63of buttons, see section 0.3 - Unknown Controllers
64
65I've tested this with Stepmania, and it works quite well.
66
67
Matt LaPlantea982ac02007-05-09 07:35:06 +0200680.3 Unknown Controllers
Dominic Cerquettideb8ee42006-10-10 14:42:48 -070069----------------------
Matt LaPlantea982ac02007-05-09 07:35:06 +020070If you have an unknown xbox controller, it should work just fine with
Dominic Cerquettideb8ee42006-10-10 14:42:48 -070071the default settings.
72
73HOWEVER if you have an unknown dance pad not listed below, it will not
74work UNLESS you set "dpad_to_buttons" to 1 in the module configuration.
75
Matt LaPlantea982ac02007-05-09 07:35:06 +020076PLEASE, if you have an unknown controller, email Dom <binary1230@yahoo.com> with
Dominic Cerquettideb8ee42006-10-10 14:42:48 -070077a dump from /proc/bus/usb and a description of the pad (manufacturer, country,
78whether it is a dance pad or normal controller) so that we can add your pad
79to the list of supported devices, ensuring that it will work out of the
80box in the future.
81
82
Linus Torvalds1da177e2005-04-16 15:20:36 -0700831. USB adapter
84--------------
85
86Before you can actually use the driver, you need to get yourself an
Dominic Cerquettideb8ee42006-10-10 14:42:48 -070087adapter cable to connect the X-Box controller to your Linux-Box. You
88can buy these online fairly cheap, or build your own.
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
Dominic Cerquettideb8ee42006-10-10 14:42:48 -070090Such a cable is pretty easy to build. The Controller itself is a USB
91compound device (a hub with three ports for two expansion slots and
92the controller device) with the only difference in a nonstandard connector
93(5 pins vs. 4 on standard USB connector).
Linus Torvalds1da177e2005-04-16 15:20:36 -070094
95You just need to solder a USB connector onto the cable and keep the
96yellow wire unconnected. The other pins have the same order on both
97connectors so there is no magic to it. Detailed info on these matters
98can be found on the net ([1], [2], [3]).
99
100Thanks to the trip splitter found on the cable you don't even need to cut the
101original one. You can buy an extension cable and cut that instead. That way,
102you can still use the controller with your X-Box, if you have one ;)
103
104
Dominic Cerquettideb8ee42006-10-10 14:42:48 -07001052. Driver Installation
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106----------------------
107
108Once you have the adapter cable and the controller is connected, you need
109to load your USB subsystem and should cat /proc/bus/usb/devices.
110There should be an entry like the one at the end [4].
111
Dominic Cerquettideb8ee42006-10-10 14:42:48 -0700112Currently (as of version 0.0.6), the following devices are included:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113 original Microsoft XBOX controller (US), vendor=0x045e, product=0x0202
Dominic Cerquettideb8ee42006-10-10 14:42:48 -0700114 smaller Microsoft XBOX controller (US), vendor=0x045e, product=0x0289
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115 original Microsoft XBOX controller (Japan), vendor=0x045e, product=0x0285
116 InterAct PowerPad Pro (Germany), vendor=0x05fd, product=0x107a
Dominic Cerquettideb8ee42006-10-10 14:42:48 -0700117 RedOctane Xbox Dance Pad (US), vendor=0x0c12, product=0x8809
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118
Dominic Cerquettideb8ee42006-10-10 14:42:48 -0700119The driver should work with xbox pads not listed above as well, however
120you will need to do something extra for dance pads to work.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121
Dominic Cerquettideb8ee42006-10-10 14:42:48 -0700122If you have a controller not listed above, see 0.3 - Unknown Controllers
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123
124If you compiled and installed the driver, test the functionality:
125> modprobe xpad
126> modprobe joydev
127> jstest /dev/js0
128
Dominic Cerquettideb8ee42006-10-10 14:42:48 -0700129If you're using a normal controller, there should be a single line showing
13018 inputs (8 axes, 10 buttons), and its values should change if you move
131the sticks and push the buttons. If you're using a dance pad, it should
132show 20 inputs (6 axes, 14 buttons).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133
Dominic Cerquettideb8ee42006-10-10 14:42:48 -0700134It works? Voila, you're done ;)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135
136
1373. Thanks
138---------
139
140I have to thank ITO Takayuki for the detailed info on his site
141 http://euc.jp/periphs/xbox-controller.ja.html.
142
143His useful info and both the usb-skeleton as well as the iforce input driver
144(Greg Kroah-Hartmann; Vojtech Pavlik) helped a lot in rapid prototyping
145the basic functionality.
146
147
1484. References
149-------------
150
1511. http://euc.jp/periphs/xbox-controller.ja.html (ITO Takayuki)
1522. http://xpad.xbox-scene.com/
1533. http://www.xboxhackz.com/Hackz-Reference.htm
154
1554. /proc/bus/usb/devices - dump from InterAct PowerPad Pro (Germany):
156
157T: Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=12 MxCh= 0
158D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs= 1
159P: Vendor=05fd ProdID=107a Rev= 1.00
160C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
161I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=(none)
162E: Ad=81(I) Atr=03(Int.) MxPS= 32 Ivl= 10ms
163E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl= 10ms
164
Dominic Cerquettideb8ee42006-10-10 14:42:48 -07001655. /proc/bus/usb/devices - dump from Redoctane Xbox Dance Pad (US):
166
167T: Bus=01 Lev=02 Prnt=09 Port=00 Cnt=01 Dev#= 10 Spd=12 MxCh= 0
168D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
169P: Vendor=0c12 ProdID=8809 Rev= 0.01
170S: Product=XBOX DDR
171C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
172I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=xpad
173E: Ad=82(I) Atr=03(Int.) MxPS= 32 Ivl=4ms
174E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl=4ms
175
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176--
177Marko Friedemann <mfr@bmx-chemnitz.de>
1782002-07-16
Dominic Cerquettideb8ee42006-10-10 14:42:48 -0700179 - original doc
180
181Dominic Cerquetti <binary1230@yahoo.com>
1822005-03-19
183 - added stuff for dance pads, new d-pad->axes mappings