LinuxCommandLibrary

alsamixer

Adjust audio volume settings

TLDR

Select the soundcard to use

$ alsamixer [[-c|--card]] [soundcard_number]
copy

Select mixer device to control
$ alsamixer [[-D|--device]] [device_name]
copy

Increase volume
$ <w>
copy

Decrease volume
$ <x>
copy

Quit alsamixer
$ <Esc>
copy

SYNOPSIS

alsamixer [OPTIONS]

PARAMETERS

-h, --help
    Displays a help message and exits.

-c card, --card=card
    Selects the sound card to control. card can be an index number (e.g., 0, 1) or a string identifier (e.g., 'default', 'HDA Intel PCH').

-D device, --device=device
    Selects the mixer device to control. Useful if multiple mixer interfaces exist on a single card.

-V view, --view=view
    Sets the initial view mode for controls. Valid options are 'playback', 'capture', or 'all'.

-g, --no-color
    Disables color output, using monochrome text for the interface.

-s, --no-sound-card
    Starts alsamixer without loading any sound card settings. Useful for debugging.

-M, --set-soft-master
    Attempts to create a 'soft master' control if the hardware does not provide a dedicated master volume. This can provide a unified volume control across multiple channels.

DESCRIPTION


The alsamixer command provides a curses-based (text user interface) mixer program for the ALSA (Advanced Linux Sound Architecture) sound system. It allows users to interactively control various audio settings of their sound card(s) directly from the terminal.

Users can adjust playback and capture volumes for different channels (e.g., Master, Headphone, Speaker, Mic), mute/unmute specific outputs, and manage other hardware-specific controls like input sources or digital/analog switches. Its primary utility lies in environments without a graphical interface, such as servers, embedded systems, or for users who prefer a lightweight, keyboard-driven interface for audio management.

The interface typically displays a series of sliders for each control, allowing for easy navigation and adjustments using arrow keys. It also supports switching between different sound cards and views (playback, capture, or all controls).

CAVEATS

alsamixer directly interacts with the ALSA sound drivers. It does not manage higher-level sound servers like PulseAudio or PipeWire directly, though changes made via alsamixer to the underlying ALSA hardware often affect these systems.

Changes made with alsamixer are usually not persistent across reboots by default. To save changes, you typically need to use alsactl store (or a similar system service/script) after making your adjustments.

KEYBOARD CONTROLS

Once alsamixer is running, the following keyboard shortcuts are commonly used:
Left/Right Arrow: Navigate between mixer channels/controls.
Up/Down Arrow: Adjust the volume level for the selected control.
M: Mute/unmute the selected channel.
Spacebar: Switch between playback and capture views (depending on context).
Tab: Switch between different views (e.g., 'Playback', 'Capture', 'All').
F1: Help (often shows keyboard shortcuts).
F2: System information (often shows card/chip info).
F3: Switch to Playback view.
F4: Switch to Capture view.
F5: Switch to All controls view.
Esc or Ctrl+C: Exit the program.
Numeric keys (0-9): (When multiple sound cards are present) Select a specific sound card by its index.

SAVING SETTINGS

To make alsamixer changes persistent across reboots, you need to save the ALSA state. This is typically done using the alsactl utility:
Type sudo alsactl store
This command saves the current ALSA mixer settings to a configuration file (often /var/lib/alsa/asound.state or /etc/asound.state), which is then loaded automatically by a system service or script during system startup.

HISTORY

alsamixer is an integral part of the ALSA (Advanced Linux Sound Architecture) project, which replaced the older OSS (Open Sound System) as the standard sound framework in Linux. Developed to provide robust and flexible audio support, alsamixer has been a consistent and essential tool for managing sound hardware at a low level in Linux environments for many years. Its development is tied to the evolution of the ALSA kernel modules and user-space utilities, ensuring compatibility and control over a wide range of sound cards.

SEE ALSO

amixer(1), aplay(1), arecord(1), alsactl(1)

Copied to clipboard