[gst-devel] [PATCH] [BUGFIX] Add PCM as master fall back for cards that do not have 'Master' mixer

Jerone Young jerone at gmail.com
Wed Dec 26 23:24:12 CET 2007


This patch fixes issue with ALSA drivers that enable sound cards that do not
have a hardware 'Master' mixer. Instead on these cards there is only PCM as
the master. This patch adds PCM as a fall back if 'Master' nor 'Front' mixers
are found.


The problem being caused is that tools such as gnome-volume-control
& gnome-control-center are looking for a master they identify the microphone
and not PCM. This is demonstrated on the Lenovo Thinkad T61 & X61 using AD1984
chipset (using Intel HDA driver ALSA driver). This problem has also
been seen a Sony Vaio S4XP.

I've tested this patch on my Thinkpad T61 and it works perfect.

Bugzillas reporting this issue are:

https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/174292
https://bugzilla.redhat.com/show_bug.cgi?id=344911


Signed-off-by: Jerone Young <jerone at gmail.com>

diff -r 52cc0d2f47c2 ext/alsa/gstalsamixer.c
--- a/ext/alsa/gstalsamixer.c	Wed Dec 26 16:02:08 2007 -0600
+++ b/ext/alsa/gstalsamixer.c	Wed Dec 26 16:05:21 2007 -0600
@@ -154,6 +154,16 @@ gst_alsa_mixer_find_master_mixer (GstAls
     element = snd_mixer_elem_next (element);
   }

+  /*  If not, check if we have a playback mixer labelled as 'PCM' */
+  element = snd_mixer_first_elem (handle);
+  for (i = 0; i < count; i++) {
+    if (snd_mixer_selem_has_playback_volume (element) &&
+        strcmp (snd_mixer_selem_get_name (element), "PCM") == 0) {
+      return element;
+    }
+    element = snd_mixer_elem_next (element);
+  }
+
   /* If not, check if we have a playback mixer with both volume and switch */
   element = snd_mixer_first_elem (handle);
   for (i = 0; i < count; i++) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcm_master_fix
Type: application/octet-stream
Size: 1474 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20071226/3c7ba58e/attachment.obj>


More information about the gstreamer-devel mailing list