From c88e4680f050a6ac65335b1d8148287cc4566b00 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 13 Jan 2010 20:30:36 +0100 Subject: [PATCH] alsa: ignore volume changes from the hw if we are not on the active console --- src/modules/alsa/alsa-sink.c | 3 +++ src/modules/alsa/alsa-source.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index ed16c83..690480f 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -1103,6 +1103,9 @@ static int mixer_callback(snd_mixer_elem_t *elem, unsigned int mask) { if (mask == SND_CTL_EVENT_MASK_REMOVE) return 0; + if (u->sink->suspend_cause & PA_SUSPEND_SESSION) + return 0; + if (mask & SND_CTL_EVENT_MASK_VALUE) { pa_sink_get_volume(u->sink, TRUE); pa_sink_get_mute(u->sink, TRUE); diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c index 157698e..f8b583e 100644 --- a/src/modules/alsa/alsa-source.c +++ b/src/modules/alsa/alsa-source.c @@ -1051,6 +1051,9 @@ static int mixer_callback(snd_mixer_elem_t *elem, unsigned int mask) { if (mask == SND_CTL_EVENT_MASK_REMOVE) return 0; + if (u->source->suspend_cause & PA_SUSPEND_SESSION) + return 0; + if (mask & SND_CTL_EVENT_MASK_VALUE) { pa_source_get_volume(u->source, TRUE); pa_source_get_mute(u->source, TRUE); -- 2.7.4