You are not logged in.

#1 2022-06-05 02:48:26

zw
Member
Registered: 2022-05-31
Posts: 19

`amixer -c 1 set Master toggle` mutes sound but doesn't unmute

In my Openbox rc, I have set the mute button on my keyboard to run the command amixer -c 1 set Master toggle. If audio is playing, then running this command in a terminal mutes it as desired. However, it doesn't unmute it.

To identify the problem, I tried the following diff:

amixer -c 1 scontents > before.txt
amixer -c 1 set Master toggle
amixer -c 1 set Master toggle
amixer -c 1 scontents > after.txt
diff before.txt after.txt

Which results in:

18,19c18,19
<   Front Left: Playback 115 [91%] [0.00dB] [on]
<   Front Right: Playback 115 [91%] [0.00dB] [on]
---
>   Front Left: Playback 115 [91%] [0.00dB] [off]
>   Front Right: Playback 115 [91%] [0.00dB] [off]
25,26c25,26
<   Front Left: Playback 115 [91%] [0.00dB] [on]
<   Front Right: Playback 115 [91%] [0.00dB] [on]
---
>   Front Left: Playback 115 [91%] [0.00dB] [off]
>   Front Right: Playback 115 [91%] [0.00dB] [off]

It seems that when audio is playing, toggling mute sets both the mono and stereo channels to off, but when the audio is already muted, toggling only re-enables the mono channels.

Questions:

  • Is this a bug?

  • How can I produce the desired muting behavior?

  • The mute toggle in the pavucontrol-qt GUI works perfectly fine. How can I figure out what command it is using?

Edit: I thought that maybe the solution would be to use something other than Master as the argument as suggested here, but I don't see anything useful in the controls listed in amixer -c 1 scontrols:

Simple mixer control 'Master',0
Simple mixer control 'Headphone',0
Simple mixer control 'Speaker',0
Simple mixer control 'Bass Speaker',0
Simple mixer control 'PCM',0
Simple mixer control 'Mic Boost',0
Simple mixer control 'IEC958',0
Simple mixer control 'IEC958 Default PCM',0
Simple mixer control 'IEC958',1
Simple mixer control 'IEC958',2
Simple mixer control 'IEC958',16
Simple mixer control 'Capture',0
Simple mixer control 'Auto-Mute Mode',0

Last edited by zw (2022-06-05 02:54:11)

Offline

#2 2022-06-05 03:25:03

zw
Member
Registered: 2022-05-31
Posts: 19

Re: `amixer -c 1 set Master toggle` mutes sound but doesn't unmute

By running alsamixer in a terminal and watching how its settings change when I use the mute function from pavucontrol-qt, I was able to determine that the controls that fail to get unmuted are the 'Speaker' and 'Bass Speaker'. Therefore, the following workaround produces a functional command-line toggle:

amixer set 'Speaker' unmute; amixer set 'Bass Speaker' unmute; amixer set 'Master' toggle

It has to be these three commands and in this order: notice how the first two are unmutes and only the last one is a toggle.

I still would like to know if there is a way I can monitor pavucontrol-qt to see what command it uses, and if there is a more elegant solution.

Offline

#3 2022-06-05 05:48:16

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

Re: `amixer -c 1 set Master toggle` mutes sound but doesn't unmute

The mute toggle in the pavucontrol-qt GUI works perfectly fine.

I'd say PA responds to the Master deactivation by muting the speakers.

Solutions:
a) don't use pulseaudio…
b) https://man.archlinux.org/man/extra/lib … _sink_mute

Offline

Board footer

Powered by FluxBB