You are not logged in.
Hey all,
I just found out that amixer reports a different volume value than alsamixer does. What is the cause of this and is this default behaviour?
Here's amixer's output:
┌─[jente@lappy ~][18:31:19]
└─■ amixer get Master
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
Playback channels: Mono
Limits: Playback 0 - 64
Mono: Playback 48 [75%] [-16.00dB] [on]
And alsamixer says 50.
Last edited by Unia (2012-02-08 19:51:42)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Offline
Yes I noticed that, but it doesn't explain why it's different. (I created a new post because the one you linked me to is old)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
It indeed doesn't. But how exactly do you think we can know why? Digging into the code, that's the only way. There must be an error somewhere in the alsamixer code.
Offline
I just thought there might be an explanation. Anyway, I'll mark this solved. Thanks!
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Hopefully I'm not too late to the party here, but I just discovered this discrepancy myself and was trying to find out why this is the case. This thread was one of the top results in my search, but offered no reason as to why this discrepancy exists. Upon further searching, I found the reason explained on another forum (http://www.mentby.com/Group/alsa-list/a … ongly.html). Edit: This quote probably originated here from the alsa-devel mailing list. http://mailman.alsa-project.org/piperma … 50146.html
No, both are correct. You are dreaming too much on the world unified
percentage representationThe percentage in amixer has nothing to do with dB level.
It's just the percentage of the raw value range of that mixer
element. Thus showing 89% is correct. It's 10% down from 100%
(1% is because of the resolution of the raw values).Now, alsamixer shows the percentage in a different way. It's
explained well in the source code (alsamixer/volume_mapping.c), but
not mentioned in the man page, unfortunately.* The mapping is designed so that the position in the interval is proportional
* to the volume as a human ear would perceive it (i.e., the position is the
* cubic root of the linear sample multiplication factor). For controls with
* a small range (24 dB or less), the mapping is linear in the dB values so
* that each step has the same size visually. Only for controls without dB
* information, a linear mapping of the hardware volume register values is used
* (this is the same algorithm as used in the old alsamixer).The percentage representation in alsamixer corresponds to this
mapping, thus it's neither dB nor linear percent.
Hopefully this helps clear up why there is a difference for some other people, too!
Last edited by gogi-goji (2012-06-11 05:42:52)
Offline
Looking at the amixer man page, the mapping mentioned earlier can be invoked in amixer with the -M flag. So using amixer -M [...] works in the units that you see in alsamixer. These are "more natural for human ear".
For example, to get the master in the alsamixer units, use
amixer -M get Master
The command works similarly with
amixer -M set Master 5%+
to raise the volume by 5% in the alsamixer units, for example.
Offline