From b09c8d79c5b868dd204b05940483b0203f1400f4 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Wed, 20 May 2026 11:32:39 +0200
Subject: [PATCH] filter-graph: sync_volume initializes the control ports

Setting the volume control ports with a volume param also initializes
the controls. This ensures the controls are not restored to their
default value when the graph is activated.

Fixes #5192
---
 spa/plugins/filter-graph/filter-graph.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/spa/plugins/filter-graph/filter-graph.c b/spa/plugins/filter-graph/filter-graph.c
index cd1ec7841..5df00604a 100644
--- a/spa/plugins/filter-graph/filter-graph.c
+++ b/spa/plugins/filter-graph/filter-graph.c
@@ -740,6 +740,9 @@ static int sync_volume(struct graph *graph, struct volume *vol)
 		}
 		v = v * (vol->max[n_port] - vol->min[n_port]) + vol->min[n_port];
 
+		p->control_initialized = true;
+		p->control_current = v;
+
 		n_hndl = SPA_MAX(1u, p->node->n_hndl);
 		res += port_id_set_control_value(p, i % n_hndl, v);
 	}
-- 
GitLab

