Skip to content

Keep Bluetooth USB controllers awake when TLP manages USB power - #12950

Open
s-gato wants to merge 3 commits into
omacom:quattrofrom
s-gato:fix/tlp-bluetooth-usb-autosuspend
Open

s-gato wants to merge 3 commits into
omacom:quattrofrom
s-gato:fix/tlp-bluetooth-usb-autosuspend

Conversation

@s-gato

@s-gato s-gato commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Refs #12095 (complements #10140)

What

Ships /etc/tlp.d/omarchy-bluetooth-usb.conf — a TLP drop-in that excludes the Intel Bluetooth combo cards from TLP's USB autosuspend — and registers the path in the upgrade --overwrite list.

Why

Two independent layers keep Bluetooth USB controllers suspended on Omarchy machines:

  1. The no-op modprobe.d option documented in omarchy-usb-autosuspend.conf is a no-op; Intel Bluetooth controllers still autosuspend (BLE HID reconnect timeouts) #12095 and addressed for the kernel-parameter layer by Apply USB autosuspend policy through the kernel command line #10140 (usbcore is built in).
  2. TLP, when a user has installed it (it is not an Omarchy package). TLP applies power/control=auto and autosuspend_delay_ms=2000 per USB device through its udev hook, which runs as a RUN+= program — i.e. after rule processing — so power/control writes from ordinary udev rules lose on add events, and no kernel parameter helps because the delay is written explicitly.

With layer 2 active, the controller is runtime-suspended when a bonded BLE peripheral tries to reconnect; the advertisements are dropped and the peripheral only comes back after it is removed and paired again.

Verified on a ThinkPad X390 (Intel 9460, 8087:0aaa) with an MX Master 3 over Bluetooth:

  • power/control = auto, runtime_status = suspended while the mouse was actively advertising (its LED was blinking) — the host radio reported zero advertisement events in clean scans
  • writing on into power/control reconnected the mouse instantly, no re-pairing: bond and keys were intact all along
  • TLP rewrote control=auto within seconds of the manual change
  • a /etc/tlp.d drop-in with USB_DENYLIST="8087:0aaa" holds control=on across TLP applications and the mouse reconnects by itself after boot

