From e4b54426b497db135176afaa54c19b547b41dcd1 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 25 Jul 2014 12:35:01 +0200 Subject: [PATCH] audio: Set initial volume on software mixer This must be set after the audio actor has injected itself into the software mixer, else it will have no effect on the GStreamer software mixer. Fixes #791 --- docs/changelog.rst | 5 +++++ mopidy/audio/actor.py | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 82000ed6..9dbadc1a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -10,6 +10,11 @@ v0.19.2 (UNRELEASED) Bug fix release. +**Audio** + +- Make :confval:`audio/mixer_volume` work on the software mixer again. This + was broken with the mixer changes in 0.19.0. (Fixes: :issue:`791`) + **HTTP** - When using Tornado 4.0, allow WebSocket requests from other hosts. (Fixes: diff --git a/mopidy/audio/actor.py b/mopidy/audio/actor.py index 55aa45b8..dcc51ea4 100644 --- a/mopidy/audio/actor.py +++ b/mopidy/audio/actor.py @@ -195,6 +195,14 @@ class Audio(pykka.ThreadingActor): self._connect(self._playbin, 'notify::volume', self._on_mixer_change) self._connect(self._playbin, 'notify::mute', self._on_mixer_change) + # The Mopidy startup procedure will set the initial volume of a mixer, + # but this happens before the audio actor is injected into the software + # mixer and has no effect. Thus, we need to set the initial volume + # again. + initial_volume = self._config['audio']['mixer_volume'] + if initial_volume is not None: + self._mixer.set_volume(initial_volume) + def _on_mixer_change(self, element, gparamspec): self._mixer.trigger_events_for_changed_values()