Skip to content

framework/13-inch: fix enhanced audio device priority#1858

Open
Stebalien wants to merge 1 commit intoNixOS:masterfrom
Stebalien:steb/fix-framework-audio-priorities
Open

framework/13-inch: fix enhanced audio device priority#1858
Stebalien wants to merge 1 commit intoNixOS:masterfrom
Stebalien:steb/fix-framework-audio-priorities

Conversation

@Stebalien
Copy link
Copy Markdown

@Stebalien Stebalien commented May 5, 2026

Description of changes

On framework laptops, ensure that the "enhanced audio" sink for the laptop speakers has a lower priority than bluetooth speakers (by giving it the same priority as the built-in laptop speakers, 1009). Bluetooth speakers have a priority of 1010 by default.

NOTE: the existing comment in the code claiming that higher values mean lower priority is incorrect; lower priorities values mean lower priority.

Things done
  • Tested the changes in your own NixOS Configuration
  • Tested the changes end-to-end by using your fork of nixos-hardware and
    importing it via <nixos-hardware> or Flake input

After testing, my audio switches from my laptop speakers to my bluetooth headphones when I connect them.

@Stebalien Stebalien requested a review from JohnAZoidberg as a code owner May 5, 2026 01:29
On framework laptops, ensure that the "enhanced audio" sink for the
laptop speakers has a lower priority than bluetooth speakers (by giving
it the same priority as the laptop speakers, 1009 [1]). Bluetooth
speakers have a priority of 1010 [2] by default.

NOTE: the existing comment in the code claiming that higher values mean
lower priority is incorrect; lower priorities values mean lower priority.

[1] https://gitlab.freedesktop.org/pipewire/wireplumber/-/blob/7fa44ef8d0b2f603bd826d399718cef8cf6a800a/src/scripts/monitors/alsa.lua#L218
[2] https://gitlab.freedesktop.org/pipewire/wireplumber/-/blob/7fa44ef8d0b2f603bd826d399718cef8cf6a800a/src/scripts/monitors/bluez.lua#L275
@Stebalien Stebalien force-pushed the steb/fix-framework-audio-priorities branch from 70a10a7 to 1ea299f Compare May 5, 2026 01:31
@JohnAZoidberg
Copy link
Copy Markdown
Member

How did you figure out the numbers?

@Stebalien
Copy link
Copy Markdown
Author

  1. wpctl status to get the devices.
  2. wpctl inspect DEV_NUM to get the properties.

Then I grepped around in the wireplumber source code and found where the priorities were configured (see the links in the PR description). The bluez priority is always 1010 for sinks and 2010 for sources. The calculation for built-in audio devices is trickier, but it looks like it should be a stable 1009 for Framework laptops, assuming it always shows up as the "first" device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants