Alsamixer automute does not work

the automute of alsamixer does not work, I know that many users prefer to have it disabled, so I thought that manjaro may have disabled it by removing the package that handles this, but since I have a laptop I am interested in saving the battery as much as possible.

How do I know it doesn’t work?
I have debian 10 installed on 2 other machines and I hear the small click of the automute in headphones, after leaving the audio inactive for about 4 seconds.

Instead, in manjaro the soft shhhhh is heard permanently and the click of automute is never heard.

I have automute activated by default, so I don’t know if I think something is wrong, or manjaro decided that this is so

I think the problem is in pulseaudio or alsamixer.

any ideas?

Auto-Mute Mode should mute speakers without a delay When headphones are plugged in

From your description it sounds more like this PulseAudio module:

module-suspend-on-idle
Disconnects sinks and sources from their backend after a predetermined amount of idle time

But if pavucontrol or other Pulseaudio Controls are left open (or even minimised) PulseAudio does not suspend the sinks and sources

You may only need to close audio controls to be able to hear the sink output suspend

If you want to check suspend states in PulseAudio look in

pacmd dump

or

pacmd list-sinks
1 Like

this is the output of pacmd dump

### Configuration dump generated at Wed Feb 10 19:16:52 2021

load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
load-module module-augment-properties
load-module module-switch-on-port-available
load-module module-udev-detect
load-module module-alsa-card device_id="0" name="pci-0000_00_03.0" card_name="alsa_card.pci-0000_00_03.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
load-module module-alsa-card device_id="1" name="pci-0000_00_1b.0" card_name="alsa_card.pci-0000_00_1b.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
load-module module-jackdbus-detect channels=2
load-module module-bluetooth-policy
load-module module-bluetooth-discover
load-module module-bluez5-discover
load-module module-dbus-protocol
load-module module-native-protocol-unix
load-module module-gsettings
load-module module-default-device-restore
load-module module-always-sink
load-module module-intended-roles
load-module module-suspend-on-idle
load-module module-console-kit
load-module module-systemd-login
load-module module-position-event-sounds
load-module module-role-cork
load-module module-filter-heuristics
load-module module-filter-apply
load-module module-x11-publish display=:0.0 xauthority=/home/jhonatan/.Xauthority
load-module module-x11-xsmp display=:0.0 xauthority=/home/jhonatan/.Xauthority session_manager=local/corporacion-latitudee5540:@/tmp/.ICE-unix/1105,unix/corporacion-latitudee5540:/tmp/.ICE-unix/1105
load-module module-cli-protocol-unix

set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo 0x4ccb
set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo no
suspend-sink alsa_output.pci-0000_00_1b.0.analog-stereo yes

set-source-volume alsa_output.pci-0000_00_1b.0.analog-stereo.monitor 0x10000
set-source-mute alsa_output.pci-0000_00_1b.0.analog-stereo.monitor no
suspend-source alsa_output.pci-0000_00_1b.0.analog-stereo.monitor yes

set-card-profile alsa_card.pci-0000_00_03.0 off
set-card-profile alsa_card.pci-0000_00_1b.0 output:analog-stereo

set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo
set-default-source alsa_output.pci-0000_00_1b.0.analog-stereo.monitor

### EOF

