Game/Launcher: detect and fix Linux controller permissions that block gyro (hidraw without uaccess) #2560

Open
opened 2026-11-25 19:32:27 +00:00 by HumanBean · 1 comment
Owner

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) is crw------- root root, tagged only :seat:, with no uaccess. SDL's HIDAPI driver, which provides the gyro, can't open it.
  • SDL falls back to the hid_nintendo evdev joystick (eventN, which has uaccess). That device has buttons and sticks but no sensors.
  • The kernel's separate Pro Controller (IMU) node is 0660 root:input with no uaccess, so that's closed too for a user outside input.

The game can't change any of this without root.

Proposal

  1. 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: install game-devices-udev/steam-devices, or use the launcher's fix. The game never asks for root.

  2. LongshotLauncher: one-click fix. A "Fix controller permissions" action, run only when the user asks. It writes a udev rule through pkexec, then runs udevadm control --reload && udevadm trigger, and asks the user to replug the pad. Example rule for the Pro Controller:

    KERNEL=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="2009", MODE="0660", TAG+="uaccess"
    

    The real rule covers every gyro pad we support. It isn't needed for Flatpak or Steam installs, which already have the rules.

  • #1660: gyro doesn't work at all with an 8BitDo Pro 2 in Switch mode. The OS isn't stated; if it's Linux, this may be the cause.
  • #2216: 8BitDo Ultimate 2 gyro not detected.
## 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) is `crw------- root root`, tagged only `:seat:`, with no `uaccess`. SDL's HIDAPI driver, which provides the gyro, can't open it. - SDL falls back to the `hid_nintendo` evdev joystick (`eventN`, which has `uaccess`). That device has buttons and sticks but no sensors. - The kernel's separate `Pro Controller (IMU)` node is `0660 root:input` with no `uaccess`, so that's closed too for a user outside `input`. The game can't change any of this without root. ## Proposal 1. **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: install `game-devices-udev`/`steam-devices`, or use the launcher's fix. The game never asks for root. 2. **LongshotLauncher: one-click fix.** A "Fix controller permissions" action, run only when the user asks. It writes a udev rule through `pkexec`, then runs `udevadm control --reload && udevadm trigger`, and asks the user to replug the pad. Example rule for the Pro Controller: ``` KERNEL=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="2009", MODE="0660", TAG+="uaccess" ``` 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 - [#1660](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1660): gyro doesn't work at all with an 8BitDo Pro 2 in Switch mode. The OS isn't stated; if it's Linux, this may be the cause. - [#2216](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/2216): 8BitDo Ultimate 2 gyro not detected.
Member

Possibly related, for context:

  • issue #1660 Game: Gyro aiming doesn't work — Same symptom of gyro unavailable; this report specifies Linux hidraw permission cause, which #1660 does not establish.
  • issue #2216 Game: 8BitDo Ultimate 2 gyro is not detected — Another gyro-not-detected report, but controller and circumstances differ.
Possibly related, for context: - issue #1660 Game: Gyro aiming doesn't work — Same symptom of gyro unavailable; this report specifies Linux hidraw permission cause, which #1660 does not establish. - issue #2216 Game: 8BitDo Ultimate 2 gyro is not detected — Another gyro-not-detected report, but controller and circumstances differ.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot#2560
No description provided.