From affdf36a2934b4dcd8e5cb2c7d7ae290d8647c55 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Thu, 7 Jul 2022 14:52:39 +0300 Subject: [PATCH] policy-device-routes: change default volume to 0.4 on cubic scale It's safer to have the default volume value at significant attenuation, to mitigate situations where the output is at high gain. Use linear scale 0.4^3 (-24 dB), which puts Pulseaudio volume sliders at 40%, as a better starting value than 0.4 (-8 dB / 74%). E.g. for many Bluetooth headphones, the volume at 74% is still uncomfortably high, and a lower value is better. --- src/config/main.lua.d/40-device-defaults.lua | 2 +- src/scripts/policy-device-routes.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/main.lua.d/40-device-defaults.lua b/src/config/main.lua.d/40-device-defaults.lua index 2204c4ac..fbbfa9d6 100644 --- a/src/config/main.lua.d/40-device-defaults.lua +++ b/src/config/main.lua.d/40-device-defaults.lua @@ -8,7 +8,7 @@ device_defaults.properties = { ["use-persistent-storage"] = true, -- the default volume to apply to ACP device nodes, in the linear scale - --["default-volume"] = 0.4, + --["default-volume"] = 0.064, -- Whether to auto-switch to echo cancel sink and source nodes or not ["auto-echo-cancel"] = true, diff --git a/src/scripts/policy-device-routes.lua b/src/scripts/policy-device-routes.lua index 075f5d63..2b44e42b 100644 --- a/src/scripts/policy-device-routes.lua +++ b/src/scripts/policy-device-routes.lua @@ -14,7 +14,7 @@ local config = ... or {} use_persistent_storage = config["use-persistent-storage"] or false -- the default volume to apply -default_volume = tonumber(config["default-volume"] or 0.4) +default_volume = tonumber(config["default-volume"] or 0.4^3) -- table of device info dev_infos = {}