The audio recording levels can be saved for Ubuntu / Debian users using a command from the package alsa-mixer,

alsactl --file ~/filename store

However I am looking for alternative ways to save and restore those levels, using perhaps aumix, pavucontrol or any other means to store the audio configuration in ways that can be restored later.


First, you have to keep in mind that there are several sets of controls:

1) The actual hardware controls in the Codec (audio chip)
2) The ALSA controls, that cover most (but often not all) hardware controls
3) The Pulseaudio controls, which are mostly software, though a few per-sink/per-source controls access the ALSA controls.

(1) depend on the hardware, but for Intel HDA, you can find them among other things in /proc/asound/card*/codec\#*. Not trivial to restore, though.

(2) is what you probably want. Besides alsactl, you can use amixer to access them (and alsamixer for a UI), e.g. amixer -D hw:0 contents for your first card (cat /proc/asound/pcm for a list). See man amixer on how to set them; you can use a shell script to extract the recording levels you want, and restore them later.

If you are running Pulseaudio, then without -D, you'll see the leves of the pulse pseudo-device that allows ALSA applications to access Pulseaudio. Also note that Pulseaudio my change settings on startup.

(3) can be done with pacmd or pactl; the output is not tool-friendly and requires a bit of parsing. See pacmd help and pactl help for details.

aumix is a legacy tool and probably won't work properly with ALSA or Pulseaudio.

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.