You are not logged in.

#1 2014-10-12 23:37:17

ThePacman
Member
From: Classified
Registered: 2013-09-19
Posts: 127

xboxdrv without root?

I'm trying to run the xboxdrv driver as a systemd user service (so that I can start the service when I want to use it for keyboard mapping, etc, and stop it when I want to play a game that supports the controller directly via Joydev), but I can't get xboxdrv itself working without root.
I have already set permissions up so I can cat /dev/input/js* without root, but it seems xboxdrv is doing something a little lower-level, something I can't control via udev and permissions. It seems to be bypassing the filesystem altogether and trying to access the controller via something called "libusb".

Here's the output of a few commands that might be helpful:

$ xboxdrv
xboxdrv 0.8.5 - http://pingus.seul.org/~grumbel/xboxdrv/ 
Copyright © 2008-2011 Ingo Ruhnke <grumbel@gmx.de> 
Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 
This program comes with ABSOLUTELY NO WARRANTY. 
This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details. 

Controller:        Afterglow Gamepad for Xbox 360
Vendor/Product:    0e6f:0213
USB Path:          005:007
Controller Type:   Xbox360

-- [ ERROR ] ------------------------------------------------------
USBController::USBController(): libusb_open() failed: LIBUSB_ERROR_ACCESS
$ sudo xboxdrv
xboxdrv 0.8.5 - http://pingus.seul.org/~grumbel/xboxdrv/ 
Copyright © 2008-2011 Ingo Ruhnke <grumbel@gmx.de> 
Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 
This program comes with ABSOLUTELY NO WARRANTY. 
This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details. 

Controller:        Afterglow Gamepad for Xbox 360
Vendor/Product:    0e6f:0213
USB Path:          005:007
Controller Type:   Xbox360

Your Xbox/Xbox360 controller should now be available as:
  /dev/input/js1
  /dev/input/event9

Press Ctrl-c to quit, use '--silent' to suppress the event output
[SUCCESS]
^C
$ xboxdrv -L    
 id | wid | idVendor | idProduct | Name
----+-----+----------+-----------+--------------------------------------
  0 |   0 |   0x0e6f |    0x0213 | Afterglow Gamepad for Xbox 360
$ 

What do I do? The current systemd user service I'll be using once I get it working is this:

# ~/.config/user/systemd/xboxdrv.service
[Unit]
Description=XBox controller keyboard bindings

[Service]
Type=simple
ExecStart=/usr/bin/xboxdrv -D -c ~/.config/xboxdrv/xboxdrv.conf
PIDFile=%h/.config/xboxdrv/xboxdrv.pid

[Install]
WantedBy=multi-user.target

(If there are any glaringly obvious errors in that, please give me a heads up! wink )


Fedora believes in "software freedom" - that is, restricting user software choices to those deemed appropriately licensed by The Powers That Be.
Arch believes in "freedom", as well - the user has control over his or her system and can do what he wants with it.
https://fedoraproject.org/wiki/Forbidden_items | https://wiki.archlinux.org/index.php/The_Arch_Way

Offline

#2 2014-10-13 00:00:55

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,367

Re: xboxdrv without root?

Do you have xf86-input-joystick installed?  You should be able to use the joystick in X just fine.  All I had to do was plug it in and it was recognized without further problems.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2014-10-13 00:24:04

ThePacman
Member
From: Classified
Registered: 2013-09-19
Posts: 127

Re: xboxdrv without root?

nomorewindows wrote:

Do you have xf86-input-joystick installed?  You should be able to use the joystick in X just fine.  All I had to do was plug it in and it was recognized without further problems.

In my post, I indicated that the end goal was to be able to quickly turn the xbox-to-keyboard binding on and off. If I install the xf86-input-joystick drivers, won't that just make the keyboard mapping always-on? And changing it would require changing global configuration and then restarting the X server?
If the xf86-input-joystick keyboard control can be turned on and off quickly, and without restarting the X server, then I would like to know how to do this, but, if not, then that will not be of any use to me.