this is the output of pacmd list-sinks
1 sink(s) available.
* index: 0
name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9039
volume: front-left: 19659 / 30% / -31,38 dB, front-right: 19659 / 30% / -31,38 dB
balance 0,00
base volume: 65536 / 100% / 0,00 dB
volume steps: 65537
muted: no
current latency: 0,00 ms
max request: 0 KiB
max rewind: 0 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Estéreo
used by: 0
linked by: 0
configured latency: 0,00 ms; range is 0,50 … 2000,00 ms
card: 1 <alsa_card.pci-0000_00_1b.0>
module: 7
properties:
alsa.resolution_bits = “16”
device.api = “alsa”
device.class = “sound”
alsa.class = “generic”
alsa.subclass = “generic-mix”
alsa.name = “ALC3226 Analog”
alsa.id = “ALC3226 Analog”
alsa.subdevice = “0”
alsa.subdevice_name = “subdevice #0
alsa.device = “0”
alsa.card = “1”
alsa.card_name = “HDA Intel PCH”
alsa.long_card_name = “HDA Intel PCH at 0xf7430000 irq 52”
alsa.driver_name = “snd_hda_intel”
device.bus_path = “pci-0000:00:1b.0”
sysfs.path = “/devices/pci0000:00/0000:00:1b.0/sound/card1”
device.bus = “pci”
device.vendor.id = “8086”
device.vendor.name = “Intel Corporation”
device.product.id = “9c20”
device.product.name = “8 Series HD Audio Controller”
device.form_factor = “internal”
device.string = “front:1”
device.buffering.buffer_size = “352800”
device.buffering.fragment_size = “176400”
device.access_mode = “mmap+timer”
device.profile.name = “analog-stereo”
device.profile.description = “Estéreo analógico”
device.description = “Audio Interno Estéreo analógico”
module-udev-detect.discovered = “1”
device.icon_name = “audio-card-pci”
ports:
analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: no)
properties:

		analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "audio-speakers"
		analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-headphones"
	active port: <analog-output-speaker>

I actually have no idea what I would have to observe in these outings, sorry for the ignorance.

As extra data, I just tried the live USB of manjaro and debian they had the same results, it could be said that we ruled out a hardware problem, I still have the doubt if this is normal in archlinux or manjaro, since in debian everything seems go as expected.

I also know the:
/etc/pulse/
load-module module-suspend-on-idle

but don’t change anything here either, you could say that my system is with default settings, unless the nvidia driver has something to do with this but I doubt it a lot.

1st response shows module is loaded and analog output sink is supended

load-module module-suspend-on-idle

