xpad.txt 8.3 KB

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