fix(audio): apply sink volume via pactl for BlueZ sinks - #3407
Closed
li-yuanfei wants to merge 1 commit into
Closed
li-yuanfei wants to merge 1 commit into
li-yuanfei wants to merge 1 commit into
Conversation
Some BlueZ/PipeWire sinks do not reliably apply the QML volume property setter, so volume changes made from the DMS UI were silently dropped on those devices. Add `AudioService.setSinkVolume()`, which issues `pactl set-sink-volume <sink> <n>%` and reports whether it handled the change. `setVolume()` and `adjustDefaultSinkVolume()` now try it first and fall back to the existing property setter when no sink name is available. The DankDash media dropdown and media player tab route their volume writes through `AudioService.setVolume()` so every volume surface shares the same path. `setSinkVolume()` takes a percentage (matching `pactl`), while the QML `audio.volume` property keeps its 0..1 fraction semantics.
Collaborator
|
Pretty sure related to quickshell-mirror/quickshell#808 quickshell-mirror/quickshell#807 Using pactl as a workaround comes with other problems so I'd rather not do that |
Collaborator
|
Closing (because quickshell fix is preferred), as a workaround you can change your keybinds to use pactl/wpctl instead of dms volume commands though |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On some Bluetooth (BlueZ/PipeWire) sinks, writing the QML volume property does not
reach the device — the UI slider moves, the OSD changes, but the actual sink volume
stays where it was. Those sinks only respond to
pactl set-sink-volume.Fix
Add
AudioService.setSinkVolume(), which issuespactl set-sink-volume <sink> <n>%and reports whether it handled the change.setVolume()andadjustDefaultSinkVolume()try it first and fall back to theexisting property setter when no sink name is available.
The DankDash media dropdown and media player tab route their volume writes through
AudioService.setVolume()so every volume surface shares the same code path.This follows existing precedent —
AudioServicealready shells out topactlfor sink enumeration and port switching (
pactl list sinks,pactl set-sink-port).Units
setSinkVolume()takes a percentage (0..sinkMaxVolume), matching thepactlargument. The QML
audio.volumeproperty keeps its 0..1 fraction semantics, sothe fallback path still writes
volume / 100.Testing
make lint-qml— PASS (3 entrypoints)make test-qmlfails on this machine, but also fails on unmodified upstreammasterin the same environment, so it is not a regression from this change.Verified manually on a BlueZ sink that previously ignored UI volume changes:
volume now tracks the slider.