GithubHelp home page GithubHelp logo

Comments (10)

medusalix avatar medusalix commented on May 23, 2024

The Error opening device: Permission denied is thrown when xow doesn't have the required permissions to access the /dev/uinput device. When you run make install a udev rule is copied to /lib/udev/rules.d to make /dev/uinput read-write for all users.

from xow.

zyll71 avatar zyll71 commented on May 23, 2024

(Since I had fiddled with the udev rule in the mean time and to be 100% sure, I de-installed, rebuilt and re-installed xow. Then a reboot.)

For some reason, the udev rules are not being applied when the service is started or they are not being applied.

ls -la /dev/uinput
crw------- 1 root root 10, 223 Jan 17 12:44 /dev/uinput

ls -la /lib/udev/rules.d/99-xow.rules
-rw-r--r-- 1 root root 261 Jan 17 12:17 /lib/udev/rules.d/99-xow.rules

cat /lib/udev/rules.d/99-xow.rules
# Make dongles and uinput accessible to all users
SUBSYSTEM=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02e6", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02fe", MODE="0666"
KERNEL=="uinput", SUBSYSTEM=="misc", MODE="0666"

sudo lsusb
[..]
Bus 003 Device 006: ID 045e:02fe Microsoft Corp.
[..]

`> sudo udevadm info -a -n /dev/bus/usb/003/006

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

looking at device '/devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10.4':
KERNEL=="3-10.4"
SUBSYSTEM=="usb"
DRIVER=="usb"
ATTR{authorized}=="1"
ATTR{avoid_reset_quirk}=="0"
ATTR{bConfigurationValue}=="1"
ATTR{bDeviceClass}=="00"
ATTR{bDeviceProtocol}=="00"
ATTR{bDeviceSubClass}=="00"
ATTR{bMaxPacketSize0}=="64"
ATTR{bMaxPower}=="500mA"
ATTR{bNumConfigurations}=="1"
ATTR{bNumInterfaces}==" 1"
ATTR{bcdDevice}=="0100"
ATTR{bmAttributes}=="a0"
ATTR{busnum}=="3"
ATTR{configuration}=="XBOX ACC"
ATTR{devnum}=="6"
ATTR{devpath}=="10.4"
ATTR{idProduct}=="02fe"
ATTR{idVendor}=="045e"
ATTR{ltm_capable}=="no"
ATTR{manufacturer}=="Microsoft Inc."
ATTR{maxchild}=="0"
ATTR{product}=="XBOX ACC"
ATTR{quirks}=="0x0"
ATTR{removable}=="removable"
ATTR{serial}=="413878"
ATTR{speed}=="480"
ATTR{urbnum}=="133"
ATTR{version}==" 2.01"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3/3-10':
KERNELS=="3-10"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="09"
ATTRS{bDeviceProtocol}=="02"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bMaxPower}=="100mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bcdDevice}=="0001"
ATTRS{bmAttributes}=="e0"
ATTRS{busnum}=="3"
ATTRS{configuration}==""
ATTRS{devnum}=="4"
ATTRS{devpath}=="10"
ATTRS{idProduct}=="2074"
ATTRS{idVendor}=="174c"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="ASUS TEK."
ATTRS{maxchild}=="4"
ATTRS{product}=="ASM107x"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="fixed"
ATTRS{speed}=="480"
ATTRS{urbnum}=="47"
ATTRS{version}==" 2.10"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3':
KERNELS=="usb3"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{authorized_default}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="09"
ATTRS{bDeviceProtocol}=="01"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bMaxPower}=="0mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bcdDevice}=="0412"
ATTRS{bmAttributes}=="e0"
ATTRS{busnum}=="3"
ATTRS{configuration}==""
ATTRS{devnum}=="1"
ATTRS{devpath}=="0"
ATTRS{idProduct}=="0002"
ATTRS{idVendor}=="1d6b"
ATTRS{interface_authorized_default}=="1"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 4.12.14-lp151.28.36-default xhci-hcd"
ATTRS{maxchild}=="15"
ATTRS{product}=="xHCI Host Controller"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="unknown"
ATTRS{serial}=="0000:00:14.0"
ATTRS{speed}=="480"
ATTRS{urbnum}=="66"
ATTRS{version}==" 2.00"

looking at parent device '/devices/pci0000:00/0000:00:14.0':
KERNELS=="0000:00:14.0"
SUBSYSTEMS=="pci"
DRIVERS=="xhci_hcd"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x0c0330"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{d3cold_allowed}=="1"
ATTRS{device}=="0x8d31"
ATTRS{dma_mask_bits}=="64"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="32"
ATTRS{local_cpulist}=="0-7"
ATTRS{local_cpus}=="ff"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="0"
ATTRS{revision}=="0x05"
ATTRS{subsystem_device}=="0x8600"
ATTRS{subsystem_vendor}=="0x1043"
ATTRS{vendor}=="0x8086"

looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
> sudo journalctl -b -u xow
[sudo] password for root:
-- Logs begin at Fri 2020-01-17 12:44:50 CET, end at Fri 2020-01-17 12:46:04 CET. --
Jan 17 12:44:54 [x] systemd[1]: Started Xbox One Wireless Dongle Driver.
Jan 17 12:44:54 [x] xow[1105]: 2020-01-17 12:44:54 INFO - xow v0.2-22-g1341b1e ©Severin v. W.
Jan 17 12:44:54 [x] xow[1105]: 2020-01-17 12:44:54 INFO - Dongle plugged in
Jan 17 12:44:54 [x] xow[1105]: 2020-01-17 12:44:54 DEBUG - Firmware already loaded
Jan 17 12:44:54 [x] xow[1105]: 2020-01-17 12:44:54 DEBUG - Chip version: 7632
Jan 17 12:44:54 [x] xow[1105]: 2020-01-17 12:44:54 INFO - Chip address: 62:45:b5:10:43:39
Jan 17 12:44:54 [x] xow[1105]: 2020-01-17 12:44:54 INFO - Dongle initialized
Jan 17 12:44:54 [x] xow[1105]: 2020-01-17 12:44:54 DEBUG - Client associating: 7e:ed:82:3c:05:f4
Jan 17 12:44:54 [x] xow[1105]: 2020-01-17 12:44:54 DEBUG - Client identifier: 1
Jan 17 12:44:54 [x] xow[1105]: terminate called after throwing an instance of 'InputException'
Jan 17 12:44:54 [x] xow[1105]: what(): Error opening device: Permission denied
Jan 17 12:44:54 [x] systemd[1]: xow.service: Main process exited, code=killed, status=6/ABRT
Jan 17 12:44:54 [x] systemd[1]: xow.service: Unit entered failed state.
Jan 17 12:44:54 [x] systemd[1]: xow.service: Failed with result 'signal'.

Jan 17 12:44:54 Tulkas systemd[1]: xow.service: Main process exited, code=kille>
Jan 17 12:44:54 Tulkas systemd[1]: xow.service: Unit entered failed state.
Jan 17 12:44:54 Tulkas systemd[1]: xow.service: Failed with result 'signal'.
`

from xow.

medusalix avatar medusalix commented on May 23, 2024

I've found this issue which seems to deal with the exact same problem. Please try if the mentioned workaround solves the udev issues.

from xow.

zyll71 avatar zyll71 commented on May 23, 2024

Creating/etc/modules-load.d/uinput.confwith the contents of uinput
alone did not suffice. The permissions do seem better:

> ls -la /dev/uinput
crw-rw-rw- 1 root root 10, 223 Jan 17 13:52 /dev/uinput

However, the service does not run beyond

> sudo journalctl -b -u xow
-- Logs begin at Fri 2020-01-17 13:52:44 CET, end at Fri 2020-01-17 13:55:37 CET. --
Jan 17 13:52:48 [x] systemd[1]: Started Xbox One Wireless Dongle Driver.
Jan 17 13:52:48 [x] xow[1091]: 2020-01-17 13:52:48 INFO  - xow v0.2-22-g1341b1e ©Severin v. W.
Jan 17 13:52:48 [x] xow[1091]: 2020-01-17 13:52:48 INFO  - Dongle plugged in
Jan 17 13:52:48 [x] xow[1091]: 2020-01-17 13:52:48 DEBUG - Firmware already loaded
Jan 17 13:52:48 [x] xow[1091]: 2020-01-17 13:52:48 DEBUG - Chip version: 7632
Jan 17 13:52:48 [x] xow[1091]: 2020-01-17 13:52:48 INFO  - Chip address: 62:45:b5:10:43:39
Jan 17 13:52:48 [x] xow[1091]: 2020-01-17 13:52:48 INFO  - Dongle initialized

Adding GROUP="uinput" to /lib/udev/rules.d/99-xow.rules does not help either (is this the right pace?). So I have removed it again.

from xow.

zyll71 avatar zyll71 commented on May 23, 2024

Hmm, I can't seem to find a group uinput in my /etc/group. No wonder that did not work. A openSuSE thing calling it something different perhaps?

from xow.

zyll71 avatar zyll71 commented on May 23, 2024

Please disregard the above.
No idea what I borked previously. For some reason, after a reboot, the pad and the dongle now connect using the workaround you mentioned.

Creating /etc/modules-load.d/uinput.conf with the contents of uinput

Thank you very much!

from xow.

medusalix avatar medusalix commented on May 23, 2024

I've added the workaround to the Makefile in b0cdf7d. Problem should be solved.

from xow.

jerky33 avatar jerky33 commented on May 23, 2024

I was receiving the same error when trying to pair my controller running under debian 11
xow[PID]: what(): Error opening device: Permission denied
I was able to resolve it by changing the permission on the service

First I stopped the service

sudo systemctl stop xow

Next I disabled the service

sudo systemctl disable xow

After that I changed the permissions to the service file to allow writing by all users

sudo chmod 666 /etc/systemd/system/xow.service

Then I re-enabled the service

sudo systemctl enable xow

Finally I started the service and was able to pair my controller as expected.

sudo systemctl start xow

I hope this help someone

GLHF

--Update--

Per @kakra's comment below, I have reverted the permissions to the service and now that my controller is paired the wireless adapter it connects as soon as the controller is woken up. Below are the steps for reverting the permissions back to the default values.
Stop service

sudo systemctl stop xow

Disable service

sudo systemctl disable xow

Revert permissions

sudo chmod 644 /etc/systemd/system/xow.service

Enable service

sudo systemctl enable xow

Start service

sudo systemctl start xow

Now when the controller is woken it immediately connect to the wireless adapter.

from xow.

kakra avatar kakra commented on May 23, 2024

Next I changed the permissions to the service file to allow writing by all users

This makes no sense - and it creates a security problem. This file is never written to, and it should not be possible. The permission problem is more likely with the device node, and xow should probably log which one.

from xow.

jerky33 avatar jerky33 commented on May 23, 2024

Now that the controller is paired I reverted the permissions back to the default 644 and was able to connect the controller

from xow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.