How to Test Speaker and Headphone Channels in Linux Terminal Using speaker-test

When configuring a new audio setup, troubleshooting quiet output, or diagnosing unbalanced stereo headphones on Linux, navigating graphical control panels does not always reveal which physical hardware channel is misbehaving. The Advanced Linux Sound Architecture (ALSA) provides a command-line diagnostic tool named speaker-test. Designed to interact directly with audio drivers across ALSA, PulseAudio, and PipeWire audio servers, speaker-test allows you to verify individual speaker channels, generate pink noise, and identify channel mapping errors in seconds.

What Is speaker-test and How Does It Work?

The speaker-test utility is part of the standard alsa-utils software package. It produces a variety of audio signals, including pink noise, pure sinusoidal frequency tones, and pre-recorded spoken voice samples (such as “Front Left” and “Front Right”).

Because it operates at the ALSA sound driver layer, it can bypass higher-level desktop audio filters, making it an indispensable tool for verifying whether audio issues stem from physical hardware faults, cabling mismatches, or software mixer configurations.

Installing the ALSA Utilities Package

Most Linux distributions include speaker-test by default. If the command is not found on your system, install the ALSA utilities package using your distribution’s native package manager:

  • Ubuntu, Debian, and Linux Mint:
    sudo apt update && sudo apt install alsa-utils
  • Fedora, RHEL, and CentOS:
    sudo dnf install alsa-utils
  • Arch Linux and Manjaro:
    sudo pacman -S alsa-utils

Basic Stereo Channel Testing with Spoken Voice

The most intuitive way to verify stereo headphone or desktop speaker channels is by playing clear voice prompts. This immediately confirms whether your left and right channels are correctly wired and oriented.

  1. Launch your terminal emulator.
  2. Execute the following command:
    speaker-test -c 2 -t wav
  3. Here, the -c 2 parameter sets the channel count to 2 (stereo), and -t wav directs the utility to stream WAV voice prompts rather than noise.
  4. You will hear a clear voice announce “Front Left” through the left speaker, followed by “Front Right” through the right speaker in a continuous loop.
  5. To stop the test at any time, press Ctrl + C.

Generating Pink Noise for Acoustic Calibration

If you are calibrating equal loudness across studio monitors or balancing high-impedance headphones, continuous pink noise provides a consistent acoustic signal across the entire audible frequency spectrum.

speaker-test -c 2 -t pink

By default, if you omit the -t flag, speaker-test uses pink noise. The test alternates between the left and right speakers in intervals of several seconds, allowing you to detect audio dropouts, distortion, or impedance imbalances between earcups.

Testing 5.1 and 7.1 Surround Sound Systems

For home theatre installations and surround sound gaming rigs connected via HDMI, optical TOSLink, or multiple 3.5mm analogue jacks, speaker-test can cycle through each individual satellite speaker in sequential order.

5.1 Surround Sound Verification

To test a 6-channel setup (Left, Right, Centre, Subwoofer, Surround Left, Surround Right), run:

speaker-test -c 6 -t wav

The spoken voice will address each physical channel individually:

  1. Front Left
  2. Front Centre
  3. Front Right
  4. Rear Right
  5. Rear Left
  6. LFE (Low Frequency Effects / Subwoofer)

7.1 Surround Sound Verification

For an 8-channel surround configuration, increase the channel count parameter to 8:

speaker-test -c 8 -t wav

Targeting Specific Sound Cards and Output Devices

Modern computers typically have multiple audio endpoints, such as an integrated motherboard codec, dedicated USB DAC, wireless headset, and HDMI monitor outputs. If speaker-test defaults to the wrong sound card, you can manually target your preferred device.

Step 1: List Available Playback Hardware

Run aplay to inspect all registered sound cards and digital audio devices:

aplay -l

Note the card number and device number of your desired hardware (for instance, card 1: USB [USB Audio DAC], device 0).

Step 2: Execute speaker-test on the Specific Endpoint

Pass the hardware identifier using the -D (device) flag with the plughw plugin, which handles sample rate conversion automatically:

speaker-test -D plughw:1,0 -c 2 -t wav

This bypasses system audio routing and sends the test signal directly to the hardware card 1, device 0.

Testing Pure Frequencies for Resonance and Rattles

To detect acoustic distortion, enclosure vibrations, or blown speaker cones, you can generate a pure sine wave at a specific frequency:

speaker-test -c 2 -t sine -f 1000

The -f 1000 flag sets the oscillator frequency to 1,000 Hz (1 kHz). You can substitute any frequency between 20 Hz and 20,000 Hz to test bass response, midrange clarity, or high-frequency treble performance.

Troubleshooting Common Audio Issues in Linux

If speaker-test produces no sound or returns an error, apply these standard diagnostics:

  • Check for Muted ALSA Channels: Open the terminal mixer interface by typing alsamixer. Use the arrow keys to navigate to your Master and PCM faders. If a channel displays [MM], press M to unmute it and tap the up arrow to raise the gain.
  • Device or Resource Busy Errors: If an application holds exclusive lock on ALSA, run the test through default PulseAudio or PipeWire emulation using speaker-test -D default -c 2.
  • Verify Headphone Jack Presence: Ensure headphones are securely seated in the audio jack; analogue sensing pins in certain audio jacks disable speaker output when cables are partially inserted.
  • Script Automation: Combine your audio diagnostics with other administrative skills, such as learning how to trim whitespace with sed and awk, to build automated server hardware verification scripts.

Using speaker-test gives Linux users an efficient, command-line method to verify sound reproduction, diagnose channel balance, and resolve complex audio routing problems.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.