[alsa-devel] Bug in alsa-lib or alsamixer and amixer

Raymond Yau superquad.vortex2 at gmail.com
Wed Jun 16 02:41:12 CEST 2010


2010/6/16 Colin Guthrie <gmane at colin.guthr.ie>

> 'Twas brillig, and Raymond Yau at 15/06/10 23:29 did gyre and gimble:
> > 2010/6/16 Colin Guthrie <gmane at colin.guthr.ie>
> >
> >> 'Twas brillig, and Raymond Yau at 15/06/10 00:43 did gyre and gimble:
> >>> +12dB(400%) is even larger than the software gain 150% of PA
> >>
> >> Software gain of PA 150% = ~+11dB, so not as different as you imply.
> >>
> >> I've explained the cubic mapping already, so please don't use arbitrary,
> >> differently calculated percentages when comparing things. It's like
> >> comparing apples to oranges.
> >>
> >> Col
> >>
> >>
> > When I changed the volume slider of the gnome sound applet ( select
> > perference ) in Fedora 13 to maximum (i.e. PA 150% )
> >
> > Seem to be bug in amixer and alsamixer
> >
> > alsamixer also change to 150% but press any key change back to 100%
>
> The fact that any key changes it back to 100% is kinda expected. It's
> not designed to handle values >100% so it makes sense that it clamps it.
> Annoying, but it makes sense.
>

The bug is alsa-lib allow alsa-pulse plugin to set the value 98304 which is
outside 0 - 65536.





>
> > The volume range is only from 0 to  65536
> >
> > why did alsa-lib allow alsa-pulse plugin to set it outside the range ,
> > alsamixer and amixer also display 150% ?
> >
> > amixer -D pulse
> > Simple mixer control 'Master',0
> >   Capabilities: pvolume pswitch pswitch-joined
> >   Playback channels: Front Left - Front Right
> >   Limits: Playback 0 - 65536
> >   Mono:
> >   Front Left: Playback 98304 [150%] [on]
> >   Front Right: Playback 98304 [150%] [on]
>
>
> While I agree this could be thought of as a bug, it's actually the
> nicest possible display for a system that has no concept of volumes > 100%.
>

it is not related to 100% ,

the mixer application use snd_mixer_selem_get_playback_volume_range() to get
min and max to calculate the number of possible step in creating the slider
since the mixer application can only set the volume between min and max by
snd_mixer_selem_set_playback_volume()

The percentage is calculated by dividing the value by (max - min)

Please study ALSA 's simpler api interface

http://www.alsa-project.org/alsa-doc/alsa-lib/group___simple_mixer.html


So this is a bug in alsa-lib which mislead the PA developers


More information about the Alsa-devel mailing list