Warning /!\ As of 2012, much of the information on this page is outdated. Please refer to the official sound debugging guide and Ubuntu Audio Development team's pages for more up-to-date information.

Sound Output Troubleshooting

Note: In some cases, the procedures listed below are not "simple fixes" and can cause problems later if the card needs to be replaced. It may be easier to simply replace or add a new card from the start rather than risk damaging the installation. Cards that work the best with Ubuntu are called "free software compatible." ThinkPenguin.com sells free software compatible audio cards that work with Ubuntu out of the box.

Basic Troubleshooting Steps

Most of these steps apply equally to Ubuntu, Kubuntu and Xubuntu, since their core configuration is the same.

1. Is your volume turned all the way down, or is your speaker muted?

Click on the speaker icon in the upper right hand corner of the screen. This will launch a drop down menu which has a slider to control the volume. Make sure that the volume is not set too low.

If volume is high you should also check if pacmd tool show that your sound is not mute:

$ pacmd
Welcome to PulseAudio! Use "help" for usage information.
>>> list-sinks

2. Can you play a sound that is known to always play correctly?

A standard test for speakers is to press Alt+<F2> and run

aplay /usr/share/sounds/alsa/Front_Center.wav

You should hear a voice saying "Front Center". If it doesn't play the first time you run that command, try running it again as root.

sudo aplay /usr/share/sounds/alsa/Front_Center.wav

If it still doesn't play, that means there is a problem with your configuration. If the sound plays as root, but not as a regular user, then you need to add the user to the "audio" group.

sudo addgroup <username> audio

3. Can another user play one of these "known-good" sounds?

Log in with another user account. If there are no others, you should create one with default settings.

Then follow the instructions in the previous section to play "Front_Center.wav."

If sound is played in that user but not in yours, that means that something is wrong with your user configuration. This narrows down the problem somewhat. If you see any solutions that involve changing the whole system's configuration, you probably don't have to follow them.

4. Is the system recognizing your sound card?

Open a terminal (Applications -> Accessories -> Terminal) and type

sudo aplay -l

The output of that command should look something like this:

