PDA

View Full Version : Xboxdrv Userspace driver as a Systemd daemon



XirXes
8th March 2013, 06:28 AM
I have been struggling with this for a few days and finally cracked it. The xboxdrv driver is an alternative to the xpad kernel module. It's a little more configurable so that's why I wanted to use it. The problem was I didn't want to run in a terminal all the time, I just wanted it to work in the background. My solution eventually became to use Systemd to run it. Here's my unit file.


[Unit]
Description=Xbox controller driver daemon

[Service]
Type=forking
User=root
PIDFile=/var/run/xboxdrv.pid
ExecStart=/bin/xboxdrv --daemon --detach --pid-file /var/run/xboxdrv.pid --dbus disabled --silent --dpad-as-button --trigger-as-zaxis --deadzone 4000 --deadzone-trigger 10%

[Install]
WantedBy=multi-user.target

The trick to getting it to actually get it to work headless is the --dbus disabled argument. Without that it crashes every time as it has no environment variables.

Pretty much every variable after --silent is fair game for configuration. My controller is set up for use in xbmc. I have tested it and the controller is hotplugable. It does survive standby aswell.

sebbasttian
21st March 2013, 06:17 PM
Hi!

I've trying to install this driver but I have a problem that I can't resolve:

I downloaded the latest version (xboxdrv-linux-0.8.4.tar.bz2) from the official web and when I try to compile it scons shows this error:
"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"

I've already check everything what is says in this page http://www.linuxquestions.org/questions/linux-games-33/cannot-get-xboxdrv-to-compile-scons-refuses-to-find-my-libusb-1-0-pc-876399/ but it doesn't work on my PC. I have everything identical to what it says there and still doesn't work and I can't find out why.

Please, could you tell me how did you installed it?

Thanks!

PabloTwo
21st March 2013, 07:15 PM
Have you tried,

# yum install libusb-devel
The libusb-devel package will install the pkg-config and header files for libusb.

sebbasttian
21st March 2013, 08:52 PM
Thanks for your answer,


Have you tried,

# yum install libusb-devel
The libusb-devel package will install the pkg-config and header files for libusb.

Yes, and I checked, just in case:


~$ sudo yum list installed | grep 'libusb-devel'
libusb-devel.x86_64 1:0.1.3-11.fc18 @fedora
~$


I've also verified the paths and there seems to be nothing wrong, but still doesn't work :(