Notes:

  • TLP 1.10 reads /etc/tlp.d/*.conf in lexical order, then /etc/tlp.conf; the last assignment wins. The drop-in appends with USB_DENYLIST+=, so earlier-sorting user drop-ins keep their exclusions, and explicit assignments in /etc/tlp.conf still win.
  • TLP 1.10 still has USB_EXCLUDE_BTUSB (default 0), which would exempt every btusb device including third-party dongles; the explicit Intel IDs keep the exemption scoped to the combo cards Omarchy ships. More IDs can be appended as they are confirmed.
  • The file is inert on machines without TLP.

Changes

File Change
etc/tlp.d/omarchy-bluetooth-usb.conf New TLP drop-in excluding Intel BT combo cards from USB autosuspend
bin/omarchy-upgrade-to-quattro Register the file in the --overwrite list
test/shell.d/tlp-bluetooth-usb-test.sh Assert the drop-in content and its upgrade registration

Test plan

  • bash test/shell.d/tlp-bluetooth-usb-test.sh passes
  • bin-style-test.sh and limine-defaults-test.sh still pass; unowned-system-paths-test.sh fails identically before and after this change (it needs a local omarchy-pkgs checkout)
  • The equivalent drop-in was applied on a real TLP machine: control=on, BLE mouse reconnects unattended

TLP suspends Bluetooth combo controllers about two seconds after they go
idle, and a runtime-suspended btusb drops the BLE advertisements that
bonded peripherals send when reconnecting: mice and keyboards then only
come back after they are removed and paired again. Ship a TLP drop-in
that denylists the Intel combo cards from USB autosuspend, registered in
the upgrade overwrite list so package updates replace it cleanly. Users
keep control: values in /etc/tlp.conf still win over the drop-in.

Refs omacom#12095
@llstrk

llstrk commented Sep 22, 2026

Copy link
Copy Markdown

One configuration-composition issue found at 712c0b3.

Preserve existing USB denylist entries

In etc/tlp.d/omarchy-bluetooth-usb.conf:12, USB_DENYLIST="..." replaces exclusions from earlier-sorting user drop-ins. TLP reads those files in lexical order, then /etc/tlp.conf.

The real TLP 1.10.2 parser produced this result with synthetic user configuration and an empty /etc/tlp.conf:

50-mine.conf: USB_DENYLIST="1234:5678"
                       Effective denylist
PR uses =              seven Intel IDs only; 1234:5678 lost
Diagnostic uses +=     1234:5678 + seven Intel IDs

Impact: A device previously excluded through a numbered user drop-in can become eligible for autosuspend again after this package update. Explicit assignments in /etc/tlp.conf still win, as described in the PR.

Suggested change: Use USB_DENYLIST+="..." to retain earlier exclusions, and adjust the shell test's exact-syntax check accordingly. The diagnostic append variant preserved both lists while retaining /etc/tlp.conf precedence.

Verified: With synthetic USB attributes, TLP 1.10.2's device handler changed 8087:0aaa from power/control=auto under defaults to on with this denylist. The new shell test passed.

Documentation correction: TLP 1.10 still supports USB_EXCLUDE_BTUSB, not USB_EXCLUDE_BLUETOOTH. The description's rationale should distinguish that existing device-class-based option from this explicit-ID approach; the two do not have identical coverage.


Review information

Test scope: Independent parser checks with TLP 1.10.0 and 1.10.2, plus the 1.10.2 handler against synthetic device files. No physical Bluetooth reconnection, live TLP/udev service, or package upgrade was tested.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Astra Medium initial source inspection and synthesis, independent Opus 5.5 High and GPT 6 Sol Xhigh technical reviews, followed by verification against targeted evidence and a separate Astra Medium editorial check.

Replace the drop-in's plain USB_DENYLIST assignment with the append form
so exclusions from earlier lexically-sorted user drop-ins in /etc/tlp.d
survive; explicit assignments in /etc/tlp.conf still win because TLP
reads them last. TLP's own parser (tlp-readconfs) joins appended values
with a separating space, so no leading space is needed inside the
quotes.

Update the shell test to assert the append form.
@s-gato

s-gato commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@llstrk Good catch on both points, thank you.

Fixed in c525346: the drop-in now appends with `USB_DENYLIST+="8087:..."`, so exclusions from earlier lexically-sorted user drop-ins survive, and the shell test asserts the append form. For reference, TLP's parser (`tlp-readconfs`) joins appended values with an explicit separating space, so no leading space is needed inside the quotes.

On the documentation point: you're right, the option is `USB_EXCLUDE_BTUSB` (default `0` in 1.10). I kept the explicit denylist over `USB_EXCLUDE_BTUSB=1` because the class-based option exempts every btusb device, including third-party USB dongles, while the denylist targets only the Intel combo cards Omarchy ships. I'll correct the PR description accordingly.

@llstrk

llstrk commented Sep 23, 2026

Copy link
Copy Markdown

Verified: At c525346, both points from the earlier review are resolved in the checked scope.

The drop-in now uses USB_DENYLIST+=. With TLP 1.10.2's real parser and synthetic configuration:

Earlier drop-in: USB_DENYLIST="1234:5678"

712c0b3 (=)   seven Intel IDs only; earlier entry lost
c525346 (+=)  1234:5678 + seven Intel IDs

An explicit assignment in /etc/tlp.conf still replaces the combined list. The parser supplies the separating space, confirming that no leading space is needed inside the appended value. The updated shell test passes on the current files and rejects the previous = form.

Verified: The description now correctly names USB_EXCLUDE_BTUSB and distinguishes its class-based exemption from the explicit Intel-ID list. No additional issue was found in this follow-up's scope.


Review information

Test scope: TLP 1.10.2 parser with synthetic configuration and the focused shell test, plus source inspection. No physical Bluetooth reconnection, live TLP/udev service, or package upgrade was tested.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Astra Medium initial inspection and synthesis, fresh independent Opus 5.5 High (Claude Code) and GPT 6 Sol Xhigh (Pi) technical reviews, verification against targeted evidence, and a separate Astra Medium editorial check.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
cursor Bot pushed a commit to AnPod/omarchy that referenced this pull request Sep 29, 2026
TLP rewrites power/control=auto after udev, which suspends Intel combo
BT controllers and drops BLE reconnects. Ship a tlp.d denylist drop-in
and install it on existing machines (omacom#12950).

Co-authored-by: AnPod <AnPod@users.noreply.github.com>
8087:0a2a (3165/7265), 8087:0a2b (8260/8265) and 8087:0aa7 (3168) are Intel combined controllers in btusb's device table, and 0a2a is confirmed runtime-suspended with BLE reconnect failures in omacom#12095, so the drop-in left them suspending under TLP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at adbdbc3. The drop-in does what it says, and I pushed one small addition to it; it is not marked verified yet because the symptom needs hardware a VM does not have.

Pushed: adbdbc3 adds 8087:0a2a, 8087:0a2b and 8087:0aa7 to the denylist. They are Intel combined Bluetooth controllers in btusb's device table (3165/7265, 8260/8265 and 3168), and 0a2a is confirmed runtime-suspended with the same reconnect failure in #12095, so under TLP they would have kept suspending.

Checked on a disposable Omarchy worker: ./test/cli passes, test/shell.d/tlp-bluetooth-usb-test.sh and upgrade-to-quattro-test.sh pass, and the full shell suite has four failures (ascii-test.sh, branding-about-animation-test.sh, kernel-headers-migration-test.sh, omarchy-kernel-migration-test.sh) that fail identically on the base this branch sits on, so none is from this change. With TLP 1.10.2 installed on the worker and a user drop-in 50-mine.conf setting USB_DENYLIST="1234:5678", tlp-stat -c reports the effective list as 1234:5678 followed by all ten Intel IDs, so the += keeps earlier user exclusions. Without the drop-in only 1234:5678 is excluded and USB_EXCLUDE_BTUSB="0". What could not be checked here is the reconnect itself: the worker has no Intel Bluetooth controller.

Packaging: omarchy-settings copies the whole etc/ tree, so the file ships with no PKGBUILD change, and TLP owns /etc/tlp.d/ but not this filename, so there is no file conflict with or without TLP installed. On machines without TLP it is inert. The --overwrite entry in bin/omarchy-upgrade-to-quattro is harmless but not needed: that list covers files 3.x wrote by hand, and 3.x never wrote this one.

Second opinion: Codex Medium reviewed it in two rounds. It found the missing controller IDs above, agreed the += syntax, packaging and test are sound, and its last round on adbdbc3 found nothing open; it can read this session's reasoning, so its agreement is not guaranteed to be independent.

Related: #13671 makes the same change later and adds a migration that copies the file by hand; this one is the smaller of the two and three of the four IDs it had over this one are now included here (8087:0037 is not, as nothing here confirms it). Neither touches the systemd hwdb rule that suspends these controllers on a stock Omarchy install without TLP, which #12095 describes.

Waiting on: the maintainer, to decide whether Omarchy should carry configuration for TLP, which it does not ship and which replaces its power-profiles-daemon. A confirmation on real hardware would also settle it: @jordanglean, or a maintainer, on a machine running TLP with an Intel Bluetooth controller, sudo curl -fsSLo /etc/tlp.d/omarchy-bluetooth-usb.conf https://raw.githubusercontent.com/s-gato/omarchy/adbdbc3fe1dd4e35dad5dce09514b7af6d2d1fcc/etc/tlp.d/omarchy-bluetooth-usb.conf && sudo tlp start, then check that the controller's power/control reads on and a paired BLE mouse or keyboard reconnects after a reboot without re-pairing.

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds power management configuration for Bluetooth USB devices.

This PR appears safe to merge; no actionable issue was found.

Summary

Adds a TLP drop-in that keeps the listed Intel Bluetooth USB controllers awake.

  • Appends controller IDs to USB_DENYLIST.
  • Registers the installed configuration path in the Quattro upgrade’s overwrite list.
  • Adds checks for the configuration content and upgrade registration.

Reviews (1) · Last reviewed commit: "Exclude the older Intel combo Bluetooth ..."

@omarchybot omarchybot added the compatibility Make Omarchy work better on everything! label Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants