framework/13-inch: fix enhanced audio device priority#1858
Conversation
70a10a7 to
1ea299f
Compare
|
How did you figure out the numbers? |
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. |
|
Did you figure out where the default numbers come from? Is this actually hardware/firmware dependent? |
The defaults come from the code I linked in the PR description.
The defaults picked by wireplumber are sane. The priority (lowest to highest) is roughly:
The previous code was incorrect because:
|
|
Thanks for the explanation. If it's purely software deciding what to use, then this wouldn't be a fix for a specific type of hardware, right? |
|
Ah, I see the confusion. I'm fixing the priority of the virtual "enhanced audio device" created in the modified file specifically (#1253) for Framework 13 laptops. The file I'm editing creates a virtual audio device to improve the sound quality on Framework 13 laptops. However, it assigns a priority higher than the default priority of bluetooth headphones, which clearly (@miketth can correct me if I'm wrong) wasn't the intended behavior given the comment in the code I replaced. |
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
1ea299f to
2a59110
Compare
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
nixos-hardwareandimporting it via
<nixos-hardware>or Flake inputAfter testing, my audio switches from my laptop speakers to my bluetooth headphones when I connect them.