Game/Launcher: detect and fix Linux controller permissions that block gyro (hidraw without uaccess) #2560
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#2560
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
On Linux, gyro aiming silently does nothing when the user can't open the controller's hidraw node. Buttons and sticks still work, so it looks like a Longshot bug.
Seen on an Arch-based PC with a USB Switch Pro Controller and no controller udev rules installed (no
game-devices-udev/steam-devices):/dev/hidraw1(Pro Controller) iscrw------- root root, tagged only:seat:, with nouaccess. SDL's HIDAPI driver, which provides the gyro, can't open it.hid_nintendoevdev joystick (eventN, which hasuaccess). That device has buttons and sticks but no sensors.Pro Controller (IMU)node is0660 root:inputwith nouaccess, so that's closed too for a user outsideinput.The game can't change any of this without root.
Proposal
Game: detect and explain. When a pad we support gyro on (Switch Pro, pads in Switch mode, DualSense, DualShock 4) is connected but SDL reports no gyro, and its
/dev/hidraw*node can't be opened (EACCES), log it and show a notice on the Motion page. The notice says gyro is blocked by device permissions and how to fix it: installgame-devices-udev/steam-devices, or use the launcher's fix. The game never asks for root.LongshotLauncher: one-click fix. A "Fix controller permissions" action, run only when the user asks. It writes a udev rule through
pkexec, then runsudevadm control --reload && udevadm trigger, and asks the user to replug the pad. Example rule for the Pro Controller:The real rule covers every gyro pad we support. It isn't needed for Flatpak or Steam installs, which already have the rules.
Possibly related
Possibly related, for context: