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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Jerone Young-2
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 <[hidden email]>

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++) {

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

pcm_master_fix (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [BUGFIX] Add PCM as master fall back for cards that do not have 'Master' mixer

Jerone Young-2
Is there any feedback on this patch?  Can it be included in the
gstreamer source so this issue is resolved.

On Dec 26, 2007 4:24 PM, Jerone Young <[hidden email]> wrote:

> 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 <[hidden email]>
>
> 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++) {
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [BUGFIX] Add PCM as master fall back for cards that do not have 'Master' mixer

René Stadler
In reply to this post by Jerone Young-2
Jerone Young schrieb:

> 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
>

The (upstream) bugzilla of GStreamer is the one of GNOME; you should
file the issue there:

   http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer

>
> Signed-off-by: Jerone Young <[hidden email]>
>
[...]

--
Regards,
   René Stadler

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [BUGFIX] Add PCM as master fall back for cards that do not have 'Master' mixer

Jerone Young-2
I have filed a bugzilla with the fix:

http://bugzilla.gnome.org/show_bug.cgi?id=506928

On Jan 2, 2008 1:59 PM, René Stadler <[hidden email]> wrote:

> Jerone Young schrieb:
> > 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
> >
>
> The (upstream) bugzilla of GStreamer is the one of GNOME; you should
> file the issue there:
>
>    http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer
>
> >
> > Signed-off-by: Jerone Young <[hidden email]>
> >
> [...]
>
> --
> Regards,
>    René Stadler
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel