Re: [OxLUG] Problems with userspace USB permissions

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: James Davis
Date:  
To: Oxfordshire Linux User Group Discussion List
Subject: Re: [OxLUG] Problems with userspace USB permissions
Okay so I'm getting somewhere - apologies for having been a bit slow
to post my progress. I've got the following two rules that are
helping:

KERNEL=="uinput", MODE="0660", GROUP="games"

...which fixed one problem. And as suggested I put the following:

BUS=="usb", SYSFS{idVendor}=="045e", SYSFS{idProduct}=="0719",
MODE="0660", GROUP="games"

However the device created under /dev/bus/usb/ still comes up
belonging to group 'root' rather than 'games. Adding my user account
to the root group fixes the problem of course, and the driver then
works in userspace - but I'd rather avoid this if I can.

James


On Sat, Mar 14, 2015 at 6:07 PM, Henry Vermaak <> wrote:
> On Sat, Mar 14, 2015 at 12:26:30PM +0000, James Davis wrote:
>> Running wheezy on a raspberry pi...
>>
>> I'm using xboxdrv, driver for xbox360 controllers that runs in
>> userspace. Works perfectly as a root - which is great when it's
>> running as a daemon but not so useful if I want to tweak the
>> configuration on a per-game basis.
>>
>> It should work as a normal user but I get the following error:
>>
>> -- [ ERROR ] ------------------------------------------------------
>>
>> USBController::USBController(): libusb_open() failed: LIBUSB_ERROR_ACCESS
>>
>> strace says that it's failing to open /dev/bus/usb/001/007 but
>> manually tweaking the access permissions (which I know can't be the
>> right fix) just results in further errors
>>
>> [ 0.000000] [00000e1d] libusbx: error [do_close] Device handle closed
>> while transfer was still being processed, but the device is still
>> connected as far as we know
>> [ 0.005951] [00000e1d] libusbx: error [do_close] Device handle closed
>> while transfer was still being processed, but the device is still
>> connected as far as we know
>> [ 0.006115] [00000e1d] libusbx: error [do_close] A cancellation hasn't
>> even been scheduled on the transfer for which the device is closing
>>
>> Any suggestions? Have I got something wrong in my USB setup?
>
> Udev is responsible for changing the permissions and group of the dev
> node, so maybe that rule is missing on your system. You can make a rule
> yourself if this is the case, for example:
>
> hcv@hcv-q45:~$ cat /etc/udev/rules.d/55-mydevice.rules
> ATTRS{idVendor}=="1234", ATTRS{idProduct}=="abcd", MODE="0664", GROUP="plugdev"
>
> Where you fill in the correct VID/PID in hex (check dmesg when you plug
> it in). Then make sure your user is in the plugdev group.
>
> Henry
>