xpad.txt 6.8 KB

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