alsamixer

audiolinux
The alsamixer command is one of the most frequently used commands in Linux/Unix-like operating systems. alsamixer The alsamixer command provides a text-based user interface for adjusting audio volume and settings using the ALSA (Advanced Linux Sound Architecture) sound system.

Quick Reference

Command Name:

alsamixer

Category:

audio

Platform:

linux

Basic Usage:

alsamixer [options] [arguments]

Common Use Cases

    Syntax

    alsamixer [options]

    Options

    Option Description
    -h, --help Display help and exit
    -c, --card NUMBER Select the sound card by number
    -D, --device NAME Select the device name (default: default)
    -V, --view MODE Select the view mode: playback, capture, all (default: playback)
    -g, --no-color Toggle the use of colors
    -a, --abstraction LEVEL Control abstraction level: none, basic (default)
    -f, --config FILE Use the specified configuration file
    -z, --no-zero Hide controls with zero volume range
    -M, --no-menu Disable the top menu bar
    -m, --no-mouse Disable mouse support

    Examples

    How to Use These Examples

    The examples below show common ways to use the alsamixer command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

    #

    Basic Examples:

    # Start alsamixer with default settings
    alsamixer
    # Start alsamixer for a specific sound card alsamixer -c 1
    # Start alsamixer in view mode alsamixer -V all
    # Start alsamixer for a specific sound card device alsamixer -D hw:0

    Advanced Examples:

    # Start alsamixer showing all controls including those with zero volume range
    alsamixer -V all -a
    # Start alsamixer for a specific device with a specific view alsamixer -c 2 -V capture
    # Start alsamixer with a specific ALSA configuration file alsamixer -f ~/.asoundrc # Start alsamixer with a display showing the help menu alsamixer -h # Start alsamixer for a specific sound card and hide inactive controls alsamixer -c 1 -z

    Try It Yourself

    Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

    Understanding Syntax

    Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

    Notes

    Keyboard Controls:

    When using alsamixer, you can control it with these keyboard shortcuts:

    • and : Select a channel (control)
    • and : Adjust the volume level
    • M: Toggle mute for the selected channel
    • Space: Toggle recording for the selected input channel
    • Tab: Switch between Playback, Capture, and All views
    • F1 through F6: Select sound cards 1-6
    • Page Up/Page Down: Move 10 steps at a time
    • End: Set volume to 0%
    • Home: Set volume to 100%
    • Q or Esc: Quit alsamixer
    • F: Toggle between relative dB and absolute volume display

    Views and Modes:

    Alsamixer has different view modes that can be accessed with the -V option or by pressing Tab:

    • Playback (F3): Shows only playback (output) controls
    • Capture (F4): Shows only capture (input/recording) controls
    • All (F5): Shows all controls

    Sound Card Selection:

    If you have multiple sound cards:

    • Use -c or --card to select a specific card by number
    • Press F1-F6 to switch between cards while running alsamixer
    • List available cards with aplay -l or cat /proc/asound/cards

    Color Coding:

    Alsamixer uses colors to represent different statuses:

    • Green bar: Normal volume level
    • Red bar (on top of green): Volume is above 0dB, which might cause clipping
    • Blue/Cyan bar: Captured/Recording channels
    • Gray/white with MM: Muted channel
    • Gray/white with OO: Channel is unmuted
    • Red with CAPTURE: Recording is active for this channel

    Saving Settings:

    Alsamixer itself doesn't save settings between reboots. To save your settings:

    # Save the current mixer settings
    sudo alsactl store
    
    # Restore previously saved settings
    sudo alsactl restore
    

    Troubleshooting:

    • If you don't see any controls, try changing the sound card with -c or F1-F6
    • If a channel is muted, press M to unmute it
    • If you can't increase the volume beyond a certain level, check for additional mixer controls like "Master" or "PCM"
    • If changes aren't persistent across reboots, make sure to use sudo alsactl store
    • If alsamixer doesn't start, ensure ALSA is properly installed: sudo apt install alsa-utils

    Integration with Desktop Environments:

    While alsamixer is a terminal-based application, many desktop environments provide graphical alternatives:

    • GNOME: Use gnome-control-center sound
    • KDE: Use KMix
    • XFCE: Use xfce4-mixer

    Important Notes:

    • Alsamixer requires the alsa-utils package to be installed
    • Some systems use PulseAudio or PipeWire on top of ALSA, which might limit direct ALSA volume control
    • For systems using PulseAudio, consider using pavucontrol as an alternative
    • Not all controls shown in alsamixer may affect the sound output, as some might be unused or unsupported by your hardware
    • The interface might look different depending on your sound card capabilities and drivers

    Related Commands

    These commands are frequently used alongside alsamixer or serve similar purposes:

    Use Cases

    Learn By Doing

    The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the alsamixer command works in different scenarios.

    $ alsamixer
    View All Commands