You are not logged in.

#1 2022-06-12 18:43:06

eru_lawliet
Member
Registered: 2022-06-03
Posts: 4

[SOLVED]Incorrect increments and decrements when controling volume

I am having some problems with amixer (included in alsa-utils, installed using pacman): when I try to set volume 5% larger using this command

amixer set Master 5%+

The percentage of audio is almost never added by 5%. So to demonstrate what I mean, here is once example.

❯ amixer set Master 5%+
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 64
  Mono: Playback 3 [5%] [-61.00dB] [on]

And the next time I ran it:

❯ amixer set Master 5%+
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 64
  Mono: Playback 6 [9%] [-58.00dB] [on]

So the master volume is increased by 4%, not 5% as intended, same thing happened when I tried to decrease the volume.

But worse, the volume amixer display is different from alsamixer ??

Link to my screenshot to understand what I mean: https://imgur.com/a/EAcBC1O

The point it, every time the number added to volume will be arbitrary, sometimes 3, 4, 5, 7, 9, 10, 11, etc ...

To provide a bit more context to my situation, I recently install arch linux and at first I controlled my volume using pulseaudio.
After a while I decided that I need some kind of visual volume notification, I followed this guide to use volnoti : https://wiki.archlinux.org/title/Volnoti
So I install  alsa-utils and xbindkeys (because I was following the guide).
Then pulseaudio started to have some kind of weird error, like when I tried to add 10% to volume :

❯ pactl -- set-sink-volume 0 +10%
Connection failure: Connection refused
pa_context_connect() failed: Connection refused

So can anyone tell me how to increase the volume by exactly 5% using amixer ?

NOTE: I am not a native speaker and this is my first post so forgive me if there is some awkwardness in my use of English.

UPDATE: And after that some how there is no audio ... (I mean amixer and alsamixer still say that master volume is not muted, but I am not hearing anything, even though it worked fine before)

Last edited by eru_lawliet (2022-06-12 20:13:40)

Offline

#2 2022-06-12 19:11:38

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,573

Re: [SOLVED]Incorrect increments and decrements when controling volume

Limits: Playback 0 - 64

20 isn't a divisor of 64 (I learned that in elementary school tongue )

6.25% or possibly 4.6875% should™ result in consistent in/decrements (steps of 4 or 3)

Offline

#3 2022-06-12 19:45:22

eru_lawliet
Member
Registered: 2022-06-03
Posts: 4

Re: [SOLVED]Incorrect increments and decrements when controling volume

seth wrote:

Limits: Playback 0 - 64

20 isn't a divisor of 64 (I learned that in elementary school tongue )

6.25% or possibly 4.6875% should™ result in consistent in/decrements (steps of 4 or 3)

So what do you suggest I should change ?? I quite new to linux in general so I don't really understand where did that 20 come from and what does

Limits: Playback 0 - 64

mean.

Last edited by eru_lawliet (2022-06-12 19:57:24)

Offline

#4 2022-06-12 20:06:45

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,573

Re: [SOLVED]Incorrect increments and decrements when controling volume

The volume can be set to 0,1,2,3,…64
5% is 1/20 and because of the above and the way math works you'll have to pick a different increment that is 100/(64/3) or 100/(64/4)

(Not sure whether you could impact the limits through some driver parameter, but they default to 0-100 to me, so I can set and integer percent just fine)

Offline

#5 2022-06-12 20:12:58

eru_lawliet
Member
Registered: 2022-06-03
Posts: 4

Re: [SOLVED]Incorrect increments and decrements when controling volume

Thank you for the knowledge !!!

Offline

Board footer

Powered by FluxBB