xboxdrv Screenshot Userspace XBox/XBox360 Gamepad Driver

  • runs in userspace on top of libusb, no kernel recompile required, very easy to get started
  • gives you what you would expect from a driver, like a normal joystick device and a event device
  • allows you to handle analog-triggers as a single z-axis, as buttons or as seperate axis
  • allows you to handle the dpad as buttons or as axis
  • allows you to set the LED status of the XBox360 gamepad
  • supports rumble
  • allows mouse and keyboard emulation
  • supports the use of multiple gamepads

License: free
Requirements: libusb, scons, boost, uinput

Sound:Play in X:Play in Console:Multiplayer:Network Play:3D Acceleration:Source Available:
noyesyesnononoyes
Suggest an update

Comments

This would be a great addition to any Linux Distro!
This is my output when attempting to compile via "scons" ANY IDEAS WOULD BE APPRECIATED...

scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... g++ -o uinput.o -c -g -O0 -Wall uinput.cpp uinput.cpp: In constructor 'uInput::uInput(GamepadType, uInputCfg)': uinput.cpp:45: error: 'strerror' was not declared in this scope uinput.cpp:59: error: 'EXIT_FAILURE' was not declared in this scope uinput.cpp:59: error: 'exit' was not declared in this scope uinput.cpp:74: error: 'EXIT_FAILURE' was not declared in this scope uinput.cpp:74: error: 'exit' was not declared in this scope uinput.cpp: In member function 'void uInput::setup_xbox360_gamepad(GamepadType)': uinput.cpp:148: error: 'memset' was not declared in this scope uinput.cpp:149: error: 'strncpy' was not declared in this scope uinput.cpp: In member function 'void uInput::setup_xbox360_guitar()': uinput.cpp:233: error: 'memset' was not declared in this scope uinput.cpp:234: error: 'strncpy' was not declared in this scope uinput.cpp: In member function 'void uInput::send_button(uint16_t, int32_t)': uinput.cpp:260: error: 'memset' was not declared in this scope uinput.cpp: In member function 'void uInput::send_axis(uint16_t, int32_t)': uinput.cpp:274: error: 'memset' was not declared in this scope scons: *** [uinput.o] Error 1 scons: building terminated because of errors.

Re: COMPILE ISSUES posted by desertmax on Feb 22 2009 8:11 PM

uinput.cpp / uinput.h is probably missing the following two lines at the very top (maybe others):

#include <cstdlib>
#include <cstring>

In g++ 4.3 or so the standard header files have been edited to only include other header files that they absolutly depend on. So, for example, the devs could have included "limits" and forgot to include "cstdlib" which happened "automagically" on their machines, but because you are using newer header files, this won't work on your machine.

Please also send an e-mail to the developers to inform them about this error. :-)

Hi I get this error, even when I edit the scons config file, and pont to anotheir drectory Im getting a syntax error on LIBS=['boost_signals', 'usb', 'pthread'])

