<!DOCTYPE html>
<html lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>17. xpad - Linux USB driver for Xbox compatible controllers — The Linux Kernel documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=3918102e" />
<script src="../../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="18. Driver documentation for yealink usb-p1k phones" href="yealink.html" />
<link rel="prev" title="16. Walkera WK-0701 transmitter" href="walkera0701.html" />
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../index.html">
<img class="logo" src="../../_static/logo.svg" alt="Logo of The Linux Kernel"/>
</a></p>
<h1 class="logo"><a href="../../index.html">The Linux Kernel</a></h1>
<p class="blurb">6.18.50</p>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>
<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/index.html">All development-process docs</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../subsystem-apis.html">Subsystems</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#core-subsystems">Core subsystems</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../subsystem-apis.html#human-interfaces">Human interfaces</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="../index.html">Input Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../hid/index.html">Human Interface Devices (HID)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../sound/index.html">Sound Subsystem Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../gpu/index.html">GPU Driver Developer’s Guide</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../fb/index.html">Frame Buffer</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../leds/index.html">LEDs</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#networking-interfaces">Networking interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#storage-interfaces">Storage interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#other-subsystems">Other subsystems</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../translations/index.html">Translations</a></li>
</ul>
</div>
<script type="text/javascript"> <!--
var sbar = document.getElementsByClassName("sphinxsidebar")[0];
let currents = document.getElementsByClassName("current")
if (currents.length) {
sbar.scrollTop = currents[currents.length - 1].offsetTop;
}
--> </script>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/input/devices/xpad.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="xpad-linux-usb-driver-for-xbox-compatible-controllers">
<h1><span class="section-number">17. </span>xpad - Linux USB driver for Xbox compatible controllers<a class="headerlink" href="#xpad-linux-usb-driver-for-xbox-compatible-controllers" title="Link to this heading">¶</a></h1>
<p>This driver exposes all first-party and third-party Xbox compatible
controllers. It has a long history and has enjoyed considerable usage
as Windows’ xinput library caused most PC games to focus on Xbox
controller compatibility.</p>
<p>Due to backwards compatibility all buttons are reported as digital.
This only affects Original Xbox controllers. All later controller models
have only digital face buttons.</p>
<p>Rumble is supported on some models of Xbox 360 controllers but not of
Original Xbox controllers nor on Xbox One controllers. As of writing
the Xbox One’s rumble protocol has not been reverse-engineered but in
the future could be supported.</p>
<section id="notes">
<h2><span class="section-number">17.1. </span>Notes<a class="headerlink" href="#notes" title="Link to this heading">¶</a></h2>
<p>The number of buttons/axes reported varies based on 3 things:</p>
<ul class="simple">
<li><p>if you are using a known controller</p></li>
<li><p>if you are using a known dance pad</p></li>
<li><p>if using an unknown device (one not listed below), what you set in the
module configuration for “Map D-PAD to buttons rather than axes for unknown
pads” (module option dpad_to_buttons)</p></li>
</ul>
<p>If you set dpad_to_buttons to N and you are using an unknown device
the driver will map the directional pad to axes (X/Y).
If you said Y it will map the d-pad to buttons, which is needed for dance
style games to function correctly. The default is Y.</p>
<p>dpad_to_buttons has no effect for known pads. A erroneous commit message
claimed dpad_to_buttons could be used to force behavior on known devices.
This is not true. Both dpad_to_buttons and triggers_to_buttons only affect
unknown controllers.</p>
<section id="normal-controllers">
<h3><span class="section-number">17.1.1. </span>Normal Controllers<a class="headerlink" href="#normal-controllers" title="Link to this heading">¶</a></h3>
<p>With a normal controller, the directional pad is mapped to its own X/Y axes.
The jstest-program from joystick-1.2.15 (jstest-version 2.1.0) will report 8
axes and 10 buttons.</p>
<p>All 8 axes work, though they all have the same range (-32768..32767)
and the zero-setting is not correct for the triggers (I don’t know if that
is some limitation of jstest, since the input device setup should be fine. I
didn’t have a look at jstest itself yet).</p>
<p>All of the 10 buttons work (in digital mode). The six buttons on the
right side (A, B, X, Y, black, white) are said to be “analog” and
report their values as 8 bit unsigned, not sure what this is good for.</p>
<p>I tested the controller with quake3, and configuration and
in game functionality were OK. However, I find it rather difficult to
play first person shooters with a pad. Your mileage may vary.</p>
</section>
<section id="xbox-dance-pads">
<h3><span class="section-number">17.1.2. </span>Xbox Dance Pads<a class="headerlink" href="#xbox-dance-pads" title="Link to this heading">¶</a></h3>
<p>When using a known dance pad, jstest will report 6 axes and 14 buttons.</p>
<p>For dance style pads (like the redoctane pad) several changes
have been made. The old driver would map the d-pad to axes, resulting
in the driver being unable to report when the user was pressing both
left+right or up+down, making DDR style games unplayable.</p>
<p>Known dance pads automatically map the d-pad to buttons and will work
correctly out of the box.</p>
<p>If your dance pad is recognized by the driver but is using axes instead
of buttons, see section 0.3 - Unknown Controllers</p>
<p>I’ve tested this with Stepmania, and it works quite well.</p>
</section>
<section id="unknown-controllers">
<h3><span class="section-number">17.1.3. </span>Unknown Controllers<a class="headerlink" href="#unknown-controllers" title="Link to this heading">¶</a></h3>
<p>If you have an unknown Xbox controller, it should work just fine with
the default settings.</p>
<p>HOWEVER if you have an unknown dance pad not listed below, it will not
work UNLESS you set “dpad_to_buttons” to 1 in the module configuration.</p>
</section>
</section>
<section id="usb-adapters">
<h2><span class="section-number">17.2. </span>USB adapters<a class="headerlink" href="#usb-adapters" title="Link to this heading">¶</a></h2>
<p>All generations of Xbox controllers speak USB over the wire.</p>
<ul class="simple">
<li><p>Original Xbox controllers use a proprietary connector and require adapters.</p></li>
<li><p>Wireless Xbox 360 controllers require a ‘Xbox 360 Wireless Gaming Receiver
for Windows’</p></li>
<li><p>Wired Xbox 360 controllers use standard USB connectors.</p></li>
<li><p>Xbox One controllers can be wireless but speak Wi-Fi Direct and are not
yet supported.</p></li>
<li><p>Xbox One controllers can be wired and use standard Micro-USB connectors.</p></li>
</ul>
<section id="original-xbox-usb-adapters">
<h3><span class="section-number">17.2.1. </span>Original Xbox USB adapters<a class="headerlink" href="#original-xbox-usb-adapters" title="Link to this heading">¶</a></h3>
<p>Using this driver with an Original Xbox controller requires an
adapter cable to break out the proprietary connector’s pins to USB.
You can buy these online fairly cheap, or build your own.</p>
<p>Such a cable is pretty easy to build. The Controller itself is a USB
compound device (a hub with three ports for two expansion slots and
the controller device) with the only difference in a nonstandard connector
(5 pins vs. 4 on standard USB 1.0 connectors).</p>
<p>You just need to solder a USB connector onto the cable and keep the
yellow wire unconnected. The other pins have the same order on both
connectors so there is no magic to it. Detailed info on these matters
can be found on the net (<a class="footnote-reference brackets" href="#id5" id="id1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>, <a class="footnote-reference brackets" href="#id6" id="id2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>, <a class="footnote-reference brackets" href="#id7" id="id3" role="doc-noteref"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a>).</p>
<p>Thanks to the trip splitter found on the cable you don’t even need to cut the
original one. You can buy an extension cable and cut that instead. That way,
you can still use the controller with your Xbox, if you have one ;)</p>
</section>
</section>
<section id="driver-installation">
<h2><span class="section-number">17.3. </span>Driver Installation<a class="headerlink" href="#driver-installation" title="Link to this heading">¶</a></h2>
<p>Once you have the adapter cable, if needed, and the controller connected
the xpad module should be auto loaded. To confirm you can cat
/sys/kernel/debug/usb/devices. There should be an entry like those:</p>
<div class="literal-block-wrapper docutils container" id="id9">
<div class="code-block-caption"><span class="caption-text">dump from InterAct PowerPad Pro (Germany)</span><a class="headerlink" href="#id9" title="Link to this code">¶</a></div>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> T: Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs= 1
P: Vendor=05fd ProdID=107a Rev= 1.00
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=(none)
E: Ad=81(I) Atr=03(Int.) MxPS= 32 Ivl= 10ms
E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl= 10ms
</pre></div>
</div>
</div>
<div class="literal-block-wrapper docutils container" id="id10">
<div class="code-block-caption"><span class="caption-text">dump from Redoctane Xbox Dance Pad (US)</span><a class="headerlink" href="#id10" title="Link to this code">¶</a></div>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> T: Bus=01 Lev=02 Prnt=09 Port=00 Cnt=01 Dev#= 10 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0c12 ProdID=8809 Rev= 0.01
S: Product=XBOX DDR
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=xpad
E: Ad=82(I) Atr=03(Int.) MxPS= 32 Ivl=4ms
E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl=4ms
</pre></div>
</div>
</div>
</section>
<section id="supported-controllers">
<h2><span class="section-number">17.4. </span>Supported Controllers<a class="headerlink" href="#supported-controllers" title="Link to this heading">¶</a></h2>
<p>For a full list of supported controllers and associated vendor and product
IDs see the xpad_device[] array<a class="footnote-reference brackets" href="#id8" id="id4" role="doc-noteref"><span class="fn-bracket">[</span>4<span class="fn-bracket">]</span></a>.</p>
<p>As of the historic version 0.0.6 (2006-10-10) the following devices
were supported:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>original Microsoft XBOX controller (US), vendor=0x045e, product=0x0202
smaller Microsoft XBOX controller (US), vendor=0x045e, product=0x0289
original Microsoft XBOX controller (Japan), vendor=0x045e, product=0x0285
InterAct PowerPad Pro (Germany), vendor=0x05fd, product=0x107a
RedOctane Xbox Dance Pad (US), vendor=0x0c12, product=0x8809
</pre></div>
</div>
<p>Unrecognized models of Xbox controllers should function as Generic
Xbox controllers. Unrecognized Dance Pad controllers require setting
the module option ‘dpad_to_buttons’.</p>
<p>If you have an unrecognized controller please see 0.3 - Unknown Controllers</p>
</section>
<section id="manual-testing">
<h2><span class="section-number">17.5. </span>Manual Testing<a class="headerlink" href="#manual-testing" title="Link to this heading">¶</a></h2>
<p>To test this driver’s functionality you may use ‘jstest’.</p>
<p>For example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>> modprobe xpad
> modprobe joydev
> jstest /dev/js0
</pre></div>
</div>
<p>If you’re using a normal controller, there should be a single line showing
18 inputs (8 axes, 10 buttons), and its values should change if you move
the sticks and push the buttons. If you’re using a dance pad, it should
show 20 inputs (6 axes, 14 buttons).</p>
<p>It works? Voila, you’re done ;)</p>
</section>
<section id="thanks">
<h2><span class="section-number">17.6. </span>Thanks<a class="headerlink" href="#thanks" title="Link to this heading">¶</a></h2>
<dl class="simple">
<dt>I have to thank ITO Takayuki for the detailed info on his site</dt><dd><p><a class="reference external" href="http://euc.jp/periphs/xbox-controller.ja.html">http://euc.jp/periphs/xbox-controller.ja.html</a>.</p>
</dd>
</dl>
<p>His useful info and both the usb-skeleton as well as the iforce input driver
(Greg Kroah-Hartmann; Vojtech Pavlik) helped a lot in rapid prototyping
the basic functionality.</p>
</section>
<section id="references">
<h2><span class="section-number">17.7. </span>References<a class="headerlink" href="#references" title="Link to this heading">¶</a></h2>
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="id5" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id1">1</a><span class="fn-bracket">]</span></span>
<p><a class="reference external" href="http://euc.jp/periphs/xbox-controller.ja.html">http://euc.jp/periphs/xbox-controller.ja.html</a> (ITO Takayuki)</p>
</aside>
<aside class="footnote brackets" id="id6" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id2">2</a><span class="fn-bracket">]</span></span>
<p><a class="reference external" href="http://xpad.xbox-scene.com/">http://xpad.xbox-scene.com/</a></p>
</aside>
<aside class="footnote brackets" id="id7" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id3">3</a><span class="fn-bracket">]</span></span>
<p><a class="reference external" href="http://www.markosweb.com/www/xboxhackz.com/">http://www.markosweb.com/www/xboxhackz.com/</a></p>
</aside>
<aside class="footnote brackets" id="id8" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id4">4</a><span class="fn-bracket">]</span></span>
<p><a class="reference external" href="https://elixir.bootlin.com/linux/latest/ident/xpad_device">https://elixir.bootlin.com/linux/latest/ident/xpad_device</a></p>
</aside>
</aside>
</section>
<section id="historic-edits">
<h2><span class="section-number">17.8. </span>Historic Edits<a class="headerlink" href="#historic-edits" title="Link to this heading">¶</a></h2>
<dl class="simple">
<dt>2002-07-16 - Marko Friedemann <<a class="reference external" href="mailto:mfr%40bmx-chemnitz.de">mfr<span>@</span>bmx-chemnitz<span>.</span>de</a>></dt><dd><ul class="simple">
<li><p>original doc</p></li>
</ul>
</dd>
<dt>2005-03-19 - Dominic Cerquetti <<a class="reference external" href="mailto:binary1230%40yahoo.com">binary1230<span>@</span>yahoo<span>.</span>com</a>></dt><dd><ul class="simple">
<li><p>added stuff for dance pads, new d-pad->axes mappings</p></li>
</ul>
</dd>
</dl>
<p>Later changes may be viewed with
‘git log --follow <a class="reference internal" href="#"><span class="doc">xpad - Linux USB driver for Xbox compatible controllers</span></a>’</p>
</section>
</section>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©The kernel development community.
|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
& <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
|
<a href="../../_sources/input/devices/xpad.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>