[gstreamer-bugs] [Bug 518082] New: alsamixer: playback volumes overwritten by capture volumes if track has both playback and capture caps

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Fri Feb 22 06:57:06 PST 2008


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=518082

  GStreamer | gst-plugins-base | Ver: 0.10.17
           Summary: alsamixer: playback volumes overwritten by capture
                    volumes if track has both playback and capture caps
           Product: GStreamer
           Version: 0.10.17
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: koslund at sympatico.ca
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: 2.21/2.22
   GNOME milestone: Unspecified


The gst alsamixer implementation supports alsa element tracks that have both
playback and capture capabilities by creating two separate tracks for the
element. See gst-plugins-base/ext/alsa/gstalsamixer.c function
gst_alsa_mixer_ensure_track_list(). When the track is created in
gstalsamixertrack.c gst_alsa_mixer_track_new() it is passed a flag field which
indicates whether the track is _INPUT or _OUTPUT and the function initializes a
separate field alsa_flags in function
gst_alsa_mixer_track_update_alsa_capabilities using alsa functions
snd_mixer_selem_has_playback_volume and snd_mixer_selem_has_capture_volume. As
a consequence a dual capability track will have both
GST_ALSA_MIXER_TRACK_PVOLUME and GST_ALSA_MIXER_TRACK_CVOLUME flags set on
*both* the _INPUT and _OUTPUT tracks created for the alsa element.

This leads to a bug when gst_alsa_mixer_track_update() is called to update a
tracks volumes. This function checks only the alsa_flags (via
alsa_track_has_cap). If a track has both _PVOLUME AND _CVOLUME set, the
function will first retrieve the playback volumes and store them in
GstMixerTrack->volumes, then it will retrieve the capture volumes and overwrite
the playback volumes in the structure, since GstMixerTrack supports only one
set of volumes.

This bug showed up in a recent version of gnome-applets/applet_mixer2 on
Mandriva Cooker, which includes a patch not yet accepted in the gnome-applets
trunck, but which has been implement in Redhat and Ubuntu distributions and
which implements mixer notifications. When used with an Audigy2 card, which
alsa shows as having a dual capability Master element, changes to the Master
volume result in notifications in which the Master playback volume is always
set to zero when in fact it is non-zero.

This bug was located and verified by tracing with gdb and inspection of the
code.

Output from amixer:
$ amixer -c 0 info
Card hw:0 'Audigy2'/'Audigy 2 [SB0240] (rev.4, serial:0x10071102) at 0xa000,
irq 20'
  Mixer name    : 'SigmaTel STAC9721,23'
  Components    : 'AC97a:83847609'
  Controls      : 213
  Simple ctrls  : 48

$ amixer -c 0 | head
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined cvolume cswitch cswitch-joined
  Playback channels: Mono
  Capture channels: Front Left - Front Right
  Limits: Playback 0 - 100 Capture 0 - 31
  Mono: Playback 9 [9%] [-36.40dB]
  Front Left: Capture 0 [0%] [-46.50dB] [on]
  Front Right: Capture 0 [0%] [-46.50dB] [on]
Simple mixer control 'Tone',0
  Capabilities: pswitch


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=518082.




More information about the Gstreamer-bugs mailing list