Skip to content

Document Linux host setup (gspca_kinect blacklist + udev rules) #12

@turbocrime

Description

@turbocrime

Summary

On Linux, opening the Kinect via WebUSB fails before any driver code runs unless two host-level prerequisites are in place. Both are obvious to anyone who's used libfreenect, but neither is mentioned in the README, so a first-time user gets Failed to execute 'open' on 'UsbDevice': Access denied. from dev.open() and has no signpost pointing at the host config.

What needs to be there

  1. Kernel driver: the gspca_kinect module auto-binds the camera interface on most distros and prevents WebUSB from claiming it. Needs to be unloaded and blacklisted:

    sudo modprobe -r gspca_kinect

    /etc/modprobe.d/blacklist-kinect.conf:

    blacklist gspca_kinect
    install gspca_kinect /bin/true
    

    Then sudo dracut -f (Fedora/Asahi) or the distro equivalent so it survives reboot.

  2. udev rules giving the user access to the raw USB device. /etc/udev/rules.d/51-kinect.rules:

    # Xbox 360 Kinect
    SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ae", MODE="0666"
    SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ad", MODE="0666"
    SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02b0", MODE="0666"
    
    # Xbox One Kinect
    SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02c4", MODE="0666"
    SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d8", MODE="0666"
    SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d9", MODE="0666"
    

    Then:

    sudo udevadm control --reload-rules
    sudo udevadm trigger

    (TAG+="uaccess" is a more modern systemd-friendly alternative to MODE="0666" and only grants access to whoever's at the active seat, but 0666 is what most Kinect docs out there use.)

Suggested location

A short "Linux host setup" subsection in the README, ideally above the WebUSB usage example so it's the first thing a Linux user sees. Linking out to the libfreenect rules file is also fine if you'd rather not duplicate them in-tree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions