Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/steam-hardware: fix uinput udev rule #50901

Closed

Conversation

nyanloutre
Copy link
Member

@nyanloutre nyanloutre commented Nov 21, 2018

Motivation for this change

close #49367

rewrite using udev.extraRules instead of patching the Steam package

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@nyanloutre
Copy link
Member Author

cc @infinisil

@nyanloutre
Copy link
Member Author

nyanloutre commented Nov 28, 2018

@infinisil I tried with kernel 4.19 and I can reproduce your behavior, at boot the ACL isn't applied.

Edit: sorry for the noise, I just forgot to enable my module

@Ekleog
Copy link
Member

Ekleog commented Dec 13, 2018

(triage) @infinisil, you appear to have been involved in the discussion in #49367. I think this PR matches your statement at #49367 (comment) ; but you may want to review it?

@cdepillabout
Copy link
Member

cdepillabout commented Dec 24, 2018

I have confirmed this udev setting works.

I was trying to use a PS3 controller with steam (to play a windows-only game with Proton) and it wasn't working because steam couldn't read /dev/uinput.

After adding this udev rule, it started working.

+1 from me for merging this in.


edit: oops, looks like I spoke too soon. With the udev rule proposed in this PR, a windows-only game with Proton (Overcooked) is only able to see one controller, not multiple controllers.

I still end up getting these messages in steam's stdout:

Couldn't initialize virtual gamepad: Couldn't open /dev/uinput for writing

This is strange, since my user should have permission to write to /dev/uinput:

$ getfacl /dev/uinput 
getfacl: Removing leading '/' from absolute path names
# file: dev/uinput
# owner: root
# group: root
user::rw-
user:illabout:rw-               #effective:---
group::---
mask::---
other::---

Maybe this is caused from the chroot environment steam is running in (actually I haven't looked into this at all, so I don't really know what I'm talking about here)?

If I manually run chmod o+rw /dev/uinput, then Overcooked can see both controllers I have.

Also, what is strange is that steam itself can see all my controllers, it is just Overcooked that is not able to.

As a work-around, I'm using the following setting:

services.udev.extraRules = ''
  KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput", GROUP="input", MODE="0660"
'';

This sets /dev/uinput to have a group of input and be readable/writable by this group. This appears to work. With this udev rule, I'm able to use multiple controllers in a game using Proton.

@mmahut
Copy link
Member

mmahut commented Aug 13, 2019

Are there any updates on this pull request, please?

@nyanloutre
Copy link
Member Author

nyanloutre commented Aug 13, 2019

My preference would be for this pull request #49367 as the rule is added in the same file as the other related ones.
Also this file was released with an open license so it's not a problem to patch it anymore.

EDIT: ValveSoftware/steam-for-linux#4794 (comment)

distros should be repackaging the udev rules for their own setup

@nyanloutre nyanloutre mentioned this pull request Aug 19, 2019
10 tasks
@nyanloutre
Copy link
Member Author

Please see #66916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants