Find a file
2008-05-13 04:13:48 +02:00
directx Added DirectInputQuery from Magnus Norddahl 2008-05-12 19:29:27 +02:00
gui Fixed some syncronisation issues in the graphics 2008-04-30 13:59:39 +02:00
tools Back to stone age C standard, -std=c99 caused problems for people 2008-05-13 04:13:48 +02:00
.gitignore Ignore gitignore 2008-05-03 12:39:54 +02:00
abs_to_btn.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
abs_to_btn.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
abs_to_rel.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
abs_to_rel.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
AUTHORS Added DirectInputQuery from Magnus Norddahl 2008-05-12 19:29:27 +02:00
autofire_button.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
autofire_button.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
btn_to_abs.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
btn_to_abs.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
control.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
control.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
control_factory.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
control_factory.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
controller.scm - some new files for new input framework 2008-04-23 23:58:00 +02:00
controller2.scm - throttle class and some stuff for graph viz 2008-04-27 12:28:20 +02:00
COPYING - added copying 2008-04-11 00:06:07 +02:00
evdev_driver.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
evdev_driver.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
file_reader.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
graph.dot - throttle class and some stuff for graph viz 2008-04-27 12:28:20 +02:00
helper.cpp Added support for remapping buttons 2008-05-02 23:07:06 +02:00
helper.hpp Added support for remapping buttons 2008-05-02 23:07:06 +02:00
inputdrv.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
inputdrv.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
join_axis.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
join_axis.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
log.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
NEWS News cleanup, getting release ready 2008-05-03 12:37:06 +02:00
PROTOCOL Added daemon mode 2008-05-04 19:22:34 +02:00
README Header lines fixed 2008-05-03 12:27:20 +02:00
SConstruct Disabled inputdrv compilation 2008-05-03 12:08:12 +02:00
throttle.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
throttle.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
TODO Added missing header 2008-05-06 12:30:23 +02:00
toggle_button.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
toggle_button.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
uinput.cpp Added missing header 2008-05-13 04:10:21 +02:00
uinput.hpp Added dpad only option 2008-05-03 00:14:27 +02:00
uinput_driver.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
uinput_driver.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
usb.txt - added readme 2008-04-11 00:05:35 +02:00
xbox360_controller.cpp Added support for remapping buttons 2008-05-02 23:07:06 +02:00
xbox360_controller.hpp Documentation update, fixed guitar support, deadzone support, led indicate jsdev now 2008-05-02 18:19:59 +02:00
xbox360_driver.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
xbox360_driver.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
xbox360_usb_thread.cpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
xbox360_usb_thread.hpp Replaced Windstille copyright header with proper Xboxdrv one 2008-05-01 09:46:43 +02:00
xbox360_wireless_controller.cpp Added support for remapping buttons 2008-05-02 23:07:06 +02:00
xbox360_wireless_controller.hpp Documentation update, fixed guitar support, deadzone support, led indicate jsdev now 2008-05-02 18:19:59 +02:00
xbox_controller.cpp Documentation update, fixed guitar support, deadzone support, led indicate jsdev now 2008-05-02 18:19:59 +02:00
xbox_controller.hpp Documentation update, fixed guitar support, deadzone support, led indicate jsdev now 2008-05-02 18:19:59 +02:00
xbox_generic_controller.hpp Documentation update, fixed guitar support, deadzone support, led indicate jsdev now 2008-05-02 18:19:59 +02:00
xboxdrv.cpp Added missing header 2008-05-06 12:30:23 +02:00
xboxdrv.hpp Moved a bunch of code from xboxdrv into xboxmsg, print axis and buttonmap with names instead of integer 2008-05-03 12:22:46 +02:00
xboxmsg.cpp Moved a bunch of code from xboxdrv into xboxmsg, print axis and buttonmap with names instead of integer 2008-05-03 12:22:46 +02:00
xboxmsg.hpp Moved a bunch of code from xboxdrv into xboxmsg, print axis and buttonmap with names instead of integer 2008-05-03 12:22:46 +02:00

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[[ Xbox/Xbox360 USB Gamepad Driver for Userspace ]]
===================================================

This is a Xbox/Xbox360 gamepad driver for Linux that works in
userspace. It is a alternative to the xpad kernel driver and has
support for Xbox1 gamepads, Xbox360 USB gamepads and Xbox360 wireless
gamepads. The Xbox360 guitar and some Xbox1 dancemats might work too.



[[ Compilation ]]
-----------------

Required libraries and tools:

 * libusb
 * boost
 * scons
 * uinput

You can compile by typing:

 % scons


[[ Running XboxDrv ]]
---------------------

First make sure that the xpad kernel module does not get loaded,
either by deleting or renaming it. rmmod might not be enough since it
might be automatically loaded again.

Next you have to load the uinput kernel module which allows userspace
programms to create input devices and the joydev module which gives
you the /dev/input/jsX device:

 % modprobe uinput
 % modprobe joydev

You also have to make sure that you have access rights to
/dev/input/uinput, either add yourself to the appropriate group,
adjust the permissions or run xboxdrv as root.

