Troubleshooting Linux Audio

TL;DR

  1. Check hardware
  2. Turn all audio on and up in alsamixer
  3. Turn all audio on and up in kmix
  4. Verify Pulse Audio settings with pavucontrol
  5. Turn all audio on and up in application

When sound doesn't work on you Linux machine, don't panic. On any operating system, there are at least four separate volume controls for sound:

  • Hardware: the hardware device, such as volume knobs on speakers, for instance.
  • OS: the operating system audio configuration controlling which device attached to the computer should play sound.
  • Desktop: the desktop master volume control, usually identified with a speaker icon in a system tray or menu bar.
  • Applications: each individual applications producing the sound you expect to hear.

The same is true for Linux.

If you cannot hear sound from your Linux machine, or your Linux machine isn't accepting audio input from you, stay calm and perform these simple troubleshooting steps, in this order:

1. Hardware

First, do a “dummy check” on your hardware:

  • If you're not hearing sound from your speakers, are you headphones plugged in by accident?
  • Is the volume turned on your speakers or headphones?
  • Are your speakers plugged in?
  • Are you speakers on?
  • Is your microphone plugged into the headphone (and not the speaker) port?

It seems obvious, but a good audio (or network, for that matter) engineer checks connections first.

2. OS

Next, ensure that the audio inputs and outputs are detected by the OS, and that the levels are set.

There are several interfaces that tap into the low level audio settings, but the clearest and most comprehensive is the most basic: alsamixer (ALSA being the audio driver on Linux).

  • Launch and use alsamixer from a terminal, like konsole.

The alsamixer window is divided into three panels: Playback for output, Capture for input, and All for both output and input in one view.

  • Press F3 to view Playback, F4 for Capture, and F5 for All.

Some computers have more than one sound output or input (a “sound card”, which is not necessarily always a literal card; it may also be an expensive USB-audio interface, or a microphone-headphone combo, or even a graphics card with an audio-capable HDMI port). For that reason, the alsamixer interface may be used on each audio interface inside of or connected to your computer.

  • Verify which sound “card” alsamixer is talking to by pressing F6 on your keyboard. This displays the soundcards that ALSA is aware of.

You may not know the exact factory model and number of each sound card in your computer, but usually there's enough indication for you to make an intelligent decision about which card you are actually trying to use. For instance, an Nvidia audio device on a desktop is probably your graphics card, especially if it's an Nvidia HDMI device. A Logitech, Plantronics, or Turtle Beach audio card is probably the USB headset you have plugged in.

If you are unsure, do the same thing for each and every device.

  • Unmute every possible sound output or input, and turn the level up.

Sound “cards” frequently have several different audio “streams” it can handle; your inbuilt audio device, for instance, can probably at least provide a speaker output as well as a headphone output. Unmute everything, and turn the level up on everything. You can come back around later and adjust as needed, but for now, make sure everything is On.

Navigate between audio streams using the Left and Right arrows on your keyboard.

Each alsamixer control has two parameters:

Use the Up and Down arrows on your keyboard to set the level of a stream.

A level marked MM is muted, regardless of what level it appears to be set to. To unmute a stream, press m on your keyboard.

3. Desktop

At this point, the sound input or output you're troubleshooting should be working. Another “dummy check” is in order, though; make sure that the desktop tools used for setting volume are set sanely. These should mirror what you set in alsamixer, but double-check it just to make sure.

Since Slackware 14.2, there are two applications you should check:

  • Kmix
  • Pulse Audio (pavucontrol)

Both are graphical tools and are intuitive to use. Check to ensure volume hasn't been muted or turned down on some device or stream you are trying to use. Looking at kmix is mostly a dummy check; it should mirror your settings in alsamixer.

In pavucontrol, all available settings are in tabs along the top of the window. Since it routes sound to ALSA devices, its settings are simplified and may be different from your ALSA settings.

Check all of them to ensure you're routing sound to the places you think you're routing sound.

4. Applications

Finally, if there's still no sound, check the application that is supposed to be generating or receiving the sound.

  • Is the application's volume set correctly?
  • Is the application using the correct sound output? Check in the application's Settings or Preferences menu to make sure it's sending sound to the output (or receiving sound from the input) that you intend.
  • If the application is a “pro” application (such as Ardour, Qtractor, or any JACK-enabled application), are you routing your sounds correctly? Do you have your master channel routed to the correct output device?

If All Else Fails

If you have performed these troubleshooting steps and you still get no sound from any device, try creating a new, completely fresh user account on your machine. Log out of your own account and log into this new user account, and try to play or capture sound. If it works, then your user account probably has some hidden configuration files confusing the sound settings (this can happen if you've migrated your account from another machine). If that's the case, log back into your user account and look at the hidden files in your home directory. A likely candidate is .asoundrc, but look for Pulse Audio configurations, as well. Move these files to your Trash or some temporary location, log out and log back in, and test.

If that doesn't work, try posting your problem to Slackermedia in IRC, or post a question on //linuxquestions.org in the Slackware forum. It's helpful to include the output of aplay -l or arecord -l (the former for playback issues, the latter for capture issues).

R S Q