omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

usbcore autosuspend config has no effect (usbcore is built into the kernel)

Open Smax1988 opened this issue 2 months ago • 2 comments

What happened

/etc/modprobe.d/omarchy-usb-autosuspend.conf (shipped by omarchy-settings) contains:

options usbcore autosuspend=-1

This has no effect. usbcore is built into the kernel (CONFIG_USB=y) in the stock Arch linux package, and /etc/modprobe.d/ is only consulted when a module is loaded. Built-in code never goes through modprobe, so the option is silently ignored.

What was expected

USB autosuspend disabled system-wide, as the config file intends.

Steps to reproduce

On any Omarchy install running the stock Arch kernel:

$ modinfo usbcore | head -2
name:           usbcore
filename:       (builtin)          # <- not a module

$ cat /sys/module/usbcore/parameters/autosuspend
2                                  # <- expected -1

$ grep usbcore /proc/cmdline
                                   # <- nothing; no kernel parameter set either

Impact

USB devices still autosuspend. This is not cosmetic — it breaks USB Bluetooth adapters: the adapter suspends while idle and tears down the active A2DP link, producing a repeating connect/disconnect cycle every few minutes during audio playback.

Observed on a Realtek RTL8822CU (1358:c123), where the adapter had accumulated 28 minutes of runtime_suspended_time since boot:

$ cat /sys/bus/usb/devices/3-2/power/runtime_suspended_time
1690842                            # ms

$ cat /sys/bus/usb/devices/3-2/power/autosuspend_delay_ms
2000

PipeWire also logged spa.bluez5.sink.media: Missing completion reports for packet: Bluetooth adapter firmware bug? — HCI completion packets lost when the adapter wakes mid-stream. Both symptoms stopped once autosuspend was actually disabled.

Suggested fix

A udev rule expresses the same intent and works regardless of whether usbcore is built in:

# /usr/lib/udev/rules.d/50-omarchy-usb-autosuspend.rules
ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="on"

It also applies without a reboot, unlike the kernel-parameter alternative (usbcore.autosuspend=-1 on the kernel cmdline), which would otherwise be the only way to make the current approach work.

System details

  • Omarchy 4.0.4-1 (omarchy-settings 4.0.4-1)
  • Kernel: stock Arch linux 7.2.3.arch1-3

Smax1988 avatar Sep 17 '26 15:09 Smax1988

Independent confirmation on a different machine (HP Pavilion 15, Haswell i5-4200U, Omarchy 4.0.4, kernel 7.2.5-3-omarchy, omarchy-settings 4.0.4-1), plus a verified working fix.

Independent measurements (2026-09-22/23)

  • Runtime state contradicted the shipped config: /sys/module/usbcore/parameters/autosuspend = 2 while /etc/modprobe.d/omarchy-usb-autosuspend.conf (confirmed package-owned via pacman -Qo) sets autosuspend=-1, and grep usbcore /proc/cmdline was empty.
  • Corroboration that modprobe.d cannot reach it: usbcore is listed in /lib/modules/7.2.5-3-omarchy/modules.builtin, has no .ko on disk, and is absent from modules.dep — a modprobe.d option has nothing to attach to, matching the report above.

Verified fix: kernel cmdline parameter

Moving the option to the kernel command line works and survived verification after reboot:

  1. Add to /etc/kernel/cmdline (or the Limine entry cmdline — both were aligned here): usbcore.autosuspend=-1
  2. Regenerate initramfs/entries (kernel-install add-all; with limine-mkinitcpio-hook installed, limine-mkinitcpio also rewrites the Limine entries, which is the step that matters on Limine systems)
  3. Reboot

Post-reboot prediction, verified:

$ cat /sys/module/usbcore/parameters/autosuspend
-1
$ tr ' ' '\n' < /proc/cmdline | grep usbcore
usbcore.autosuspend=-1

Caveat worth noting for the fix packaging: /proc/cmdline is a kernel-visible surface, so the parameter must land on the bootloader's cmdline source; on installs where a third-party bootloader or UKI setup owns that file, an installer-side fix should account for it (here Limine's /etc/default/limine KERNEL_CMDLINE[default] is the authoritative source and overrides the UKI-embedded /etc/kernel/cmdline).

Until an upstream fix ships, the dead modprobe.d file is harmless but misleading; deleting it or converting it to documentation would avoid users trusting cat /etc/modprobe.d/omarchy-usb-autosuspend.conf as state.

sneemgp avatar Sep 23 '26 12:09 sneemgp

Thanks for the careful report. The cause is right: /etc/modprobe.d/omarchy-usb-autosuspend.conf sets options usbcore autosuspend=-1, but usbcore is built into the kernel, so modprobe never reads the option and /sys/module/usbcore/parameters/autosuspend stays at the compiled-in 2. The repository itself records this. default/settings-runtime-profile:26-27 says the drop-in "applies where usbcore is a module; a kernel that builds it in ignores it". I checked against quattro (9480d1b6a), and nothing else sets the parameter or an equivalent: etc/limine-entry-tool.d/omarchy-defaults.conf has no usbcore.autosuspend, and the only shipped udev rule is the I/O scheduler one. The same measurement was reproduced on a clean worker built from the Omarchy ISO for #8097, the older open report of this bug. That issue's symptom is dock peripherals dropping after resume; yours, an RTL8822CU dropping A2DP, is more evidence for the same cause.

There is no fix to send that doesn't also decide a policy. Making the setting take effect disables USB autosuspend on every install, which costs idle power on laptops; that tradeoff is why #6671 was closed. Removing the drop-in would instead stop disabling it on kernels where usbcore is a module. Four open pull requests already take a side: #9815, #10140 (draft) and #10111 put usbcore.autosuspend=-1 on the Limine cmdline, and #8699 documents autosuspend with a per-device udev exemption. Choosing between them is the maintainer's call, so this waits on them. Until then, @sneemgp's workaround works: add usbcore.autosuspend=-1 to the cmdline the bootloader actually reads (KERNEL_CMDLINE[default] in /etc/default/limine on Limine installs) and reboot.

Claude Opus 5.5 diagnosed this, and Codex Medium reviewed it separately and agreed on both the cause and that every fix is a policy choice. Its independence isn't guaranteed. I tried to close this as a duplicate of #8097, but Codex Medium, asked separately, did not agree that closing it would lose nothing #8097 already has. So it stays open beside #8097.

omarchybot avatar Oct 12 '26 05:10 omarchybot