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.
This commit is contained in:
Julian Bouzas 2025-08-22 09:39:18 -04:00
parent ebd6d49a81
commit ea6f24e861

View file

@ -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)",