Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Always keep volume up to date #255

Closed
jodal opened this Issue · 7 comments

2 participants

@jodal
Owner

We could poll the mixer volume regularly and trigger the volume_changed event when it changes so that clients which doesn't poll volume will be updated when e.g. the user changes the volume using volume controls outside Mopidy.

@adamcik
Owner

Having checked this we will get <gst.Message gst-mixer-message, type=(string)volume-changed, track=(GstMixerTrack)NULL, volumes=(int)< 31008, 31008 >; from alsamixerelement1 at 0xa221cd0> which should be perfect for solving this issue. We just need to connect the mixer to the bus mixer.set_bus(playbin.get_bus()) and handle the message in our bus message handler :-)

@adamcik
Owner

<gst.Message gst-mixer-message, type=(string)mute-toggled, track=(GstMixerTrack)NULL, mute=(boolean)false; from alsamixerelement1 at 0xadd1140> will also be produced. So we probably need to have better handling of muting as well.

@adamcik
Owner

The initial playing I did with this should simply setting the playbin's bus on the mixer is enough to be able to hook in to these messages. Problem that has been experienced so far is how to handle mute and mapping the events to the right track, as most of the time the only thing we know 100% for sure is that something changed, not what.

@jodal
Owner

In the case something changed, can't we simply call audio.get_volume() and fire off an volume_changed event with the result from get_volume()? I doubt that any additional events with an unchanged volume will be a problem in practice.

@adamcik
Owner

Mhm, was considering that as well.

@jodal
Owner

GStreamer removed all mixers in 1.0 and no longer does any mixing. It's not yet entirely decided what we'll do with mixers when we move to GStramer 1.0+, but we're moving to software mixing by default in 0.17, where nobody can change the volume except through Mopidy. Thus, polling volume to detect external changes isn't important for the time being. Closing.

@jodal jodal closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.