Once ensured that xpad is out of the way and everything is in palce
plug in your Xbox360 gamepad and start the userspace driver with:

 % ./xboxdrv

This will create /dev/input/js0 and allow you to access the gamepad
from any game. To exit the driver press Ctrl-c.

If you have multiple wired controllers you need to start multiple instances
of the xboxdrv driver and append the -i argument like this:

 % ./xboxdrv -i 1

If you have multiple wireless controller you need to start multiple
instances of the xboxdrv driver and append the --wid argument like
this:

 % ./xboxdrv --wid 1

You have to sync the wireless controller as usual.

This will then use the second detected controller, see to see which id
your controller has:

 % ./xboxdrv --list-controller

When everything works as expected it is recomment that you run xboxdrv
with the silent option:

 % ./xboxdrv --silent

This will suppress the logging of events to the console and will
gurantee that no uneccesarry CPU cycles are wasted.

If you want to abuse the led or rumble of the gamepad for notification
in scripts you can do see via:

 % ./xboxdrv --led 10 --rumble 30,30 --quit

This will cause a mild rumble and the led to rotate, you can stop it
again via, which also happens to be the command you can use to stop
your Xbox360 controller from blinking:

 % ./xboxdrv -q

For rumble to work make sure you have connected the controller to a
USB port that has enough power, i.e. an unpowered USB hub might not
work.

[[ Button Remapping ]]
----------------------

Button remapping is available via the --buttonmap option. If you want
to swap button A and B start with:

 % ./xboxdrv --buttonmap A=B,B=A

If you want all face buttons send out A button events:

 % ./xboxdrv --buttonmap B=A,X=A,Y=A

Possible button names are: start, guide, back, a, b, x, y, black,
white, lb, rb, lt, rt, tl, tr, du, dd, dl, dr

[[ Axis Remapping ]]
--------------------

Axis remapping is available via --axismap and works the same as button
mapping. In addition you can supply a sign to indicate that an axis
should be inverted. So if you want to invert the y1 axis start with:

 % ./xboxdrv --buttonmap -Y1=Y1

If you want to swap the left and right stick start with:

 % ./xboxdrv --buttonmap X2=X1,Y2=Y1,X1=X2,Y1=Y2

Possible axis names are: x1,y1,x2,y2,lt,rt

Swaping lt or rt with x1,y1,x2,y2 will not work properly.

[[Running InputDrv]]
--------------------

The programs inputdrv and gui/inputcfg.py are part of an experiment to
create a very flexible input configuration framework. They are still
in development and not of any use unless you want to hack the
source. Their compilation is disabled by default.

[[ SDL Notes ]]
---------------

To let SDL know which axis act as a hat and which act as normal axis
you have to set an environment variable:

 % SDL_LINUX_JOYSTICK="'Xbox360 Gamepad (userspace driver)' 6 1 0"
 % export SDL_LINUX_JOYSTICK

This will let the DPad act as Hat in case you need that for any
game. For most games the driver should work as-is.

See ftp://ptah.lnf.kth.se/pub/misc/sdl-env-vars for more information.


[[ Troubleshooting ]]
---------------------

1) "No Xbox or Xbox360 controller found"
----------------------------------------

This means that either your controller isn't plugged in or not
recognized by the driver. To fix this you need to know the idVendor
and the idProduct numbers, which you can find out via:

 % lsusb -v

Once done you can try to add them to the array:

XPadDevice xpad_devices[] = { ... } in xboxdrv.c. 

If you have success with that, send a patch to grumbel@gmx.de, if not,
contact me too, I might be able to provide additional help.

As an alternative you can also use the --device and --type option to
enforce a USB device as well as a controller type an bypass any auto
detection.


2) "Unknown data: bytes: 3 Data: ..."
-------------------------------------

This means that your controller is sending data that isn't understood
by the driver. If your controller still works, you can just ignore it,
the Xbox360 controller seems to send out useless data every now and
then. If your controller does not work and you get plenty of those
lines when you move the sticks or press buttons it means that your
controller talks an un-understood protocol and some reverse
enginiering is required. Contact grumbel@gmx.de and include the output
of:

 % lsusb -v

Along with all the "Unknown data" lines you get.


3) Program starts and then just does nothing
--------------------------------------------

This is what the program is supposed to do. After you started it will
give you basically two devices, a new /dev/input/eventX and a
/dev/input/jsX. You can access and test your controller with jstest
and evtest applications (available from your distribution or in the
tools/ subdirectory). Or in case you want just see if your driver is
working correctly you can pass the -v option:

 % ./xboxdrv -v 

This will cause the driver to output all the events that it received
from the controller.


4) "Error: No stuitable uinput device found"
--------------------------------------------

Make sure that uinput and joydev kernel modules are loaded. Make sure
that you have a /dev/input/uinput, /dev/uinput or /dev/misc/uinput and
permissions to access it.

Before reporting this as a bug make sure you have tested if the driver
itself works with:

 % ./xboxdrv --no-uinput -v


5) The wireless controller doesn't work
----------------------------------------

You have to sync the controller befor it can be used, restart of the
driver isn't needed and the driver should let you now when it recieves
a connection after you sync the controller.


# EOF #