Repository navigation
Conversation
|
Another data point for this, from a different angle: multipoint auto-switching. I was trying to solve this problem and came across your PR. Pixel Buds Pro 2, connected to both an Android phone and an Omarchy 4.0.3 laptop. Before enabling mpris-proxy, starting YouTube on the laptop never pulled the buds away from the phone. Audio went to the buds' sink, but they stayed on the phone. The same buds switch automatically to a MacBook. The multipoint firmware appears to decide based on AVRCP play status, and without a registered player, Linux never reports that it's playing. After |
|
it's very nice to see that one change can help with two different problems thank you for your comment ❤️ |
|
Another data point, and one gap in the drop-in. Stem gestures. AirPods Pro on a Dell XPS 14 (DA14260), Omarchy 4.0.0.alpha, bluez 5.87. Without So this PR also fixes track skipping from AirPods, not just ear detection. The gap. Worse, the AirPods reconnected to the restarted bluetoothd before the proxy had re-registered its players. From then on every gesture arrived as What I'm running locally as a workaround: a small user service that watches for Also, the branch now conflicts with |
…player Headsets send play/pause, next and previous as AVRCP passthrough, which bluez only routes to a player registered on org.bluez.Media1. Nothing registered one, so the commands were discarded: headset buttons and stem gestures did nothing, and earbuds with in-ear detection could not pause playback when one was taken out. bluez-utils already ships mpris-proxy and its unit, disabled. Enable it, with a drop-in mirroring bt-agent.service so it stays inert on machines with no bluetooth instead of leaving a failed unit.
2478a9c to
b7a0eb4
Compare
|
Thanks — you're right about the comment, and I've corrected it. I checked the claim against my own journal before changing anything, and it matches what you describe. mpris-proxy logs a player event after the bus goes away, so the process is plainly still alive: It only stopped there because systemd stopped it at session end. So
I agree the watcher doesn't belong here. The re-registration race you hit — AirPods reconnecting before the proxy has re-registered, after which every gesture arrives as Good data point on the stem gestures. I'd only observed in-ear detection; that next/previous never arrive at all without the proxy makes the case broader than I'd framed it. I've folded play/pause, next and previous into the commit message and the drop-in comment so the scope is clear. Rebased onto current quattro — the conflict was |
|
| mpris_dropin="$ROOT/default/systemd/user/mpris-proxy.service.d/10-omarchy.conf" | ||
| grep -Fx 'ConditionPathIsDirectory=/sys/class/bluetooth' "$mpris_dropin" >/dev/null || | ||
| fail "the AVRCP bridge is pulled in on machines with no bluetooth subsystem" | ||
| grep -Fx 'ExecCondition=/usr/bin/systemctl is-active --quiet bluetooth.service' "$mpris_dropin" >/dev/null || | ||
| fail "mpris-proxy exits 1 when bluetoothd is unreachable, so without this it leaves a failed unit instead of skipping" | ||
| grep -Fx 'Restart=on-failure' "$mpris_dropin" >/dev/null || | ||
| fail "a crashed proxy stays dead and headset transport controls silently stop working" | ||
| pass "the AVRCP bridge stays inert without bluetooth and recovers from its own crash" |
There was a problem hiding this comment.
Package delivery goes unchecked
These tests check the repository copy of the drop-in, but not whether the package installs it where systemd reads it. If the package omits it, the tests still pass while users receive none of these guards. Add the drop-in and its destination to package_defaults in config-test.sh, which already checks package delivery for other service defaults.
|
Nice drop-in — the bluetooth ConditionPathIsDirectory / ExecCondition pairing matches how we keep bt-agent inert, and the field reports on stem gestures / multipoint are convincing. One blocker before merge: |
|
Classified, not yet verified. Two models read this pull request separately and did not agree on what it is: Claude Opus 5.5 read it as an enhancement, since it turns on a service Omarchy has never enabled and adds a drop-in and a migration for it. Codex Medium read it as a bug fix, since headset play/pause, next/previous and in-ear pause do nothing on a stock install today. Both readings hold up, so it carries no class label for now, and it is not run on a worker until the class is settled, because that decides whether it is verified as a bug fix or waits to be asked for as a feature. One thing checked meanwhile: Waiting on the maintainer to settle the classification. |
|
Another data point, plus one gap I hit after enabling CMF Buds Pro 2 on an M1 Pro MacBook Pro (Omarchy 4.5.0-3, bluez 5.87). Before Gap: the media OSD no longer appears. My local workaround is a user service that watches the session bus for |
Bluetooth headsets send transport control as AVRCP passthrough — the play/pause button, and the pause that earbuds with in-ear detection emit when you take one out. bluez only routes those to a player registered on
org.bluez.Media1. Omarchy registers nothing, so bluez discards them: headset buttons do nothing, and music keeps playing into an earbud that has been taken out.mpris-proxyis that registration — it exports session MPRIS players to bluez.bluez-utilsis already inomarchy-base.packages, and it ships both the binary and ampris-proxy.serviceunit. The unit is just never enabled, so this costs no new dependency.Evidence
On a JBL LIVE PRO 2 TWS, which advertises
A/V Remote Control (0x110e)andA/V Remote Control Controller (0x110f).Before — the device tree has audio endpoints and no player object, so there is nothing for bluez to route a passthrough command to:
Taking an earbud out produced no MPRIS traffic at all and nothing in the bluetoothd log.
After starting
mpris-proxy, bluez accepts the player:and removing/reinserting an earbud twice produced, on the session bus:
with the A2DP transport tracking it (
active → idle → active). The earbuds were sending correct AVRCP the whole time; only the receiving end was missing.Worth noting AVRCP absolute volume is handled directly by bluez/PipeWire without a registered player, so headset volume keys already worked. That makes the gap easy to miss — volume works, play/pause does not.
Why the drop-in
mpris-proxyexits 1 withCan't get on system buswhen bluetoothd is unreachable:The unit bluez ships is
Type=simplewith no conditions and noRestart=, so enabling it as-is would leave a failed unit on every machine without a usable adapter. The drop-in mirrorsbt-agent.service, which solves the same problem for the same reason:ConditionPathIsDirectory=/sys/class/bluetoothplus anExecConditiononbluetooth.servicelet it skip cleanly, andRestart=on-failurebrings it back if bluetoothd restarts underneath a running proxy. BecauseExecConditionis re-evaluated on each restart, a stoppedbluetooth.serviceends the unit rather than looping it.Changes
default/systemd/user/mpris-proxy.service.d/10-omarchy.conf— guards mirroringbt-agent.serviceinstall/user/first-run/enable-user-units.sh— enable it alongside the other shipped unitsmigrations/1788959623.sh— enable it on existing installs, with the same TTY fallback used by1786539345.sh(the bluez unit isWantedBy=default.target, notgraphical-session.target)test/shell.d/systemd-test.sh— cover the guards and the first-run enablementTesting
./test/allshows the same 4 pre-existing environment-dependent failures (config,locate,snapper,unowned-system-paths) before and after this change — verified by running the full suite on a pristinequattroworktree and on this branch. No new failures.Migration verified idempotent and clean against a temporary home:
Verified on hardware: with the drop-in installed and the unit enabled, exactly one
mpris-proxyruns,ConditionResult=yes, theExecConditionexits 0, and bluez registers the player. Taking an earbud out pauses playback and reinserting it resumes.