Skip to content

Torzu: udev rules have no effect on Joycons #374238

@deftdawg

Description

@deftdawg

Nixpkgs version

  • Unstable (25.05)

Describe the bug

Installed Torzu, would like to use 1st party joycons with it... The Joycons pair over bluetooth but only work with Torzu when running via sudo (i.e. as root); running in this manner however results in no sound. Running as a normal user the Joycons are not visible from the Torzu settings page, however sound works.

Being able to detect the joycons as root suggests the user is not being granted access to them correctly by udev. i.e. the rules (see additional context below) are not being applied. From what I read, TAG+="uaccess" should mean that any physically present user with a session should have access to the device.

This maybe an issue with how the udev rules are packaged by the derivation or it maybe an issue with the rules themselves. If it's the later, feel free to close this issue and I'll pursue upstream.

Steps to reproduce

  1. add torzu to packages
  2. add services.udev.packages = with pkgs; [ torzu ]; to /etc/nixos/configuration.nix
  3. add "input" "uinput" to extraGroups for user (TAG+="uaccess" suggests this should not be required)
  4. nixos-rebuild boot
  5. reboot

Expected behaviour

Joycons should be detectable/usable by Torzu in it's settings menu when run by any physically present user with a session

Screenshots

No response

Relevant log output

# udevadm monitor

udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[182377.860284] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14.3/1-14.3:1.0/bluetooth/hci0/hci0:13 (bluetooth)
UDEV  [182377.862197] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14.3/1-14.3:1.0/bluetooth/hci0/hci0:13 (bluetooth)
KERNEL[182384.176117] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14.3/1-14.3:1.0/bluetooth/hci0/hci0:13 (bluetooth)
UDEV  [182384.177849] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14.3/1-14.3:1.0/bluetooth/hci0/hci0:13 (bluetooth)
KERNEL[182384.966329] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14.3/1-14.3:1.0/bluetooth/hci0/hci0:13 (bluetooth)
UDEV  [182384.966977] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14.3/1-14.3:1.0/bluetooth/hci0/hci0:13 (bluetooth)
KERNEL[182386.534536] add      /devices/virtual/misc/uhid/0005:057E:2006.0025 (hid)
KERNEL[182386.534665] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62 (input)
KERNEL[182386.534681] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62/event30 (input)
KERNEL[182386.534786] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62/js2 (input)
KERNEL[182386.534805] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/hidraw/hidraw14 (hidraw)
KERNEL[182386.534976] bind     /devices/virtual/misc/uhid/0005:057E:2006.0025 (hid)
KERNEL[182386.537773] add      /module/ff_memless (module)
UDEV  [182386.538358] add      /module/ff_memless (module)
KERNEL[182386.539924] add      /bus/hid/drivers/nintendo (drivers)
KERNEL[182386.539969] remove   /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62/event30 (input)
UDEV  [182386.540282] add      /bus/hid/drivers/nintendo (drivers)
KERNEL[182386.555029] remove   /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62/js2 (input)
KERNEL[182386.562027] remove   /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62 (input)
KERNEL[182386.562046] remove   /devices/virtual/misc/uhid/0005:057E:2006.0025/hidraw/hidraw14 (hidraw)
KERNEL[182386.562062] unbind   /devices/virtual/misc/uhid/0005:057E:2006.0025 (hid)
KERNEL[182386.562160] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/hidraw/hidraw14 (hidraw)
KERNEL[182387.300545] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/leds/0005:057E:2006.0025:green:player-1 (leds)
KERNEL[182387.300561] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/leds/0005:057E:2006.0025:green:player-2 (leds)
KERNEL[182387.300565] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/leds/0005:057E:2006.0025:green:player-3 (leds)
KERNEL[182387.300568] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/leds/0005:057E:2006.0025:green:player-4 (leds)
KERNEL[182387.300571] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/power_supply/nintendo_switch_controller_battery_0005:057E:2006.0025/wakeup54 (wakeup)
KERNEL[182387.300577] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/power_supply/nintendo_switch_controller_battery_0005:057E:2006.0025/hwmon12 (hwmon)
KERNEL[182387.300592] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input63 (input)
KERNEL[182387.300812] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input63/event30 (input)
KERNEL[182387.300828] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input64 (input)
KERNEL[182387.300862] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input64/event31 (input)
KERNEL[182387.300878] bind     /devices/virtual/misc/uhid/0005:057E:2006.0025 (hid)
KERNEL[182387.300883] add      /module/hid_nintendo (module)
UDEV  [182387.301547] add      /devices/virtual/misc/uhid/0005:057E:2006.0025 (hid)
UDEV  [182387.302258] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62 (input)
UDEV  [182387.302621] add      /module/hid_nintendo (module)
UDEV  [182387.303132] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62/js2 (input)
UDEV  [182387.304969] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/hidraw/hidraw14 (hidraw)
KERNEL[182387.312023] change   /devices/virtual/misc/uhid/0005:057E:2006.0025/power_supply/nintendo_switch_controller_battery_0005:057E:2006.0025 (power_supply)
UDEV  [182387.314305] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62/event30 (input)
UDEV  [182387.314434] bind     /devices/virtual/misc/uhid/0005:057E:2006.0025 (hid)
UDEV  [182387.314749] remove   /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62/event30 (input)
UDEV  [182387.314767] remove   /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62/js2 (input)
UDEV  [182387.314810] remove   /devices/virtual/misc/uhid/0005:057E:2006.0025/hidraw/hidraw14 (hidraw)
UDEV  [182387.315249] remove   /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input62 (input)
UDEV  [182387.315494] unbind   /devices/virtual/misc/uhid/0005:057E:2006.0025 (hid)
UDEV  [182387.315892] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/leds/0005:057E:2006.0025:green:player-1 (leds)
UDEV  [182387.315908] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/leds/0005:057E:2006.0025:green:player-2 (leds)
UDEV  [182387.315934] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/leds/0005:057E:2006.0025:green:player-3 (leds)
UDEV  [182387.316351] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/leds/0005:057E:2006.0025:green:player-4 (leds)
UDEV  [182387.316486] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/power_supply/nintendo_switch_controller_battery_0005:057E:2006.0025/wakeup54 (wakeup)
UDEV  [182387.316622] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/power_supply/nintendo_switch_controller_battery_0005:057E:2006.0025/hwmon12 (hwmon)
UDEV  [182387.316991] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input63 (input)
UDEV  [182387.317169] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input64 (input)
UDEV  [182387.318591] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/hidraw/hidraw14 (hidraw)
UDEV  [182387.324656] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input64/event31 (input)
UDEV  [182387.333560] add      /devices/virtual/misc/uhid/0005:057E:2006.0025/input/input63/event30 (input)
UDEV  [182387.333772] bind     /devices/virtual/misc/uhid/0005:057E:2006.0025 (hid)
UDEV  [182387.334090] change   /devices/virtual/misc/uhid/0005:057E:2006.0025/power_supply/nintendo_switch_controller_battery_0005:057E:2006.0025 (power_supply)


