alsa: ignore volume changes from the hw if we are not on the active console

This commit is contained in:
Lennart Poettering 2010-01-13 20:30:36 +01:00
parent 9b37dce422
commit 540ec7b961
2 changed files with 6 additions and 0 deletions

View file

@ -1103,6 +1103,9 @@ static int mixer_callback(snd_mixer_elem_t *elem, unsigned int mask) {
if (mask == SND_CTL_EVENT_MASK_REMOVE) if (mask == SND_CTL_EVENT_MASK_REMOVE)
return 0; return 0;
if (u->sink->suspend_cause & PA_SUSPEND_SESSION)
return 0;
if (mask & SND_CTL_EVENT_MASK_VALUE) { if (mask & SND_CTL_EVENT_MASK_VALUE) {
pa_sink_get_volume(u->sink, TRUE); pa_sink_get_volume(u->sink, TRUE);
pa_sink_get_mute(u->sink, TRUE); pa_sink_get_mute(u->sink, TRUE);

View file

@ -1051,6 +1051,9 @@ static int mixer_callback(snd_mixer_elem_t *elem, unsigned int mask) {
if (mask == SND_CTL_EVENT_MASK_REMOVE) if (mask == SND_CTL_EVENT_MASK_REMOVE)
return 0; return 0;
if (u->source->suspend_cause & PA_SUSPEND_SESSION)
return 0;
if (mask & SND_CTL_EVENT_MASK_VALUE) { if (mask & SND_CTL_EVENT_MASK_VALUE) {
pa_source_get_volume(u->source, TRUE); pa_source_get_volume(u->source, TRUE);
pa_source_get_mute(u->source, TRUE); pa_source_get_mute(u->source, TRUE);