PageRenderTime 26ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/Documentation/input/devices/xpad.rst

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