suspend-sink alsa_output.pci-0000_00_1b.0.analog-stereo yes`

2nd response shows the sink in more detail
(the asterisk * indicates this is the default sink for audio)

* index: 0
name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
 
state: SUSPENDED
suspend cause: IDLE

alsa.name = “ALC3226 Analog”
alsa.card_name = “HDA Intel PCH”device.description = “Audio Interno Estéreo analógico”

		analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "audio-speakers"

	active port: <analog-output-speaker>

unless the nvidia driver has something to do with this but I doubt it a lot

The HDMI audio device is not active in PulseAudio

set-card-profile alsa_card.pci-0000_00_03.0 off
1 Like

Ok, what I understand is that apparently everything is in order.
I still have the mystery of why it does not seem to suspend, that is to say that the constant shhhhh is heard and never the usual click in debian for example.

Today I was testing the live ISO of MX linux, linux mint, solus and the result is the following and I am going to represent with a “shhhhh” those that apparently do not perform the auto mute, click those that totally cut the power of the headphones as they do that “click” sound

MXlinux = shhhhh (permanent)
linux Mint = click (power cut and total silence)
Solus = shhhhh (permanent)

seems to be that this is common, and although linux mint seems to cut the power completely, perhaps in the future it will behave like manjaro and other distributions that still produce the permanent shhhhh.

I think we can end the trip.

1 Like

you could try suspending the PulseAudio sink with this command

pacmd suspend-sink alsa_output.pci-0000_00_1b.0.analog-stereo 1

changing the 1 at the end to 0 will de-suspend the sink

Or this to suspend everything

pacmd suspend 1

I have executed them, but I do not see changes.
I also tried to restart the computer after launching the commands, also without changes.

but I think they will be useful to anyone who wants to create an auto executable during the startup of the graphical interface (login)

If the hiss noise is constant and not affected by suspending PulseAudio then the noise would be due to something else

Your sink volume in PulseAudio is set to 30%
It might be possible to reduce the noise by lowering the audio level in ALSA and increasing audio level in PulseAudio
you can check ALSA audio settings for the onboard audio with

alsamixer -c1

or

amixer -c1

I put here the output of: amixer -c1, I have lowered the gain and the levels of all the parameters inside alsamixer and even so I do not obtain total silence.
when I press the multimedia mute key on my keyboard the expected “click” is heard followed by total silenceCaptura de pantalla_2021-02-13_00-53-07 perhaps this “shhhhhh” will become standard in the future of linux, I don’t know, since I have many doubts that in other distributions the absolute silence of automute works well and others do not.


Simple mixer control ‘Master’,0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 0 [0%] [-65.25dB] [on]
Simple mixer control ‘Headphone’,0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 0 [0%] [-65.25dB] [on]
Front Right: Playback 0 [0%] [-65.25dB] [on]
Simple mixer control ‘Speaker’,0
Capabilities: pswitch
Playback channels: Front Left - Front Right
Mono:
Front Left: Playback [off]
Front Right: Playback [off]
Simple mixer control ‘Speaker+LO’,0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 0 [0%] [-65.25dB]
Front Right: Playback 0 [0%] [-65.25dB]
Simple mixer control ‘PCM’,0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 0 [0%] [-51.00dB]
Front Right: Playback 0 [0%] [-51.00dB]
Simple mixer control ‘Line Out’,0
Capabilities: pswitch
Playback channels: Front Left - Front Right
Mono:
Front Left: Playback [on]
Front Right: Playback [on]
Simple mixer control ‘Beep’,0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 0 [0%] [-34.50dB] [off]
Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control ‘Capture’,0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 63
Front Left: Capture 47 [75%] [18.00dB] [off]
Front Right: Capture 47 [75%] [18.00dB] [off]
Simple mixer control ‘Auto-Mute Mode’,0
Capabilities: enum
Items: ‘Disabled’ ‘Speaker Only’ ‘Line Out+Speaker’
Item0: ‘Line Out+Speaker’
Simple mixer control ‘Dock Mic’,0
Capabilities: pvolume pswitch cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Playback channels: Front Left - Front Right
Capture channels: Mono
Limits: Playback 0 - 31
Mono: Capture [off]
Front Left: Playback 0 [0%] [-34.50dB] [off]
Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control ‘Dock Mic Boost’,0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 0 [0%] [0.00dB]
Front Right: 0 [0%] [0.00dB]
Simple mixer control ‘Headset Mic’,0
Capabilities: pvolume pswitch cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Playback channels: Front Left - Front Right
Capture channels: Mono
Limits: Playback 0 - 31
Mono: Capture [on]
Front Left: Playback 0 [0%] [-34.50dB] [off]
Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control ‘Headset Mic Boost’,0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 0 [0%] [0.00dB]
Front Right: 0 [0%] [0.00dB]
Simple mixer control ‘Internal Mic’,0
Capabilities: cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Capture channels: Mono
Mono: Capture [off]
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: 0 [0%] [0.00dB]
Front Right: 0 [0%] [0.00dB]
Simple mixer control ‘Loopback Mixing’,0
Capabilities: enum
Items: ‘Disabled’ ‘Enabled’
Item0: ‘Disabled’

I have found this promising thread, it is the only one that seems to fit my situation.
but I don’t know in which directory I have to create the script.

commands to mute and unmute a pulseaudio sink can be derived from pacmd dump
similar to the suspend commands

this should mute the sink

pactl set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo 1

and this to unmute

pactl set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo 0

It works perfectly :grin: but now my question is, is there any way to automate the mute when no program uses the audio and unmute when the programs make use of the sound signal?

I have tried to start the script and the service published in Reddit but without success, it seems to me a good idea to monitor the changes inside /proc/asound/card1/pcm0p/sub0/status to automate the silence in pulseaudio.

on the other hand I am trying to create my own script, which I cannot with what someone else built I hope that my own construction of positive results or that at least it helps me to better understand what the other person did.

for those who doubt the operation of:
/etc/pulse/default.pa
load-module module-suspend-on-idle
I want to confirm that it works correctly for some reason the sound card does not obey the total power cut.

to check the correct operation of:
load-module module-suspend-on-idle
just run:
watch pacmd list-sinks
to go out:
ctrl+c
the line to observe is this:
state: RUNNING
suspend cause: (none)
after 5 seconds without using audio it should change to this:
state: SUSPENDED
suspend cause: IDLE

Okay guys, I have something good on my hands.
It might not be very fancy what I got but it works.
The method that is right here is dedicated to nobato users, it does not require installing anything extra, or root permissions.

This should work for any distribution or graphical environment (xfce, KDE, Gnome, etc)

and in order not to scare you, it is summed up like this.
-create two files
-paste inside them the scripts that I leave you here below
-perform a small test before doing it automatic
-Make it auto start when you turn on the computer (this varies according to your desktop, xfce, KDE, Gnome, etc)

are you ready!!
let’s get started.

first create an empty file and call it whatever you want, I chose: mute-on-idle
and paste this inside:

#!/bin/bash
state=$(pacmd list-sinks | grep -o RUNNING)

if [[ $state == *"RUNNING"* ]];then
  pactl set-sink-mute 0 0
else
  pactl set-sink-mute 0 1
fi

now we create the second file, I chose the name: call-to-mute
and paste this inside:

#!/bin/bash

OLDEST_PID=$(pgrep -o 'call-to-mute')
test $OLDEST_PID && pgrep 'call-to-mute' | grep -vw $OLDEST_PID | xargs -r kill

while [ true ]
do
    path/of/your/file/mute-on-idle
    sleep 0.5
done

It is recommended to keep them together in the same directory or folder, nothing happens if you separate them, but it will be more uncomfortable for you.

we make sure to give execution permission to both files

now we check that the files work by opening terminal from the directory where our files are and executing: ./call-to-mute or ./followed by the name they chose.
Captura de pantalla_2021-02-18_20-29-48

now play music and stop after a few seconds, the auto mute should work and with it the annoying ‘shhhhhh’

note: web browsers may take a few seconds to free the sound signal but that is normal for them, instead a regular music player or even VLC should be able to silence themselves at lightning speed.

Remember that at the beginning I said that I was worried about saving battery? I lied, it’s the bee inside my headphones that I don’t want to hear.
If up to now the result is to your liking, let’s proceed to make it executable when the equipment is turned on, this time with the graphical interface.

we go to> configuration> session and start> applications autostart, we create a new one.

I’m not sure how this is done in KDE, Gnome, etc, but I would bet the same possibility exists somewhere.

we can use the graphic search engine.
Captura de pantalla_2021-02-18_20-55-23

or manually enter the address of our call-to-mute file for example like this: /home/jhonatan/Documentos/ejecutable-comando/call-to-mute

don’t forget to activate autostart.
Captura de pantalla_2021-02-18_20-56-00_001

ready, this should work all the time, it never consumes more than 4 MB in ram, and you can kill the process in the task manager if necessary, looking for it by name.

there is another way to make it run when you turn on the computer, making use of systemctl and the .service
Those who know about the subject and want more information about this i leave you the link here:

I was just reminded of something that may help you in a simpler way
(Electrical pops from speakers with 5.10 kernel - #2 by Twifty)

Try this to generate an inaudible 1 Hz sine wave signal in PulseAudio

pacmd load-module module-sine frequency=1

The audio device will no longer suspend for the noise to happen

The module is only temporarily loaded by this command
If it works to prevent the noise when no other audio is playing, the module can be added to PulseAudio default.pa configuration so it is loaded with the other modules

it’s good to have more options, thank you very much.

hi again everyone, I think I got addicted to this scripts XD, they are wonderful, I recommend learning them.

Here is a small but functional option to fight with speaker POP, I have been testing debian thoroughly and preparing my music lists (another project) and I realized that the speakers (amplification) makes a pop, so I remembered this post and said, let’s work.

this script should be able to give a quick and easy solution.
-does not require root permissions.
-The changes do not affect the original state of the system at all.
-this script should not be started when turning on the equipment as was done in previous explanations to this one (above)
-this is a script designed to be activated manually with a shortcut, or launcher only when you need it (a party for example)

#!/bin/bash

state=$(pacmd list-modules | grep module-sine | wc -l)

if (($state > 0)) ; then

pacmd unload-module module-sine
notify-send "POP"

else

pacmd load-module module-sine frequency=1
notify-send "free POP"

fi

what it does is act as a switch with this signal.
avoiding losing suspension as soon as we turn off the signal.

simple.

How do you know if it is working?
very easy.
we open the graphic configuration of pulseaudio
we go to output devices.
there we should be able to observe the signal Hz=1 in its on and off state.

Captura de pantalla_2021-03-07_16-30-15_001

or if you prefer to run:
pacmd list-modules | grep module-sine
if the module is working the output should be:
name: <module-sine>
and if it is not working, the output should be empty.