**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC861VD Analog [ALC861VD Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

If you see this:

aplay: device_list:221: no soundcard found...

That means that Ubuntu is not recognizing your sound card. Check that you have the proper modules installed.

5. Do you have the sound modules installed?

Open a terminal and type

find /lib/modules/`uname -r` | grep snd

You should see a large list of items come up. If you don't, it means that the install process did not install the sound modules for you. To fix this, type in the terminal window:

sudo apt-get install linux-restricted-modules-`uname -r` linux-generic

After installing the modules, you will need to reboot for the changes to take effect.

If the modules are already installed, proceed to the next step to check to see whether your hardware is recognizing the sound card as installed.

6. Is the sound card physically installed and recognized by your hardware?

Open a terminal and type

lspci -v | grep -A7 -i "audio"

This should output some information about your audio hardware. An example is below.

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
        Subsystem: Toshiba America Info Systems Device ff01
        Flags: bus master, fast devsel, latency 0, IRQ 22
        Memory at dc440000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: HDA Intel
        Kernel modules: snd-hda-intel

Most people, especially laptop users, have a built-in sound card for their computer on the motherboard. If yours is built-in and isn't showing up in this step, then you probably need to enable it in your BIOS. When you first reboot your computer, there's usually a key sequence listed telling you how to enter the BIOS configuration screen. Since all BIOS's are differenct, you'll need to sort through your BIOS and enable the built in sound card. If you need help with this, you should ask at ubuntuforums.org.

If you are not using a built in sound card, and this step does not show your audio card, the card may be seated incorrectly on your motherboard, or may be bad or otherwise incompatible with your motherboard. You will probably want to test the card in another computer to see if it works there.

7. Is my sound card supported by the Ubuntu sound system?

Ubuntu uses the Advanced Linux Sound Architecture (ALSA) for managing sound output. There is a listing of all of the sound cards supported by ALSA at http://www.alsa-project.org/main/index.php/Matrix:Main . You should look for the information that was listed by the command in the previous step. If it happens that your sound card is not supported by ALSA, you have two options: obtain a new sound card that is supported by ALSA, or contact the ALSA developers and request support for your sound card.

Manual Installation

If you've done the basic troubleshooting listed above and your sound still isn't working, you may have found a bug in Ubuntu. It could be something as simple as not detecting your hardware the first time or evidence of a deeper problem. Ubuntu developers need your feedback to see that your sound system is not working for you. If you've reached this point, you should file a bug report on launchpad.net under the Ubuntu distribution. You should probably include output of the commands in the previous sections in the bug report. Filing a bug report may seem like a worthless exercise, but it really helps in the development process so other people (and possibly even you) will not run into the same problem.

Once you've filed a report, you might want to follow these instructions to get your sound working in the meantime while the developers try to fix your bug.

Manually starting the audio driver

Open a terminal and type

sudo modprobe snd-[NAME OF YOUR SOUNDCARD'S DRIVER]

For example, my driver is named "via82xx" so I would type

sudo modprobe snd-via82xx

After this, try playing sound. If you hear sound, it means that your installation isn't auto-detecting your sound card, but you have all of the right software. This command temporarily loads the sound driver, but it will not be there on the next reboot.

You can override the auto-detection and force your computer to load the driver on every reboot by adding the driver (i.e. snd-via82xx) to the /etc/modules file. Type

gksudo gedit /etc/modules

and add your sound driver as the last line of the file. Save the file, and reboot to verify that the sound is working after a reboot. Even if this step works, you should file a bug with the Ubuntu developers at launchpad.net if you haven't already so they can try to understand why your computer isn't auto-detecting the sound card.

Refreshing/reinstalling the drivers

Sometimes, sound might be configured correctly, but for some reason or another it stops working. If this is the case, you can purge your custom changes, and reset your system to a clean base. This may clear up your problem and restore your computer to a working state.

Open a terminal and type

sudo aptitude --purge reinstall linux-sound-base alsa-base alsa-utils linux-image-`uname -r` linux-ubuntu-modules-`uname -r` libasound2

This will purge any custom configurations that you've made, and any hand-compiled modules that you've built, and restore your sound stack to the "Official" Ubuntu core.

ALSA driver compilation

Warning /!\ This section is outdated. You should not need to recompile your own drivers. See this link for easier ways to upgrade ALSA.

  • If you are here, then either your soundcard driver could not be loaded with modprobe, or you want to compile the drivers yourself from scratch. Good luck to you!
  • There are two main ways the sources of alsa-drivers are made available to you. One is through the apt-get system. Using this system would be the recommended system since most of the heavy lifting is done for you.
  • The other way, is getting the latest drivers from alsa-project.org. This page has the latest drivers available, which you might want to fix problems with. However, these have not been tested with Ubuntu and therefore should be used with caution.

Using alsa-source

  • Open up a shell: (note: module-assistant is optional, it will compile the package for you)
  • Type sudo apt-get install build-essential linux-headers-$(uname -r) module-assistant alsa-source

  • Type sudo dpkg-reconfigure alsa-source

  • You now have a big blue dialog box (left and right keys to choose 'Yes' and 'No', Enter key proceed). Answer yes (for ISA-PNP - recommended by package maintainers), then yes again (for debugging - recommended by package maintainers).
  • Now you must pick which driver you want to install. Use space to select and deselect modules, and up and down to navigate.
  • From General Help step 3, you should know the name of your driver. Deselect 'all' (the * will go away), and select your driver. In my case, I deselected 'all' then selected 'via82xx'. Hit Enter. Almost home free!
  • If you chose module-assistant sudo module-assistant a-i alsa-source. If the progress bar reaches 100% with no errors, you will have installed the drivers successfully. Resume this guide from General Help step 4. You may need to run tail -F /var/cache/modass/alsa-source.buildlog.$(uname -r).* to see the progress.

  • If you did not choose module-assistant - Remember the name of your soundcard driver (eg. via82xx) and use it in place of <insert driver> below.

cd /usr/src
sudo tar xjvf alsa-driver.tar.bz2
cd alsa-driver<insert alsa version, if necessary>
sudo ./configure
sudo make
sudo make install
  • If you get no error messages, you will have installed the drivers successfully.
  • *Success - Resume this guide from General Help step 4.

  • *Failure - Start a new thread in this thread of the forum. Paste the error message that you get and state that you were following instructions on this page.

Using drivers from alsa-project

Update: The instructions below are outdated. Please see http://ubuntuforums.org/showthread.php?p=6589810#post6589810 for a convenient script that will build the latest ALSA release

The alsa-project route is very similar to the alsa-source route without the module-assistant. First you would have to get the alsa-driver tar from alsa-project then pretty much do configure, make and make install again. However, I do recommend that you make a specific directory when you compile something from source. Remember the name of your soundcard driver and use it in place of the blue text below.

mkdir src
cd src
mkdir alsa
cd alsa
sudo apt-get install build-essential linux-headers-$(uname -r)
wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.12.tar.bz2
tar -xvjf alsa-driver-1.0.12.tar.bz2
cd alsa-driver-1.0.12
sudo ./configure
sudo make
sudo make install

If you get no errors from doing the above then you have successfully compiled alsa-drivers from source. Resume this guide from General Help step 4.

Sound issues with HP dvx laptops

Warning /!\ This section is for an outdated version of Ubuntu. Please use these instructions at your own risk.

If you have an HP dv4, dv5, and perhaps a dv7 model series laptop, you may have sound issues. ex: HP Pavilion dv4 1225, HP Pavilion dv5 1044ca, etc...

- this fix work greet with Jaunty Jackalope (Ubuntu 9.04) 30 apr 2009

- the alsa developers have a solution for this issue:

The cause, according to some alsa developers, is an incorrect 'pin' assignment (in the BIOS, perhaps) whereby sound output meant for the internal speakers gets routed to the wrong place.

The latest alsa-driver snapshot provides a fix for this issue. You can get it here:

cd ~
mkdir src
cd src
mkdir alsa
cd alsa
wget ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.gz
tar -xvpf alsa-driver-snapshot.tar.gz
cd alsa-driver
sudo ./configure
sudo make
sudo make install-modules

Optional:

sudo vim /etc/modprobe.d/alsa-base.conf

[add 'options snd_hda_intel model=hp-dv5' sans quotes to the bottom of the file, even if you have a dv4, etc.]

sudo reboot

Another possibility for HP dv7 laptops

The above procedure did not work for my dv7, but the on-line fix at http://forum.notebookreview.com/showthread.php?t=331172 got things working.

options snd-hda-intel enable_msi=1

Loading a working sound configuration

If you can find someone with similar hardware as yours and has working sound, you could take their settings and try them on your hardware.

  1. Get a working /var/lib/alsa/asound.state from someone who has similar hardware
  2. Save it as /tmp/asound.state
  3. alsactl -F -f /tmp/asound.state restore

Getting ALSA to work after suspend / hibernate

Some soundcards do not work after the computer has been suspended or hibernated. Files in /etc/pm/sleep.d/ are read when the system is entering or leaving suspend mode. Create a file telling the system to restart alsa when the computer is being brought up from suspended mode to make the audio work again.

The command /sbin/alsa force-reload will kill all running programs using the sound driver so the driver itself is able to be restarted.

sudo nano /etc/pm/sleep.d/50alsa

case "$1" in
        hibernate|suspend)
                # Stopping is not required
                ;;
        thaw|resume)
                /sbin/alsa force-reload
                ;;
        *) exit $NA
                ;;
