Index: gstalsamixer.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsamixer.c,v
retrieving revision 1.39
diff -u -p -r1.39 gstalsamixer.c
--- gstalsamixer.c	16 Sep 2007 01:56:21 -0000	1.39
+++ gstalsamixer.c	15 Oct 2007 14:17:23 -0000
@@ -581,6 +581,24 @@ gst_alsa_mixer_get_volume (GstAlsaMixer 
   }
 }
 
+static void
+check_for_different_volumes (guint num_channels, gint * volumes)
+{
+  gint volume;
+  guint i;
+
+  if (num_channels <= 1)
+    return FALSE;
+
+  volume = volumes[0];
+  for (i = 1; i < num_channels; i++) {
+    if (volumes[i] != volume)
+      return TRUE;
+  }
+
+  return FALSE;
+}
+
 void
 gst_alsa_mixer_set_volume (GstAlsaMixer * mixer, GstMixerTrack * track,
     gint * volumes)
@@ -600,10 +618,16 @@ gst_alsa_mixer_set_volume (GstAlsaMixer 
       for (i = 0; i < track->num_channels; i++)
         alsa_track->volumes[i] = volumes[i];
     } else {
-      for (i = 0; i < track->num_channels; i++) {
-        alsa_track->volumes[i] = volumes[i];
-        snd_mixer_selem_set_playback_volume (alsa_track->element, i,
-            volumes[i]);
+      if (check_for_different_volumes (track->num_channels, volumes) == FALSE) {
+        snd_mixer_selem_set_playback_volume_all (alsa_track->element, volumes[0]);
+        for (i = 0; i < track->num_channels; i++)
+          alsa_track->volumes[i] = volumes[0];
+      } else {
+        for (i = 0; i < track->num_channels; i++) {
+          alsa_track->volumes[i] = volumes[i];
+          snd_mixer_selem_set_playback_volume (alsa_track->element, i,
+              volumes[i]);
+	}
       }
     }
 
@@ -612,9 +636,15 @@ gst_alsa_mixer_set_volume (GstAlsaMixer 
     /* Is emulated record flag activated? */
     if (track->flags & GST_MIXER_TRACK_RECORD ||
         alsa_track->alsa_flags & GST_ALSA_MIXER_TRACK_CSWITCH) {
-      for (i = 0; i < track->num_channels; i++) {
-        alsa_track->volumes[i] = volumes[i];
-        snd_mixer_selem_set_capture_volume (alsa_track->element, i, volumes[i]);
+      if (check_for_different_volumes (track->num_channels, volumes) == FALSE) {
+        snd_mixer_selem_set_capture_volume_all (alsa_track->element, volumes[0]);
+        for (i = 0; i < track->num_channels; i++)
+          alsa_track->volumes[i] = volumes[0];
+      } else {
+        for (i = 0; i < track->num_channels; i++) {
+          alsa_track->volumes[i] = volumes[i];
+          snd_mixer_selem_set_capture_volume (alsa_track->element, i, volumes[i]);
+        }
       }
     } else {
       for (i = 0; i < track->num_channels; i++)