scons: Reading SConscript files ... Checking for C++ library X11... yes Checking for C++ library usb... yes Checking for C++ header file boost/thread/thread.hpp... yes Checking for C++ library boost_thread-mt... yes scons: done reading SConscript files. scons: Building targets ... o src/arg_parser.o -c -g -O2 -Wall -ansi -pedantic src/arg_parser.cpp sh: o: command not found o src/command_line_options.o -c -g -O2 -Wall -ansi -pedantic src/command_line_options.cpp sh: o: command not found o src/evdev_helper.o -c -g -O2 -Wall -ansi -pedantic src/evdev_helper.cpp sh: o: command not found o src/firestorm_dual_controller.o -c -g -O2 -Wall -ansi -pedantic src/firestorm_dual_controller.cpp sh: o: command not found o src/force_feedback_handler.o -c -g -O2 -Wall -ansi -pedantic src/force_feedback_handler.cpp sh: o: command not found o src/helper.o -c -g -O2 -Wall -ansi -pedantic src/helper.cpp sh: o: command not found o src/linux_uinput.o -c -g -O2 -Wall -ansi -pedantic src/linux_uinput.cpp sh: o: command not found o src/modifier.o -c -g -O2 -Wall -ansi -pedantic src/modifier.cpp sh: o: command not found o src/pretty_printer.o -c -g -O2 -Wall -ansi -pedantic src/pretty_printer.cpp sh: o: command not found o src/uinput.o -c -g -O2 -Wall -ansi -pedantic src/uinput.cpp sh: o: command not found o src/usb_read_thread.o -c -g -O2 -Wall -ansi -pedantic src/usb_read_thread.cpp sh: o: command not found o src/xbox360_controller.o -c -g -O2 -Wall -ansi -pedantic src/xbox360_controller.cpp sh: o: command not found o src/xbox360_wireless_controller.o -c -g -O2 -Wall -ansi -pedantic src/xbox360_wireless_controller.cpp sh: o: command not found o src/xbox_controller.o -c -g -O2 -Wall -ansi -pedantic src/xbox_controller.cpp sh: o: command not found o src/xboxdrv.o -c -g -O2 -Wall -ansi -pedantic src/xboxdrv.cpp sh: o: command not found o src/xboxmsg.o -c -g -O2 -Wall -ansi -pedantic src/xboxmsg.cpp sh: o: command not found o src/xpad_device.o -c -g -O2 -Wall -ansi -pedantic src/xpad_device.cpp sh: o: command not found o xboxdrv src/xboxdrv.o src/xboxmsg.o src/uinput.o src/arg_parser.o src/pretty_printer.o src/helper.o src/modifier.o src/command_line_options.o src/xbox_controller.o src/xpad_device.o src/xbox360_controller.o src/xbox360_wireless_controller.o src/firestorm_dual_controller.o src/evdev_helper.o src/linux_uinput.o src/usb_read_thread.o src/force_feedback_handler.o -lX11 -lX11 -lusb -lusb -lboost_thread-mt -lboost_thread-mt sh: o: command not found scons: done building targets. >scons (9563) returned '116'

In attempting to build release 0.4.10, I get the following:
scons: Reading SConscript files ...
Checking for C++ library X11... (cached) yes
Checking for C++ library usb... (cached) yes
Checking for C++ header file boost/thread/thread.hpp... (cached) yes
Checking for C++ library boost_thread-mt... (cached) no
Checking for C++ library boost_thread... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
g++ -o src/command_line_options.o -c -g -O2 -Wall -ansi -pedantic src/command_line_options.cpp
src/modifier.hpp: In constructor 'AutoFireModifier::AutoFireModifier(const std::vector >&)':
src/modifier.hpp:118: warning: passing 'float' for argument 1 to 'void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = int, _Alloc = std::allocator]'
src/modifier.hpp: In member function 'void AutoFireModifier::update(int, XboxGenericMsg&)':
src/modifier.hpp:133: warning: converting to 'int' from 'float'
/usr/include/linux/uinput.h: At global scope:
/usr/include/linux/uinput.h:39: error: field 'effect' has incomplete type
/usr/include/linux/uinput.h:127: error: field 'id' has incomplete type
/usr/include/linux/uinput.h:129: error: 'ABS_MAX' was not declared in this scope
/usr/include/linux/uinput.h:130: error: 'ABS_MAX' was not declared in this scope
/usr/include/linux/uinput.h:131: error: 'ABS_MAX' was not declared in this scope
/usr/include/linux/uinput.h:132: error: 'ABS_MAX' was not declared in this scope
src/linux_uinput.hpp:44: error: 'ABS_CNT' was not declared in this scope
src/linux_uinput.hpp:45: error: 'REL_CNT' was not declared in this scope
src/linux_uinput.hpp:46: error: 'KEY_CNT' was not declared in this scope
src/linux_uinput.hpp:47: error: 'FF_CNT' was not declared in this scope
scons: *** [src/command_line_options.o] Error 1
scons: building terminated because of errors.
and I get similar or identical results in attempting to build the development version found on the morning of 16 April.

I use RHEL 5.4 on a 686.