Fedora believes in "software freedom" - that is, restricting user software choices to those deemed appropriately licensed by The Powers That Be.
Arch believes in "freedom", as well - the user has control over his or her system and can do what he wants with it.
https://fedoraproject.org/wiki/Forbidden_items | https://wiki.archlinux.org/index.php/The_Arch_Way

Offline

#4 2014-10-13 00:35:42

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,367

Re: xboxdrv without root?

This xbox to keyboard feature is it something in the xboxdrv package?   Most programs change the buttons that do certain actions configured from whatever joystick-aware program you are using.  I just plugged my joystick in, and it is located under /dev/input/js0, with input group and 0664 for the mode.  You'll just have to try it to see what it behaves like.  If it requires xboxdrv to even work, it may not do anything.  The linuxconsole package also allows for testing of the joystick interface.

Last edited by nomorewindows (2014-10-13 01:44:55)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2014-10-13 14:31:49

ThePacman
Member
From: Classified
Registered: 2013-09-19
Posts: 127

Re: xboxdrv without root?

nomorewindows wrote:

This xbox to keyboard feature is it something in the xboxdrv package?   Most programs change the buttons that do certain actions configured from whatever joystick-aware program you are using.  I just plugged my joystick in, and it is located under /dev/input/js0, with input group and 0664 for the mode.  You'll just have to try it to see what it behaves like.  If it requires xboxdrv to even work, it may not do anything.  The linuxconsole package also allows for testing of the joystick interface.

xf86-input-joystick is similar to xboxdrv, except it's tied to the X server, and so it cannot reload its configuration or be enabled/disabled without editing system-wide configuration files and restarting the X server.
I'm sure xf86-input-joystick would work perfectly well for keyboard mapping. But if I'm going to use something that requires root to run and change, I may just as well set xboxdrv up as a system service instead, since that way I could at least still change the mappings and enable/disable it without restarting the X server. It would still require root, though, and that's what I'd like to avoid if at all possible.

Last edited by ThePacman (2014-10-13 14:39:01)


Fedora believes in "software freedom" - that is, restricting user software choices to those deemed appropriately licensed by The Powers That Be.
Arch believes in "freedom", as well - the user has control over his or her system and can do what he wants with it.
https://fedoraproject.org/wiki/Forbidden_items | https://wiki.archlinux.org/index.php/The_Arch_Way

Offline

#6 2014-10-13 14:47:52

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,367

Re: xboxdrv without root?

You could put your user in the input group if that is what xboxdrv is using in the /dev files.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#7 2014-10-13 15:17:26

ThePacman
Member
From: Classified
Registered: 2013-09-19
Posts: 127

Re: xboxdrv without root?

nomorewindows wrote:

You could put your user in the input group if that is what xboxdrv is using in the /dev files.

As I stated in my original post, I've already set up the controller's device in /dev for rootless access. It's the libusb that xboxdrv uses that seems to be bypassing the filesystem and not receiving access thereby.


Fedora believes in "software freedom" - that is, restricting user software choices to those deemed appropriately licensed by The Powers That Be.
Arch believes in "freedom", as well - the user has control over his or her system and can do what he wants with it.
https://fedoraproject.org/wiki/Forbidden_items | https://wiki.archlinux.org/index.php/The_Arch_Way

Offline

#8 2014-10-13 15:42:23

ThePacman
Member
From: Classified
Registered: 2013-09-19
Posts: 127

Re: xboxdrv without root?

Okay, next time I get a chance, I'll be following the ideas here: http://www.generalcriticism.com/weblog/2013/09/16/0/


Fedora believes in "software freedom" - that is, restricting user software choices to those deemed appropriately licensed by The Powers That Be.
Arch believes in "freedom", as well - the user has control over his or her system and can do what he wants with it.
https://fedoraproject.org/wiki/Forbidden_items | https://wiki.archlinux.org/index.php/The_Arch_Way

Offline

#9 2014-10-13 16:31:40

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,367

Re: xboxdrv without root?

It's looking for uinput a file that doesn't exist in /dev/input.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB