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
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.