From 4450ddadcfad86e775536609578f9684147000a9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 22 Oct 2020 13:18:09 +0200 Subject: [PATCH] pulse: mark the global changed when volume/mute changed When we change the volume/mute of a sink/source, mark the source as changed so that when we get the update from the server we emit a CHANGE event. We don't do this otherwise because the server volume update and our local volume is the same. Fixes #298 --- pipewire-pulseaudio/src/introspect.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pipewire-pulseaudio/src/introspect.c b/pipewire-pulseaudio/src/introspect.c index 14c0a7493..140d59fdf 100644 --- a/pipewire-pulseaudio/src/introspect.c +++ b/pipewire-pulseaudio/src/introspect.c @@ -363,10 +363,12 @@ static int set_node_volume(pa_context *c, struct global *g, const pa_cvolume *vo return 0; } g->node_info.mute = mute; + g->changed++; if (!SPA_FLAG_IS_SET(g->permissions, PW_PERM_W | PW_PERM_X)) return PA_ERR_ACCESS; + pw_log_debug("node %p: id:%u", g, g->id); pw_node_set_param((struct pw_node*)g->proxy, SPA_PARAM_Props, 0, spa_pod_builder_add_object(&b, @@ -410,6 +412,7 @@ static int set_device_volume(pa_context *c, struct global *g, struct global *cg, return 0; } g->node_info.mute = mute; + g->changed++; if (!SPA_FLAG_IS_SET(cg->permissions, PW_PERM_W | PW_PERM_X)) return PA_ERR_ACCESS; @@ -430,6 +433,7 @@ static int set_device_volume(pa_context *c, struct global *g, struct global *cg, vols)); param = spa_pod_builder_pop(&b, &f[0]); + pw_log_debug("device %p: id:%u", cg, cg->id); pw_device_set_param((struct pw_node*)cg->proxy, SPA_PARAM_Route, 0, param); @@ -446,7 +450,7 @@ static int set_volume(pa_context *c, struct global *g, const pa_cvolume *volume, card_id = g->node_info.device_id; device_id = g->node_info.profile_device_id; - pw_log_info("card:%u global:%u flags:%08x", card_id, g->id, g->node_info.flags); + pw_log_debug("card:%u global:%u flags:%08x", card_id, g->id, g->node_info.flags); if (SPA_FLAG_IS_SET(g->node_info.flags, NODE_FLAG_DEVICE_VOLUME | NODE_FLAG_DEVICE_MUTE) && (cg = pa_context_find_global(c, card_id)) != NULL) {