USB insufficient permissions?

Home Forums AR Sandbox Forum USB insufficient permissions?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #102767
    maphew
    Participant

    Hello. I used to have SARndbox 1.6 running on Ubuntu. The hard drive died so when rebuilding I decided to go to clean install of Linux Mint 18 and SARndbox 2.3. Everything works up to the point of using RawKinectViewer or SARndbox. The error is Caught exception USB::Device::open: Insufficient device permissions.

    The only hardware change is the hard drive. Nothing else has been added or removed and the installation itself has been untouched.

    Any hints what I need to do to fix this?

    `
    hello@sandbox ~ $ RawKinectViewer -compress 0
    Caught exception USB::Device::open: Insufficient device permissions

    hello@sandbox ~ $ lsusb
    Bus 001 Device 007: ID 413c:2005 Dell Computer Corp. RT7D50 Keyboard
    Bus 001 Device 006: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
    Bus 001 Device 003: ID 0409:0058 NEC Corp. HighSpeed Hub
    Bus 001 Device 005: ID 045e:02ae Microsoft Corp. Xbox NUI Camera
    Bus 001 Device 004: ID 045e:02ad Microsoft Corp. Xbox NUI Audio
    Bus 001 Device 002: ID 045e:02c2 Microsoft Corp. Kinect for Windows NUI Motor
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    `

    —-
    Update: They work if I run in sudo mode, however this is really sub-optimal. Eventually this will be running almost unattended and we don’t need it operating with root priviliges. 😉

    • This topic was modified 3 years, 9 months ago by maphew.
    #102769
    maphew
    Participant

    By way of other posts in the forum I discovered there needs to be a rule added to /etc/udev/rules.d/ to allow non-sudo use of the camera. In the Kinect makefile I see the logic that is supposed to add the file, but for some reason it is not being triggered or used properly.

    This line in the makefile doesn’t get executed: @sudo install -m u=rw,go=r share/70-Kinect.rules $(UDEVRULEDIR)

    
    hello@sandbox ~/src/Kinect-3.2 $ sudo make install
    ---- Kinect configuration options: ----
    Support for Intel RealSense cameras via librealsense library disabled
    CPU-based facade projector selected
    ---- Kinect installation configuration ----
    Root installation directory: /usr/local
    Calibration data directory: /usr/local/etc/Vrui-4.2/Kinect-3.2
    Resource data directory: /usr/local/share/Vrui-4.2/Kinect-3.2
    Vislet plug-in directory: /usr/local/lib/x86_64-linux-gnu/Vrui-4.2/VRVislets
    ---- End of Kinect configuration options: ----
    Installing header files...
    Installing libraries...
    Configuring run-time linker...
    Installing executables...
    Installing vislet plugins...
    Installing configuration files...
    Installing resource files...
    Installing makefile fragments...
    hello@sandbox ~/src/Kinect-3.2 $ sudo make installdevrules
    make: 'installdevrules' is up to date.
    hello@sandbox ~/src/Kinect-3.2 $ RawKinectViewer -compress 0
    Caught exception USB::Device::open: Insufficient device permissions
    
    hello@sandbox ~/src/Kinect-3.2 $ ls -l /etc/udev/rules.d/
    total 4
    -rw-r--r-- 1 root root 2233 Dec  3 20:30 69-Vrui-devices.rules
    
    hello@sandbox ~/src/Kinect-3.2 $ sudo make installdevrule
    make: 'installdevrule' is up to date.
    
    hello@sandbox ~/src/Kinect-3.2 $ sudo make uninstalldevrule
    make: 'uninstalldevrule' is up to date.
    
    hello@sandbox ~/src/Kinect-3.2 $ sudo make installdevrule
    make: 'installdevrule' is up to date.
    
    hello@sandbox ~/src/Kinect-3.2 $ ls -l /etc/udev/rules.d
    total 4
    -rw-r--r-- 1 root root 2233 Dec  3 20:30 69-Vrui-devices.rules
    

    —–
    Aha! the source file 70-Kinect.rules doesn’t exist:

    
    hello@sandbox ~/src/Kinect-3.2 $ sudo install -m u=rw,go=r share/70-Kinect.rules /etc/udev/rules.d/
    install: cannot stat 'share/70-Kinect.rules': No such file or directory
    hello@sandbox ~/src/Kinect-3.2 $ ls -l share
    total 12
    -rw-r--r-- 1 hello hello 1016 Oct 14 16:23 69-Kinect.rules
    -rw-r--r-- 1 hello hello  306 Dec  4 15:02 Configuration.Kinect
    drwxr-xr-x 2 hello hello 4096 Dec 14  2013 Shaders
    

    —-

    Stranger still. The makefile I have in my Kinect-3.2 src folder does not match the v3.2 on GitHub: https://github.com/KeckCAVES/Kinect/blob/master/makefile. The github version uses 69-Kinect.rules and has a completely different *uninstall* section.

    • This reply was modified 3 years, 9 months ago by maphew.
    #102771
    maphew
    Participant

    Ignore the bit about makefiles being different, they’re not. My source folder was contaminated. I removed them and started over. The real problem was a typo in the install command, I typed devrules instead of Udevrules. The correct command is:

    sudo make installudevrules

    I misled by incorrect error message from make:

    $ make any-thing-you-want-man
    make: 'any-thing-you-want-man' is up to date.

    —-
    HOWEVER, this doesn’t fix the permissions problem. The rule file is now installed, but has no effect. :-/

    
    hello@sandbox ~ $ RawKinectViewer -compress 0
    Caught exception USB::Device::open: Insufficient device permissions
    
    hello@sandbox ~ $ ls -l /etc/udev/rules.d/
    total 8
    -rw-r--r-- 1 root root 1016 Dec  4 16:49 69-Kinect.rules
    -rw-r--r-- 1 root root 2233 Dec  3 20:30 69-Vrui-devices.rules
    
    hello@sandbox ~ $ ls -l /etc/udev/rules.d/69-Kinect.rules 
    -rw-r--r-- 1 root root 1016 Dec  4 16:49 /etc/udev/rules.d/69-Kinect.rules
    
    hello@sandbox ~ $ cat /etc/udev/rules.d/69-Kinect.rules 
    # Rules to relax permissions on USB files for Microsoft Xbox Kinect
    # This file was installed by the Kinect 3D Video Capture Project.
    # Copyright (c) 2013-2016 Oliver Kreylos
    
    # Rules for Kinect-for-Xbox model 1414:
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02ad", TAG+="uaccess"
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02ae", TAG+="uaccess"
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02b0", TAG+="uaccess"
    
    # Rules for Kinect-for-Xbox model 1473 and Kinect-for-Windows model 1517:
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02be", TAG+="uaccess"
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02bf", TAG+="uaccess"
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02c2", TAG+="uaccess"
    
    # Rules for Kinect-for-Windows version 2.0:
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02c4", TAG+="uaccess"
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02d9", TAG+="uaccess"
    
    • This reply was modified 3 years, 9 months ago by maphew.
    #102783
    Oliver Kreylos
    Keymaster

    After you create a new udev rule, you need to activate the rule. New rules don’t affect already-plugged in devices. I made a post here about this a while ago, but can’t find it. Edit: found it. The bottom line is: the easiest way to apply new rules is to unplug and replug the affected device.

    If you’ve done that already, I don’t know what the problem is.

    #102804
    maphew
    Participant

    Logging out and back in again did the trick. Thanks for the details on what’s happening!

    • This reply was modified 3 years, 9 months ago by maphew.
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Comments are closed.