GNOME Bugzilla – Bug 537031
Enhancement to SunAudio mixer plugin
Last modified: 2008-06-10 06:52:32 UTC
The new gnome-volume-control 2.23 program breaks with the SunAudio mixer applet because the mute state needs to be updated when setting the volume for line-in and monitor. These don't really support mute, so the mixer applet just changes the volume level to 0 to simulate a mute. This change makes sure that the mute flag gets set for these when the volume is set to 0, and is unset when the volume is set to a non-zero value. This way the mute button is unchecked when you raise the slider above zero when it is already muted. Otherwise the volume sticks at 0 and you can't raise the value. Clicking the unmute button leaves the value at zero and again mutes it. Can this patch go upstream?
Created attachment 112295 [details] [review] patch to fix mixer so it works with gnome-volume-control version 2.23
AFAIK we usually differentiate between "mute" and "no gain" so I'm not sure if this patch makes much sense as it would cause behavioural differences between different mixer implementations. OTOH it might make sense to set the "mute" flag whenever the gain becomes zero in general everywhere...
Sebastian, I am confused by your comments for a few reasons. For one, as I already explained, the SunAudio "LINE_IN" and "MONITOR" tracks do not support any concept of "Mute" (though volume output does). There does not seem to be any way in GStreamer to specify that specific tracks do not support "Mute", and therefore disable the "Mute" buttons in gnome-volume-control. Being able to disable the "Mute" button for specific tracks, would probably make the most sense from a SunAudio plugin perspective. However since GStreamer doesn't let you disable "Mute" for specific tracks, we have made the SunAudio mixer plugin change the volume to 0 for "LINE_IN" and "MONITOR" when the "Mute" button is pressed. Then when you "Unmute", the plugin is smart enough to return the volume/balance levels to their previous values. This seems to make the most sense, and does a reasonable job of simulating "Mute", I think. I think you are wrong when you say that GStreamer differentiates between "mute" and "no gain". For example, I do not think gnome-volume-control does any sort of differentiation. Look at the function gnome_volume_control_track_update in gnome-media-apps/gst-mixer/src/track.c (the latest GNOME 2.23 version). Note that mute is set to TRUE if the slider and actual volume level is set to zero, regardless of the actual MUTE flag setting. This does not seem like differentiating to me. ---- mute = GST_MIXER_TRACK_HAS_FLAG (trkw->track, GST_MIXER_TRACK_MUTE) ? TRUE : FALSE; [...] if (trkw->sliderbox) { gnome_volume_control_volume_update (GNOME_VOLUME_CONTROL_VOLUME (trkw->slide rbox)); gnome_volume_control_volume_ask ( GNOME_VOLUME_CONTROL_VOLUME (trkw->sliderbox), &vol_is_zero, &slider_is_zero); } if (!slider_is_zero && vol_is_zero) mute |= TRUE; if (trkw->mute) { if (gnome_volume_control_button_get_active (trkw->mute) == mute) { gnome_volume_control_button_set_active (trkw->mute, !mute); } }
Ok, so let's get this in then :) 2008-06-10 Sebastian Dröge <slomo@circular-chaos.org> Patch by: Brian Cameron <brian.cameron at sun dot com> * sys/sunaudio/gstsunaudiomixerctrl.c: (gst_sunaudiomixer_ctrl_get_volume), (gst_sunaudiomixer_ctrl_set_volume): Improvements for the SunAudio mixer by handling mute as no gain for tracks that have a gain property but no mute property. Fixes bug #536067.