Re: Build Error posted by grumbel on Apr 18 2010 1:19 AM
I fixed the error in src/modifier.hpp in the development version. Not sure what is going on with /usr/include/linux/uinput.h. Which compiler are you using and what kernel version are you running?
Re: Build Error posted by Oeconomist on Apr 18 2010 7:44 AM
For the kernel, I default to the PAE (Physical Address Extension) version of 2.6.18-164. My system has gcc 4.1.2-46 installed. (I need to renew my Red Hat subscription, or migrate to something else.)
Re: Build Error posted by grumbel on May 26 2010 10:48 PM
Adding #include <linux/input.h> to the top of the files that have issues with uinput.h might help.
Re: Build Error posted by Oeconomist on Aug 15 2010 11:48 AM
After updating to the most recent version of RHEL 5.5, and d'loading the latest tarball of xboxdrv, I again attempted compilation. Here is the output:
scons: Reading SConscript files ...
Checking for C++ library X11... (cached) yes
Checking for C++ library usb... (cached) yes
Checking for C++ header file boost/thread/thread.hpp... (cached) yes
Checking for C++ library boost_thread-mt... (cached) no
Checking for C++ library boost_thread... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
g++ -o src/axis_event.o -c -g -O2 -Wall -ansi -pedantic -DPACKAGE_VERSION='"0.5.0"' src/axis_event.cpp
src/linux_uinput.hpp:44: error: 'ABS_CNT' was not declared in this scope
src/linux_uinput.hpp:45: error: 'REL_CNT' was not declared in this scope
src/linux_uinput.hpp:46: error: 'KEY_CNT' was not declared in this scope
src/linux_uinput.hpp:47: error: 'FF_CNT' was not declared in this scope
src/axis_event.cpp: In member function 'void AxisEvent::send(uInput&, int, int) const':
src/axis_event.cpp:313: warning: converting to 'int' from 'float'
scons: *** [src/axis_event.o] Error 1
scons: building terminated because of errors.
*shrug*
0.6.2 was just announced today? I've been running 0.6.6 for at least a month and the current version, out for a couple weeks now, is 0.7.1.
Re: 0.6.2? posted by damn on Feb 16 2011 5:52 PM
Ummm. Well, in case you were living under a rock, this site was down for a while and the updates are backed up. This update is from the backlog. The new update will be posted by the time they catch up to current news.
Re: 0.6.2? posted by raindog on Feb 18 2011 12:14 AM
Yep, if by "living under a rock" you mean "only visiting the site when I see an interesting update in my RSS reader, like with my other 289 subscriptions", then I was indeed "living under a rock".

Congratulations to Happy Penguin for (apparently) recovering from some downtime.

Hi Guys

I'm trying to compile xboxdrv 0.7.3 but Scons simply refuses to work:

>Package libusb-1.0 was not found in the pkg-config search path. >Perhaps you should add the directory containing `libusb-1.0.pc' >to the PKG_CONFIG_PATH environment variable >No package 'libusb-1.0' found

I'm on FC11.

I do have libusb-1.0.pc:

>[root@stefanlinux include]# find / -name libusb-1.0.pc >/usr/local/lib/pkgconfig/libusb-1.0.pc >[root@stefanlinux include]#

and I do have the environment variable PKG_CONFIG_PATH set to this path:

>[root@stefanlinux include]# set | grep PKG_CONFIG >PKG_CONFIG_PATH=/usr/local/lib/pkgconfig >[root@stefanlinux include]#

I can call pkg-config for libusb just fine from the command line, when in any directory:

>[root@stefanlinux include]# pkg-config libusb-1.0 --cflags --libs >-I/usr/local/include/libusb-1.0 -L/usr/local/lib -lusb-1.0 >[root@stefanlinux include]#

E. g. I do have all the requirements, yet scons never finds libusb-1.0.pc which is in /usr/local/lib/pkgconfig where it should be?

How can I get xboxdrv's scons to FIND libusb-1.0.pc??

Thanks!

Re: Compiling xboxdrv question - scons posted by rylan76 on Apr 23 2011 10:30 AM
Hi Guys

If anybody's interested, I solved my above problem of scons not finding libusb by doing this:

[root@stefanlinux pkgconfig]# pwd /usr/lib/pkgconfig [root@stefanlinux pkgconfig]# ln -s /usr/local/lib/pkgconfig/libusb-1.0.pc libusb-1.0.pc

After doing this, scons was able to find libusb on my system...!

Log in or register to rate this game or post a comment.