[alsa-devel] amixer shows capability "penum" on every Simple mixer control

Takashi Iwai tiwai at suse.de
Wed Mar 14 14:43:12 CET 2012


At Wed, 14 Mar 2012 20:35:33 +0800,
Raymond Yau wrote:
> 
> 2012/3/13, Takashi Iwai <tiwai at suse.de>:
> > At Tue, 13 Mar 2012 10:52:21 +0100,
> > Takashi Iwai wrote:
> >>
> >> At Mon, 12 Mar 2012 22:09:35 +0100,
> >> Christian Esken (KDE) wrote:
> >> >
> >> >  Hello,
> >> >
> >> >  when I run amixer it shows the capability "penum" on nearly every
> >> >  Simple mixer control.
> >> >  I posted the bug report
> >> >  https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5496 , but
> >> >  Raymond asked me to report it on this mailing list ("as it is related
> >> > to
> >> >  this patch 6d511eefa05878abee9f8b9145697230de605200 Implements support
> >> >  for capture/playback enums.").
> >> >
> >> >  I posted  details for the following two examples in
> >> >  https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5496 :
> >> >
> >> >  1) "Creative X-Fi" does not have any Enum's. alsamixer does not show
> >> >  Enums's. amixer lists "penum" for ALL Simple mixer controls.
> >> >
> >> >  2) "HDA ATI SB" has no penum's, only 3 cenum's. alsamixer shows it
> >> >  correctly, but amixer disagrees and shows penum for NEARLY ALL Simple
> >> >  mixer controls (except for those with cpability "cenum").
> >> >
> >> >
> >> >  I found this as I received several bug reports for KMix with "absurd"
> >> >  amixer output. I could perceive from those bug report that the bug is
> >> >  affecting a lot (or all?) sound cards.
> >>
> >> Looks like a bug in alsa mixer abstraction, indeed.
> >> Will take a look at it later.
> >
> > I committed the fix to git tree now.  The fix patch is below.
> >
> >
> > Takashi
> >
> > ---
> > From: Takashi Iwai <tiwai at suse.de>
> > Subject: [PATCH] mixer: Remove redundant CHECK_ENUM() from
> > snd_mixer_selem_is_enum*()
> >
> > The functions to check whether the element is an enum don't need the
> > extra check of the type.  It should return simply 0 or 1 without error.
> >
> > Signed-off-by: Takashi Iwai <tiwai at suse.de>
> > ---
> >  src/mixer/simple.c |    2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/src/mixer/simple.c b/src/mixer/simple.c
> > index 8079fe7..ec22a9c 100644
> > --- a/src/mixer/simple.c
> > +++ b/src/mixer/simple.c
> > @@ -889,7 +889,6 @@ int snd_mixer_selem_is_enumerated(snd_mixer_elem_t
> > *elem)
> >  int snd_mixer_selem_is_enum_playback(snd_mixer_elem_t *elem)
> >  {
> >  	CHECK_BASIC(elem);
> > -	CHECK_ENUM(elem);
> >  	return sm_selem_ops(elem)->is(elem, SM_PLAY, SM_OPS_IS_ENUMERATED, 1);
> >  }
> >
> > @@ -901,7 +900,6 @@ int snd_mixer_selem_is_enum_playback(snd_mixer_elem_t
> > *elem)
> >  int snd_mixer_selem_is_enum_capture(snd_mixer_elem_t *elem)
> >  {
> >  	CHECK_BASIC(elem);
> > -	CHECK_ENUM(elem);
> >  	return sm_selem_ops(elem)->is(elem, SM_CAPT, SM_OPS_IS_ENUMERATED, 1);
> >  }
> >
> > --
> > 1.7.9.2
> >
> 
> The patch changed some penum to enum
> 
> (e.g. "Independent HP"  or "Channel Mode" )
> 
> 
> Simple mixer control 'Independent HP',0
>   Capabilities: enum
>   Items: 'OFF' 'ON'
>   Item0: 'ON'
> 

Yes, and it's the right fix.  The enum is not specific to playback,
at least, judging from the name string.


Takashi


More information about the Alsa-devel mailing list