Common Commands:
The amixer utility accepts the following commands:
get CONTROL
: Display settings for the specified CONTROL
set CONTROL VALUE
: Adjust the value of the specified CONTROL
scontrols
: Show all simple mixer controls
scontents
: Show contents of all simple mixer controls
controls
: Show all controls for the mixer
contents
: Show contents of all controls for the mixer
info
: Show info about the mixer
Adjusting Controls:
When using the set
command, you can specify values in several ways:
set Master 80%
: Set volume to 80%
set Master 3dB
: Set volume to +3dB (if supported by hardware)
set Master 10%-
: Decrease volume by 10%
set Master 5%+
: Increase volume by 5%
set Master 1+
: Increase volume by 1 step
set Master 2-
: Decrease volume by 2 steps
set Master mute
: Mute the control
set Master unmute
: Unmute the control
set Master toggle
: Toggle between mute and unmute
Channel Control:
You can adjust individual channels using comma-separated values:
set Master 80%,70%
: Set left channel to 80% and right channel to 70%
set Capture 90%,80%,85%
: Set three channels to different values
set Mic cap
: Enable capture for the microphone (for recording)
set Mic nocap
: Disable capture for the microphone
Finding Available Controls:
Before adjusting audio settings, you may need to know what controls are available:
# List all simple controls
amixer scontrols
# List all controls with current values
amixer scontents
# List controls for a specific card
amixer -c 1 scontrols
Common Controls:
Most sound cards have these common controls:
Master
: Overall output volume
PCM
: Digital volume control for playback
Headphone
: Volume for headphone output
Speaker
: Volume for built-in speakers
Capture
: Main recording input level
Mic
: Microphone input level
Line
: Line input level
Auto-Mute Mode
: Automatic muting of speakers when headphones are connected
Scripting with amixer:
Amixer is often used in scripts for audio control. Some examples:
# Check if Master is muted
if amixer get Master | grep -q '[off]'; then
echo "Sound is muted"
fi
# Get current volume percentage
volume=$(amixer get Master | grep -o '[0-9]*%' | head -1)
echo "Current volume: $volume"
# Create a simple volume increase script
#!/bin/bash
amixer -q set Master 5%+
Sound Card Selection:
If you have multiple sound cards:
- Use
-c CARD
or --card CARD
to select a specific card by number
- Use
-D DEVICE
or --device DEVICE
to select a device by name
- List available cards with
aplay -l
or cat /proc/asound/cards
Saving Settings:
Like alsamixer, amixer doesn't save settings between reboots. To save settings:
# After making changes with amixer, save them
sudo alsactl store
Important Notes:
- Amixer requires the alsa-utils package to be installed
- On systems using PulseAudio or PipeWire, changes made with amixer may be overridden
- For PulseAudio systems, consider using
pactl
or pacmd
commands instead
- Amixer provides a more script-friendly interface compared to alsamixer
- The available controls vary significantly between different sound cards
- Some controls may have non-obvious names specific to your hardware