2

It could be that I am misinterpreting my results, but it seems to me that I am having inconsistencies. I would appreciate a review with commentary.

As root user

amixer scontrols
Simple mixer control 'PCM',0

Observing the following on my Raspberry Pi 3 running Arch Linux ARM:

Using first syntax:

amixer sset 'PCM' 50%

output

Simple mixer control 'PCM',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback -10239 - 400
  Mono: Playback -4919 [50%] [-49.19dB] [on]

Yet look at alsamixer

enter image description here

And running other (-- level) syntax

amixer set PCM -- 100%

output

Simple mixer control 'PCM',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback -10239 - 400
  Mono: Playback 400 [100%] [4.00dB] [on]

and yields this in alsamixer:

enter image description here

As user in /home

Suddenly PCM is not available, just Master.

amixer scontrols
Simple mixer control 'Master',0
Simple mixer control 'Capture',0

Using first syntax which works (unlike with PCM):

amixer sset 'Master' 50%

output:

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 32768 [50%] [on]
  Front Right: Playback 32768 [50%] [on]

alsamixer output

enter image description here

And again using other (-- level) syntax which works:

amixer set Master -- 100%

output:

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 65536 [100%] [on]
  Front Right: Playback 65536 [100%] [on]

And for completeness, here is the output of alsamixer:

enter image description here


Notes

1

"root" v. "non-root" name & range of control is due to PulseAudio. Some cards have like three different controls that mean nothing to humans, Pulse gives you the one control (for each output you can select in Pulse) and tries to optimize which ones it uses for sound quality. Simplest if you can stick to non-root, Pulseaudio for everything.

I don't know why the alsamixer bar in the first scenario is not reflecting the % out of the range -10239 - 400 as expected.

  • Controls are often quantized. An immediate amixer sget 'PCM' etc. will also show what value it is quantized to. – dirkt May 14 '17 at 18:01
  • 1
    @dirkt but, the dB value shown is the same between the amixer sset output and the alsamixer display, it is only the graphical indicator which does not appear to match. – sourcejedi May 14 '17 at 18:10
  • @sourcejedi It would seem that the ALSA mixer graphical indicator does not support negative values i.e. it always begins with 0. – Jonathan Komar May 16 '17 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.