]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - Documentation/input/devices/xpad.rst
Merge branch 'core/speculation' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-hirsute-kernel.git] / Documentation / input / devices / xpad.rst
CommitLineData
3f0a2975 1=======================================================
5469b196 2xpad - Linux USB driver for Xbox compatible controllers
3f0a2975 3=======================================================
1da177e4 4
5469b196
DD
5This driver exposes all first-party and third-party Xbox compatible
6controllers. It has a long history and has enjoyed considerable usage
7as Window's xinput library caused most PC games to focus on Xbox
8controller compatibility.
deb8ee43 9
5469b196
DD
10Due to backwards compatibility all buttons are reported as digital.
11This only effects Original Xbox controllers. All later controller models
12have only digital face buttons.
13
14Rumble is supported on some models of Xbox 360 controllers but not of
15Original Xbox controllers nor on Xbox One controllers. As of writing
16the Xbox One's rumble protocol has not been reverse engineered but in
17the future could be supported.
1da177e4
LT
18
19
3f0a2975
MCC
20Notes
21=====
22
deb8ee43 23The number of buttons/axes reported varies based on 3 things:
3f0a2975 24
deb8ee43
DC
25- if you are using a known controller
26- if you are using a known dance pad
27- if using an unknown device (one not listed below), what you set in the
28 module configuration for "Map D-PAD to buttons rather than axes for unknown
29 pads" (module option dpad_to_buttons)
1da177e4 30
5469b196
DD
31If you set dpad_to_buttons to N and you are using an unknown device
32the driver will map the directional pad to axes (X/Y).
33If you said Y it will map the d-pad to buttons, which is needed for dance
34style games to function correctly. The default is Y.
35
36dpad_to_buttons has no effect for known pads. A erroneous commit message
37claimed dpad_to_buttons could be used to force behavior on known devices.
38This is not true. Both dpad_to_buttons and triggers_to_buttons only affect
39unknown controllers.
deb8ee43 40
deb8ee43 41
3f0a2975
MCC
42Normal Controllers
43------------------
44
deb8ee43
DC
45With a normal controller, the directional pad is mapped to its own X/Y axes.
46The jstest-program from joystick-1.2.15 (jstest-version 2.1.0) will report 8
47axes and 10 buttons.
1da177e4 48
deb8ee43 49All 8 axes work, though they all have the same range (-32768..32767)
1da177e4
LT
50and the zero-setting is not correct for the triggers (I don't know if that
51is some limitation of jstest, since the input device setup should be fine. I
52didn't have a look at jstest itself yet).
53
54All of the 10 buttons work (in digital mode). The six buttons on the
55right side (A, B, X, Y, black, white) are said to be "analog" and
56report their values as 8 bit unsigned, not sure what this is good for.
57
58I tested the controller with quake3, and configuration and
59in game functionality were OK. However, I find it rather difficult to
60play first person shooters with a pad. Your mileage may vary.
61
62
3f0a2975
MCC
63Xbox Dance Pads
64---------------
65
deb8ee43
DC
66When using a known dance pad, jstest will report 6 axes and 14 buttons.
67
68For dance style pads (like the redoctane pad) several changes
69have been made. The old driver would map the d-pad to axes, resulting
70in the driver being unable to report when the user was pressing both
71left+right or up+down, making DDR style games unplayable.
72
73Known dance pads automatically map the d-pad to buttons and will work
74correctly out of the box.
75
76If your dance pad is recognized by the driver but is using axes instead
77of buttons, see section 0.3 - Unknown Controllers
78
79I've tested this with Stepmania, and it works quite well.
80
81
3f0a2975
MCC
82Unknown Controllers
83-------------------
84
a982ac06 85If you have an unknown xbox controller, it should work just fine with
deb8ee43
DC
86the default settings.
87
88HOWEVER if you have an unknown dance pad not listed below, it will not
89work UNLESS you set "dpad_to_buttons" to 1 in the module configuration.
90
deb8ee43 91
3f0a2975
MCC
92USB adapters
93============
94
5469b196 95All generations of Xbox controllers speak USB over the wire.
3f0a2975 96
5469b196
DD
97- Original Xbox controllers use a proprietary connector and require adapters.
98- Wireless Xbox 360 controllers require a 'Xbox 360 Wireless Gaming Receiver
99 for Windows'
100- Wired Xbox 360 controllers use standard USB connectors.
101- Xbox One controllers can be wireless but speak Wi-Fi Direct and are not
102 yet supported.
103- Xbox One controllers can be wired and use standard Micro-USB connectors.
104
1da177e4 105
5469b196 106
3f0a2975
MCC
107Original Xbox USB adapters
108--------------------------
109
5469b196
DD
110Using this driver with an Original Xbox controller requires an
111adapter cable to break out the proprietary connector's pins to USB.
112You can buy these online fairly cheap, or build your own.
1da177e4 113
deb8ee43
DC
114Such a cable is pretty easy to build. The Controller itself is a USB
115compound device (a hub with three ports for two expansion slots and
116the controller device) with the only difference in a nonstandard connector
5469b196 117(5 pins vs. 4 on standard USB 1.0 connectors).
1da177e4
LT
118
119You just need to solder a USB connector onto the cable and keep the
120yellow wire unconnected. The other pins have the same order on both
121connectors so there is no magic to it. Detailed info on these matters
b08c118c 122can be found on the net ([1]_, [2]_, [3]_).
1da177e4
LT
123
124Thanks to the trip splitter found on the cable you don't even need to cut the
125original one. You can buy an extension cable and cut that instead. That way,
126you can still use the controller with your X-Box, if you have one ;)
127
128
5469b196 129
3f0a2975
MCC
130Driver Installation
131===================
1da177e4 132
5469b196
DD
133Once you have the adapter cable, if needed, and the controller connected
134the xpad module should be auto loaded. To confirm you can cat
69989627 135/sys/kernel/debug/usb/devices. There should be an entry like those:
5469b196 136
69989627
MCC
137.. code-block:: none
138 :caption: dump from InterAct PowerPad Pro (Germany)
139
140 T: Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=12 MxCh= 0
141 D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs= 1
142 P: Vendor=05fd ProdID=107a Rev= 1.00
143 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
144 I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=(none)
145 E: Ad=81(I) Atr=03(Int.) MxPS= 32 Ivl= 10ms
146 E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl= 10ms
147
148.. code-block:: none
149 :caption: dump from Redoctane Xbox Dance Pad (US)
150
151 T: Bus=01 Lev=02 Prnt=09 Port=00 Cnt=01 Dev#= 10 Spd=12 MxCh= 0
152 D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
153 P: Vendor=0c12 ProdID=8809 Rev= 0.01
154 S: Product=XBOX DDR
155 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
156 I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=xpad
157 E: Ad=82(I) Atr=03(Int.) MxPS= 32 Ivl=4ms
158 E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl=4ms
5469b196 159
1da177e4 160
3f0a2975
MCC
161Supported Controllers
162=====================
163
5469b196 164For a full list of supported controllers and associated vendor and product
69989627 165IDs see the xpad_device[] array\ [4]_.
5469b196
DD
166
167As of the historic version 0.0.6 (2006-10-10) the following devices
3f0a2975
MCC
168were supported::
169
5469b196
DD
170 original Microsoft XBOX controller (US), vendor=0x045e, product=0x0202
171 smaller Microsoft XBOX controller (US), vendor=0x045e, product=0x0289
1da177e4 172 original Microsoft XBOX controller (Japan), vendor=0x045e, product=0x0285
5469b196
DD
173 InterAct PowerPad Pro (Germany), vendor=0x05fd, product=0x107a
174 RedOctane Xbox Dance Pad (US), vendor=0x0c12, product=0x8809
175
176Unrecognized models of Xbox controllers should function as Generic
177Xbox controllers. Unrecognized Dance Pad controllers require setting
178the module option 'dpad_to_buttons'.
179
180If you have an unrecognized controller please see 0.3 - Unknown Controllers
1da177e4 181
1da177e4 182
3f0a2975
MCC
183Manual Testing
184==============
185
5469b196 186To test this driver's functionality you may use 'jstest'.
1da177e4 187
3f0a2975
MCC
188For example::
189
190 > modprobe xpad
191 > modprobe joydev
192 > jstest /dev/js0
1da177e4 193
deb8ee43
DC
194If you're using a normal controller, there should be a single line showing
19518 inputs (8 axes, 10 buttons), and its values should change if you move
196the sticks and push the buttons. If you're using a dance pad, it should
197show 20 inputs (6 axes, 14 buttons).
1da177e4 198
deb8ee43 199It works? Voila, you're done ;)
1da177e4
LT
200
201
5469b196 202
3f0a2975
MCC
203Thanks
204======
1da177e4
LT
205
206I have to thank ITO Takayuki for the detailed info on his site
3f0a2975
MCC
207 http://euc.jp/periphs/xbox-controller.ja.html.
208
1da177e4
LT
209His useful info and both the usb-skeleton as well as the iforce input driver
210(Greg Kroah-Hartmann; Vojtech Pavlik) helped a lot in rapid prototyping
211the basic functionality.
212
213
1da177e4 214
3f0a2975
MCC
215References
216==========
1da177e4 217
b08c118c
DT
218.. [1] http://euc.jp/periphs/xbox-controller.ja.html (ITO Takayuki)
219.. [2] http://xpad.xbox-scene.com/
220.. [3] http://www.markosweb.com/www/xboxhackz.com/
19c1d46d 221.. [4] https://elixir.bootlin.com/linux/latest/ident/xpad_device
5469b196
DD
222
223
3f0a2975
MCC
224Historic Edits
225==============
226
2272002-07-16 - Marko Friedemann <mfr@bmx-chemnitz.de>
deb8ee43
DC
228 - original doc
229
3f0a2975 2302005-03-19 - Dominic Cerquetti <binary1230@yahoo.com>
deb8ee43 231 - added stuff for dance pads, new d-pad->axes mappings
5469b196 232
1752118d
TS
233Later changes may be viewed with
234'git log --follow Documentation/input/devices/xpad.rst'