After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 537031 - Enhancement to SunAudio mixer plugin
Enhancement to SunAudio mixer plugin
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other opensolaris
: Normal normal
: 0.10.9
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-06 20:08 UTC by Brian Cameron
Modified: 2008-06-10 06:52 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
patch to fix mixer so it works with gnome-volume-control version 2.23 (1.43 KB, patch)
2008-06-06 20:09 UTC, Brian Cameron
committed Details | Review

Description Brian Cameron 2008-06-06 20:08:43 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?
Comment 1 Brian Cameron 2008-06-06 20:09:20 UTC
Created attachment 112295 [details] [review]
patch to fix mixer so it works with gnome-volume-control version 2.23
Comment 2 Sebastian Dröge (slomo) 2008-06-09 08:32:18 UTC
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...
Comment 3 Brian Cameron 2008-06-09 16:38:41 UTC
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);
    }
  }
Comment 4 Sebastian Dröge (slomo) 2008-06-10 06:52:32 UTC
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.