Repository navigation
Optional safe start volume for every output when it connects or becomes the default #18189
mmsmsy
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
Several reports describe the same painful moment: an output becomes active at a high volume and blasts the user before they can react.
I hit a version of this too. I switched from headphones (left at 100%) to a Bluetooth speaker that showed 20%. The first touch of the volume slider jumped it to 100%, so the speaker blasted for a second. The cause was AVRCP absolute volume: the slider drove the speaker's own volume, and the speaker's own value and the PC's value disagreed.
What I use now
The rule is simple: every output starts at 15% when it connects or becomes the default output. The device itself stays at 100% of its own range, and the system slider is the only volume control.
~/.config/wireplumber/wireplumber.conf.d/volume-start-15.conf:How to install
~/.config/wireplumber/wireplumber.conf.d/volume-start-15.conf.~/.local/bin/audio-switch-volumeand make it executable:chmod +x ~/.local/bin/audio-switch-volume~/.config/systemd/user/audio-switch-volume.service:systemctl --user daemon-reload systemctl --user enable --now audio-switch-volume.service systemctl --user restart wireplumberWarning: before the restart, pause playback. If a Bluetooth device used hardware volume until now, its own level can be very low after the change. Mute the stream, set the device to its own maximum, then unmute. To change the level, set
AUDIO_SWITCH_VOLUME(for example20%) in the service and setdevice.routes.default-sink-volumeto the same level cubed (0.2^3 = 0.008).Trade-offs
device.restore-routes = falsealso stops the restore of microphone levels. Every microphone input, built-in, USB or Bluetooth, starts at 100% (device.routes.default-source-volumeis 1.0 by default).api.alsa.soft-mixer = trueapplies to every ALSA card, laptop speakers included. The hardware mixer stays where it is (set it to full scale once), and only software sets the volume.Note:
bluez5.hw-volume = [ ]did nothing for me. The property that works isbluez5.enable-hw-volume = false.Setup: Omarchy 4.5.0-3, PipeWire 1.6.9, WirePlumber 0.5.18.
Suggestion
An opt-in setting, for example "start every output at N%" in the audio panel, plus the WirePlumber drop-in and a switch watcher like the one above. #17986 proposes per-device memory instead. Both can exist: a remembered level, but never above a safe limit when a device connects or becomes the default.
All reactions