esac

Make the newly created script to be executable with the following command:

sudo chmod +x /etc/pm/sleep.d/50alsa

Line Input/Microphone Troubleshooting

Increasing very low microphone input

General note: This solution was tested for a stereo microphone (notebook ASUS EeePC 1005 PE), wowever it will probably work with other configurations. It is possible that the problem is caused by a default configuration of ALSA that cannot correctly recognise type of the microphone (mono/stereo). Anyway, it was observed on Ubuntu, Mint and possibly Debian. Thanks to user "wyrdoak" for a solution http://forums.linuxmint.com/viewtopic.php?f=49&t=74288#p435604

Symptoms: The microphone provides an extremely low input signal level in all applications (skype, arecord, gnome-volume-control, etc.). Microphone input signal gains in Gnome mixer and Alsa mixer are set to 100%.

Solution:

  • Double check whether the microphone is unmuted:
    • Open sound preferences by left-clicking on a speaker icon in Gnome panel. Or press Alt+<F2> and type

      gnome-volume-control
      You can also type this in terminal.
    • Switch to Input tab and ensure the microphone is unmuted and the input level is not zero (preferably maximum). Don't worry, this will not damage the hardware.
  • Ensure you have pavucontrol (Pulse Audio VolUme CONTROL) installed:

    • Press Alt+<F2> and type

      sudo apt-get install pavucontrol
      You can also type this in terminal.
  • Open pavucontrol: press Alt+<F2> and type

    pavucontrol
    You can also type this in terminal.
  • Ensure you are using appropriate device and its profile:
    • Go to Configuration tab

    • Select Analog Stereo Duplex or just Analog Duplex from the Profile drop-down list

    • Note: this troubleshooting solution was tested on a laptop with only one audio card, that appeared in Configuration tab as Internal Audio.

  • Switch one of the input channels off:
    • Go to Input Devices tab and ensure you have the Internal Audio Analog Stereo or just Internal Audio Analog displayed by selecting All input devices from the Display drop-down list.

    • Find the appropriate input device (microphone) and ensure its not muted - by unticking mute audio icon.

    • Unlock channels so that they are not linked together - by pressing a padlock icon or chainlink icon.
    • Slide the slider of Front Right all the way down to zero.

    • Talk to the microphone observing input level on the bar just below the two sliders or at the Input tab of Gnome-volume-control.

    • This should work when either channel is muted, though it is suggested to start with Front Right one.

