From ea6f24e861b75020e95a789e35f528c26ad06323 Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Fri, 22 Aug 2025 09:39:18 -0400 Subject: [PATCH] state-routes: Don't save routes that are not available If the user changed the volume on a ACP 'Headphones' route to a value different than 100%, and then unplugs the jack headset, the ACP 'Headphones' route becomes unavailable with volume set to 100% and the save flag not cleared. Since the save flag is not cleared when the ACP 'Headphones' route becomes unavailable, WirePlumber will save it with 100% volume, overriding the previous volume value set by the user. This is not ideal because the volume will be restored to 100% by WirePlumber when plugging back the headset. This change fixes this by never saving routes that are not available. --- src/scripts/device/state-routes.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/device/state-routes.lua b/src/scripts/device/state-routes.lua index d1a55e25..68617ebb 100644 --- a/src/scripts/device/state-routes.lua +++ b/src/scripts/device/state-routes.lua @@ -251,7 +251,7 @@ store_or_restore_routes_hook = AsyncEventHook { Json.Object { index = route_info.index }:to_string () push_select_routes = true - elseif route.save and route.props then + elseif route.available ~= "no" and route.save and route.props then -- just save route properties log:info (device, string.format ("storing route(%s) props of device(%s)",