Back to home page

OSCL-LXR

 
 

    


0001 =======================================================
0002 xpad - Linux USB driver for Xbox compatible controllers
0003 =======================================================
0004 
0005 This driver exposes all first-party and third-party Xbox compatible
0006 controllers. It has a long history and has enjoyed considerable usage
0007 as Window's xinput library caused most PC games to focus on Xbox
0008 controller compatibility.
0009 
0010 Due to backwards compatibility all buttons are reported as digital.
0011 This only effects Original Xbox controllers. All later controller models
0012 have only digital face buttons.
0013 
0014 Rumble is supported on some models of Xbox 360 controllers but not of
0015 Original Xbox controllers nor on Xbox One controllers. As of writing
0016 the Xbox One's rumble protocol has not been reverse engineered but in
0017 the future could be supported.
0018 
0019 
0020 Notes
0021 =====
0022 
0023 The number of buttons/axes reported varies based on 3 things:
0024 
0025 - if you are using a known controller
0026 - if you are using a known dance pad
0027 - if using an unknown device (one not listed below), what you set in the
0028   module configuration for "Map D-PAD to buttons rather than axes for unknown
0029   pads" (module option dpad_to_buttons)
0030 
0031 If you set dpad_to_buttons to N and you are using an unknown device
0032 the driver will map the directional pad to axes (X/Y).
0033 If you said Y it will map the d-pad to buttons, which is needed for dance
0034 style games to function correctly. The default is Y.
0035 
0036 dpad_to_buttons has no effect for known pads. A erroneous commit message
0037 claimed dpad_to_buttons could be used to force behavior on known devices.
0038 This is not true. Both dpad_to_buttons and triggers_to_buttons only affect
0039 unknown controllers.
0040 
0041 
0042 Normal Controllers
0043 ------------------
0044 
0045 With a normal controller, the directional pad is mapped to its own X/Y axes.
0046 The jstest-program from joystick-1.2.15 (jstest-version 2.1.0) will report 8
0047 axes and 10 buttons.
0048 
0049 All 8 axes work, though they all have the same range (-32768..32767)
0050 and the zero-setting is not correct for the triggers (I don't know if that
0051 is some limitation of jstest, since the input device setup should be fine. I
0052 didn't have a look at jstest itself yet).
0053 
0054 All of the 10 buttons work (in digital mode). The six buttons on the
0055 right side (A, B, X, Y, black, white) are said to be "analog" and
0056 report their values as 8 bit unsigned, not sure what this is good for.
0057 
0058 I tested the controller with quake3, and configuration and
0059 in game functionality were OK. However, I find it rather difficult to
0060 play first person shooters with a pad. Your mileage may vary.
0061 
0062 
0063 Xbox Dance Pads
0064 ---------------
0065 
0066 When using a known dance pad, jstest will report 6 axes and 14 buttons.
0067 
0068 For dance style pads (like the redoctane pad) several changes
0069 have been made.  The old driver would map the d-pad to axes, resulting
0070 in the driver being unable to report when the user was pressing both
0071 left+right or up+down, making DDR style games unplayable.
0072 
0073 Known dance pads automatically map the d-pad to buttons and will work
0074 correctly out of the box.
0075 
0076 If your dance pad is recognized by the driver but is using axes instead
0077 of buttons, see section 0.3 - Unknown Controllers
0078 
0079 I've tested this with Stepmania, and it works quite well.
0080 
0081 
0082 Unknown Controllers
0083 -------------------
0084 
0085 If you have an unknown xbox controller, it should work just fine with
0086 the default settings.
0087 
0088 HOWEVER if you have an unknown dance pad not listed below, it will not
0089 work UNLESS you set "dpad_to_buttons" to 1 in the module configuration.
0090 
0091 
0092 USB adapters
0093 ============
0094 
0095 All generations of Xbox controllers speak USB over the wire.
0096 
0097 - Original Xbox controllers use a proprietary connector and require adapters.
0098 - Wireless Xbox 360 controllers require a 'Xbox 360 Wireless Gaming Receiver
0099   for Windows'
0100 - Wired Xbox 360 controllers use standard USB connectors.
0101 - Xbox One controllers can be wireless but speak Wi-Fi Direct and are not
0102   yet supported.
0103 - Xbox One controllers can be wired and use standard Micro-USB connectors.
0104 
0105 
0106 
0107 Original Xbox USB adapters
0108 --------------------------
0109 
0110 Using this driver with an Original Xbox controller requires an
0111 adapter cable to break out the proprietary connector's pins to USB.
0112 You can buy these online fairly cheap, or build your own.
0113 
0114 Such a cable is pretty easy to build. The Controller itself is a USB
0115 compound device (a hub with three ports for two expansion slots and
0116 the controller device) with the only difference in a nonstandard connector
0117 (5 pins vs. 4 on standard USB 1.0 connectors).
0118 
0119 You just need to solder a USB connector onto the cable and keep the
0120 yellow wire unconnected. The other pins have the same order on both
0121 connectors so there is no magic to it. Detailed info on these matters
0122 can be found on the net ([1]_, [2]_, [3]_).
0123 
0124 Thanks to the trip splitter found on the cable you don't even need to cut the
0125 original one. You can buy an extension cable and cut that instead. That way,
0126 you can still use the controller with your X-Box, if you have one ;)
0127 
0128 
0129 
0130 Driver Installation
0131 ===================
0132 
0133 Once you have the adapter cable, if needed, and the controller connected
0134 the xpad module should be auto loaded. To confirm you can cat
0135 /sys/kernel/debug/usb/devices. There should be an entry like those:
0136 
0137 .. code-block:: none
0138    :caption: dump from InterAct PowerPad Pro (Germany)
0139 
0140     T:  Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#=  5 Spd=12  MxCh= 0
0141     D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs=  1
0142     P:  Vendor=05fd ProdID=107a Rev= 1.00
0143     C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
0144     I:  If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=(none)
0145     E:  Ad=81(I) Atr=03(Int.) MxPS=  32 Ivl= 10ms
0146     E:  Ad=02(O) Atr=03(Int.) MxPS=  32 Ivl= 10ms
0147 
0148 .. code-block:: none
0149    :caption: dump from Redoctane Xbox Dance Pad (US)
0150 
0151     T:  Bus=01 Lev=02 Prnt=09 Port=00 Cnt=01 Dev#= 10 Spd=12  MxCh= 0
0152     D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
0153     P:  Vendor=0c12 ProdID=8809 Rev= 0.01
0154     S:  Product=XBOX DDR
0155     C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
0156     I:  If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=xpad
0157     E:  Ad=82(I) Atr=03(Int.) MxPS=  32 Ivl=4ms
0158     E:  Ad=02(O) Atr=03(Int.) MxPS=  32 Ivl=4ms
0159 
0160 
0161 Supported Controllers
0162 =====================
0163 
0164 For a full list of supported controllers and associated vendor and product
0165 IDs see the xpad_device[] array\ [4]_.
0166 
0167 As of the historic version 0.0.6 (2006-10-10) the following devices
0168 were supported::
0169 
0170  original Microsoft XBOX controller (US),    vendor=0x045e, product=0x0202
0171  smaller  Microsoft XBOX controller (US),    vendor=0x045e, product=0x0289
0172  original Microsoft XBOX controller (Japan), vendor=0x045e, product=0x0285
0173  InterAct PowerPad Pro (Germany),            vendor=0x05fd, product=0x107a
0174  RedOctane Xbox Dance Pad (US),              vendor=0x0c12, product=0x8809
0175 
0176 Unrecognized models of Xbox controllers should function as Generic
0177 Xbox controllers. Unrecognized Dance Pad controllers require setting
0178 the module option 'dpad_to_buttons'.
0179 
0180 If you have an unrecognized controller please see 0.3 - Unknown Controllers
0181 
0182 
0183 Manual Testing
0184 ==============
0185 
0186 To test this driver's functionality you may use 'jstest'.
0187 
0188 For example::
0189 
0190     > modprobe xpad
0191     > modprobe joydev
0192     > jstest /dev/js0
0193 
0194 If you're using a normal controller, there should be a single line showing
0195 18 inputs (8 axes, 10 buttons), and its values should change if you move
0196 the sticks and push the buttons.  If you're using a dance pad, it should
0197 show 20 inputs (6 axes, 14 buttons).
0198 
0199 It works? Voila, you're done ;)
0200 
0201 
0202 
0203 Thanks
0204 ======
0205 
0206 I have to thank ITO Takayuki for the detailed info on his site
0207     http://euc.jp/periphs/xbox-controller.ja.html.
0208 
0209 His useful info and both the usb-skeleton as well as the iforce input driver
0210 (Greg Kroah-Hartmann; Vojtech Pavlik) helped a lot in rapid prototyping
0211 the basic functionality.
0212 
0213 
0214 
0215 References
0216 ==========
0217 
0218 .. [1] http://euc.jp/periphs/xbox-controller.ja.html (ITO Takayuki)
0219 .. [2] http://xpad.xbox-scene.com/
0220 .. [3] http://www.markosweb.com/www/xboxhackz.com/
0221 .. [4] https://elixir.bootlin.com/linux/latest/ident/xpad_device
0222 
0223 
0224 Historic Edits
0225 ==============
0226 
0227 2002-07-16 - Marko Friedemann <mfr@bmx-chemnitz.de>
0228  - original doc
0229 
0230 2005-03-19 - Dominic Cerquetti <binary1230@yahoo.com>
0231  - added stuff for dance pads, new d-pad->axes mappings
0232 
0233 Later changes may be viewed with
0234 'git log --follow Documentation/input/devices/xpad.rst'