# dmesg from a different run (input# are different) showing devices detected

[ 5469.604741] nintendo 0005:057E:2007.0011: hidraw9: BLUETOOTH HID v80.01 Gamepad [Joy-Con (R)] on 90:e8:68:c4:c4:6a
[ 5470.779576] input: Joy-Con (R) as /devices/virtual/misc/uhid/0005:057E:2007.0011/input/input54
[ 5470.779810] input: Joy-Con (R) (IMU) as /devices/virtual/misc/uhid/0005:057E:2007.0011/input/input55

Additional context

Contents of
/nix/store/*-torzu-unstable-2024-12-15/lib/udev/rules.d/72-yuzu-input.rules (source: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/src/commit/bc4239dd9fc6ba8e99fb95b0ff696287e82dbad5/dist/72-yuzu-input.rules - accessible via Tor Private window using Brave; pasted here for convenience)

# SPDX-FileCopyrightText: 2023 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later

# Allow systemd-logind to manage user access to hidraw with this file
# On most systems, this file should be installed to /etc/udev/rules.d/72-yuzu-input.rules
# Consult your distro if this is not the case

# Switch Pro Controller (USB/Bluetooth)
KERNEL=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="2009", MODE="0660", TAG+="uaccess"
KERNEL=="hidraw*", KERNELS=="*057e:2009*", MODE="0660", TAG+="uaccess"

# Joy-Con L (Bluetooth)
KERNEL=="hidraw*", KERNELS=="*057e:2006*", MODE="0660", TAG+="uaccess"

# Joy-Con R (Bluetooth)
KERNEL=="hidraw*", KERNELS=="*057e:2007*", MODE="0660", TAG+="uaccess"

# Joy-Con Charging Grip (USB)
KERNEL=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="200e", MODE="0660", TAG+="uaccess"

System metadata

  • system: "x86_64-linux"
  • host os: Linux 6.12.9, NixOS, 25.05 (Warbler), 25.05beta737298.ed4a395ea001
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.24.11
  • channels(root): "nixos"
  • channels(deftdawg): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Notify maintainers

@liberodark

Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions