You are not logged in.

#1 2014-07-30 20:41:35

MagmaCode
Member
Registered: 2014-01-18
Posts: 18

Alsamixer and xfce4-mixer dont match.

Basically, my problem is that when opening the alsamixer (from the terminal) and xfce4-mixer the Master channel percentages dont match up.
It goes something like this:

Alsamixer  ---  Xfce4-mixer
0% --- 0%
5% --- 16
10% --- 37%
19% --- 55%
31% --- 68%
50% --- 81%
60% --- 86%
85% --- 95%
100% --- 100%


Is there a way to make these match up?

Offline

#2 2014-07-30 20:49:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Alsamixer and xfce4-mixer dont match.

I don't know about Xfce4-mixer, but if alsamixer and amixer don't match, try running 'amixer -M'.

Offline

#3 2014-07-30 20:53:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: Alsamixer and xfce4-mixer dont match.

This is an issue with alsamixer - there is a ridiculous rounding error in the percentage it displays.  The adjustments are in whole number decibels where the max is 0 and the minimum is (usually?) -74.  Due to using simple integer arithmetic it shows all the very low volume increments to be a single percent change while at higher volumes the same amount of change shows up as a 4-5% increment.

In short - don't trust alsamixers 'percent'.

EDIT: checking the math, even a lot of compounded rounding errors shouldn't account for it's behavior - so my explanation may be wrong, but the fact remains that alsamixers "percents" are totally bogus.

EDIT 2: reading amixer's man page just made me feel a bit foolish when I saw that the "-M" flag does.  So it is not rounding error or bad math.  It is intentional ... but it's still totally bogus if you ask me! wink

Last edited by Trilby (2014-07-30 20:57:17)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2014-07-30 21:02:44

MagmaCode
Member
Registered: 2014-01-18
Posts: 18

Re: Alsamixer and xfce4-mixer dont match.

amixer output :

Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 127
  Mono: Playback 106 [55%] [-15.75dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 127 [100%] [0.00dB] [on]
  Front Right: Playback 127 [100%] [0.00dB] [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 127 [100%] [0.00dB] [on]
  Front Right: Playback 127 [100%] [0.00dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 23 [56%] [0.00dB] [on]
  Front Right: Playback 22 [51%] [-1.50dB] [on]
Simple mixer control 'Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 1 [22%] [10.00dB]
  Front Right: 1 [22%] [10.00dB]
Simple mixer control 'Beep',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 3
  Mono: Playback 3 [100%] [0.00dB] [off]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 15
  Front Left: Capture 11 [73%] [16.50dB] [on]
  Front Right: Capture 11 [73%] [16.50dB] [on]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Enabled'
Simple mixer control 'Digital',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 120
  Front Left: Capture 0 [0%] [-30.00dB]
  Front Right: Capture 0 [0%] [-30.00dB]
Simple mixer control 'Internal Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 3 [100%] [30.00dB]
  Front Right: 3 [100%] [30.00dB]
Simple mixer control 'Loopback Mixing',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Enabled'

Amixer -M shows alsamixer percentages.

Last edited by MagmaCode (2014-07-30 21:05:39)

Offline

#5 2014-07-30 22:22:16

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Alsamixer and xfce4-mixer dont match.

Trilby wrote:

The adjustments are in whole number decibels where the max is 0 and the minimum is (usually?) -74.

It depends on the hardware and type of channels. Playback usually goes to gain=1 (0 dB). Capture usually has some gain, especially microphones.

One my cards has playback going up to 1 dB, at least that is shown, I would have to check datasheet foe the codec/controller to make sure, but if I recall correctly that is one of the features that was also available under Windows. And the lowest volume goes down to -119 dB with an additional mute switch, which should make it below -120 dB. One of the other cards has a gain up to 30 dB for a microphone. So it differs from sound card to sound card.

man amixer wrote:

-M     Use the mapped volume for evaluating the percentage representation like alsamixer, to  be  more  natural  for human ear.

I agree, this is bogus. What the hell does "more natural" mean? "Feel good volume"?

Edit: I only skimmed through alsa-utils, there is a get_normalized_volume function in volume_mapping.c, which seems to be used to read playback and capture levels, I might be wrong though. However it is calculated in a particular way, I do not understand where 6000 comes from. Probably just a big number.

Edit2: @karol did not see your post there.

Last edited by emeres (2014-07-30 22:41:35)

Offline

#6 2014-07-30 22:31:54

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Alsamixer and xfce4-mixer dont match.

https://bbs.archlinux.org/viewtopic.php?id=135348

Last edited by karol (2014-07-30 22:32:15)

Offline

Board footer

Powered by FluxBB