Changing default subdevice configuration

  • Some sound devices have multiple capture subdevices (eg. hda-intel), but pulseaudio only seems to detect the parent device, and only listens to subdevice #0. ALSA may not be configured to use your preferred device as subdevice #0 by default.
    • Open the pulseaudio record meter (pavumeter --record)

    • Talk into your chosen device while you carry out the process and watch the meter.
      • Some channels are quite noisy even with no input (especially on integrated chipsets), so we are watching for movements that correspond to our voice.
    • Use alsamixer -c n (where n is your sound card number, probably 0)

      • Press F4 to get to the capture console
      • Make sure the first capture channel is enabled ("CAPTUR" in red, press space to toggle), and the volume turned up.
      • Check the first input source is switched to your chosen plug (Mic, in my case)
    • At this point, you should see the record meter bouncing in response to your voice.
    • I found that I had to repeat this procedure each time I wanted to use the Mic, even though the settings "stuck" in the mixer, something in the soundcard wasn't initialized until it was repeated.
    • This also works if you use the "Options" tab in the standard mixer app to do the same thing.

MIDI Troubleshooting - *EXPERIMENTAL*

This section assumes you can successfully hear sound from your soundcard. First of all, make sure that you actually have a MIDI port on your soundcard. Most onboard soundcards do not have a MIDI port.

Next, open up this file:

sudo nano /etc/modprobe.d/alsa-base Then add this options line options <snd module name here i.e. snd-via82xx> mpu_port=0x330 OR if you already have a options line for this soundcard add mpu_port=0x330 to the line.

The default MIDI port is 330. You should verify this number in your BIOS if you are not sure. If the number is not listed, it is most likely that the number is 330 (add the 0x for the file).

If you get no errors, you have successfully installed your MIDI port. At the moment, I do not know if any further configuration is necessary.

Posts / References / Credits

Hoary Sound Broke

Problem with Azalia audio

MultipleCards from alsa.opensrc.org

Volume Control does not save my settings after reboot


CategoryAudio

SoundTroubleshooting (last edited 2015-04-27 20:47:12 by fitojb)