Tag/tag.png

Content Cleanup Required
This article should be cleaned-up to follow the content standards in the Wiki Guide. More info...

Tag/tag.png

Needs Updating
This article needs updating to include the latest versions of Ubuntu. More info...

Sound Troubleshooting Guide

for Ubuntu 10.04, 10.10, 11.04 and 11.10

Notes/Warnings/Tips about this document:

IconsPage/info.png

  • This is a do-it-yourself guide to fix your sound problems. I do not guarantee that it will work, but feel free to edit this document if you have any problems.
  • Make sure that you have plenty of time to do this guide, as it will probably take a few hours.
  • Make sure that you have installed the latest updates for ubuntu before beginning this guide.
  • All advice in this guide has been tested on Ubuntu. Though we have not tested thoroughly on Kubuntu, Xubuntu and Lubuntu the advice is likely to work for these versions as well.
  • In this guide, a Terminal window will be frequently used. In some cases, it is essential for you to use it to solve your problem. You can find a tutorial on using the terminal here: Using the terminal

  • All commands to type are in boxes,
    like this.
  • You will probably not need all of this guide to cure your audio! Feel free to only pick the bits that appear relevant.


Preliminary checks and guide start:

Make sure that all of these things are OK (follow the checks in the order supplied):

  • Your speakers are turned on fully (on the speakers)
  • Your speakers are turned on in AlsaMixer

  • Your speakers are plugged into the correct ports.
  • If your speaker has a power cable, make sure that it is plugged in.
  • Your speakers work (try plugging them into a CD/DVD/Radio player)
  • Your Ubuntu release is supported. If it isn’t supported anymore, install a supported release of Ubuntu (clean install, not upgrade from the upgrade tool).
  • If your problem is NOT sound, but recording instead, check out Appendix D, and Appendix B, on the recording section. If it still doesn't work after tweaking the settings a lot, use the instruction under the heading Af to reinstall ALSA.
  • If your problem is that the sound stops working after hibernation, follow the instructions under Ba.
  • If you want to make MIDI work, make sure that sound works normally, then follow heading Bb.
  • Boot into any supported Ubuntu LiveCD/DVD/USB, and see if sound works. If sound doesn’t work there, then the problem might be with Ubuntu, your sound card (or motherboard, if the sound card is internal), or the BIOS settings. Follow heading X for more information.
  • Run the following command:
    • aplay -l
    • If it gives an output similar to this:
      aplay: device_list:221: no soundcard found...
      Then follow heading Aa.
    • If it gives an output similar to this:
      **** List of PLAYBACK Hardware Devices ****
      ALSA lib conf.c:3643:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
      ALSA lib control.c:882:(snd_ctl_open_noupdate) Invalid CTL hw:0
      aplay: device_list:249: control open (0): No such file or directory
      Then follow heading Ab.
  • If it does not give any of the 2 outputs (or similar to them), then follow heading Ac.
  • Run the following command:
    lspci -nn | grep '\[04[80][13]\]'
    • If the command gives no output at all, follow heading X.
    • If the command does give output, follow heading Ac.


Aa (Fix Audio Permissions)

  • Run the following command:
    sudo aplay -l
    • If it gives an output similar to this:
      aplay: device_list:221: no soundcard found...
      Then follow heading Ac, and if sound still doesn’t work, repeat this guide (redoing the checks).
    • If it does not give that output (or similar to it), then run:
      sudo usermod -aG `cat /etc/group | grep -e '^pulse:' -e '^audio:' -e '^pulse-access:' -e '^pulse-rt:' -e '^video:' | awk -F: '{print $1}' | tr '\n' ',' | sed 's:,$::g'` `whoami`
      Then reboot, and run this command:
      aplay -l
      You should see the devices now.
    • If still see the aplay: device_list:221: no soundcard found... output, then follow heading Ac, and if sound still doesn’t work, repeat this guide (redoing the checks).
    • If you do see the devices, and sound doesn’t work, use AlsaMixer to unmute your audio, and set it to 100%.


Ab (Reinstall libasound2)

  • Run the following command:
    sudo apt-get install --reinstall libasound2
    Your sound should work. If it doesn’t, repeat this guide (redoing the checks).


Ac (Make the system/ALSA recognize the sound card(s))

  • Run this command: (referred to in this section as the 'big one')
    echo "Sound cards recognized by the system:"; lspci -nn | grep --color=none '\[04[80][13]\]'; echo "Sound cards recognized by ALSA:"; lspci -nn | grep '\[04[80][13]\]' | while read line; do lspci -nnk | grep -A 3 '\[04[80][13]\]' | grep -e 'Kernel modules: ..*' -e '\[04[80][13]\]' | grep --color=none -F "$line"; done; echo "Sound cards recognized by ALSA, and activated:"; lspci -nn | grep '\[04[80][13]\]' | while read line; do lspci -nnk | grep -A 3 '\[04[80][13]\]' | grep -e 'Kernel drivers in use: ..*' -e '\[04[80][13]\]' | grep --color=none -F "$line"; done
    • First, make sure that Ubuntu recognizes all of your soundcards. If it doesn’t, make sure that your sound card is properly placed in its slot (you can disregard this step if it is integrated into the motherboard), and make sure that the BIOS does not disable the sound card.
    • Then, make sure that ALSA recognizes all of the sound cards that Ubuntu recognizes. If it doesn’t recognize all of them, then follow this tutorial. After that, reboot and re-run the big command above, and it should be recognized.

    • Finally, make sure that all of the sound cards recognized by ALSA are activated. If they are not all activated, get the slot number of the card that is not activated (the first field, usually something in this format (can be letters or numbers): 00:00.0), and run: (replace SLOTID by the slot id of the sound card that is not activated. If you have more than one sound card, re-run this command as many times as needed, always replacing SLOTID):
      DRIVER=`lspci -ks SLOTID | grep "Kernel modules:" | awk -F: '{print $2}' | sed 's/ *//g'`; modprobe $DRIVER && echo "$DRIVER" | sudo tee -a /etc/modules
      Reboot, re-run the big command above, and it should be activated!


Ad (Switch default sound card)

  • Run this command:
    aplay -l
    • For me, it gave this output (yours will probably differ):
      **** List of PLAYBACK Hardware Devices ****
      card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
      card 1: Generic_1 [HD-Audio Generic], device 0: VT1708S Analog
      [VT1708S Analog]
      Subdevices: 2/2
      Subdevice #0: subdevice #0
      Subdevice #1: subdevice #1
      card 1: Generic_1 [HD-Audio Generic], device 1: VT1708S Digital
      [VT1708S Digital]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    • Choose the card/device you want to have as the default card, then check the first part (card X:), and remember the bolded part. Then, check which card device you want to use (device Y:), and remember the bolded part. Edit (or create) /etc/asound.conf with your favorite text editor (as root). Put the following contents in it (replace X and Y by the card and device numbers you saw):
      pcm.!default {
      type plug slave.pcm {
      type hw card X device Y
      }
      }
    • Then save, exit and reboot.


Ae ((Make NVIDIA HDMI Audio work)

  • To install NVIDIA drivers, go to:
    • Here if you are using Ubuntu 11.04 or above.

      AdditionalDriversUnity.png

    • Here if you are using Ubuntu 11.04 Classic or below.

      AdditionalDriversGnome.png

    • Here if you are using Kubuntu.

      AdditionalDriversKde.png

    • Here if you are using Xubuntu.

      AddditionalDriversXfce.png

    • Here if you are using Lubuntu.

      AdditiionalDriversLxde.png

  • Once you have found the "additional drivers" program, a small window will appear for a short time, then disappear for this one:

    AddtionalDriversInterface.png

  • Install the recommended driver, then reboot your computer
  • Now run in a Terminal window:
    aplay -l
    • You should see an output similar to this:
      **** List of PLAYBACK Hardware Devices ****
      card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1
      Analog]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
      card 0: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1
      Digital]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
      card 1: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
      card 1: NVidia [HDA NVidia], device 7: NVIDIA HDMI [NVIDIA HDMI]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
      card 1: NVidia [HDA NVidia], device 8: NVIDIA HDMI [NVIDIA HDMI]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
      card 1: NVidia [HDA NVidia], device 9: NVIDIA HDMI [NVIDIA HDMI]
      Subdevices: 0/1
      Subdevice #0: subdevice #0
    • If you do not see the NVIDIA cards, then follow heading Ac.
  • Run:
    grep "eld_valid *1" /proc/asound/NVidia/eld*
    • You should see something like this:
      /proc/asound/NVidia/eld#X.0:eld_valid      1
  • X is a number between 0 and 3, now remember the 'eld#X.0' number.
  • Use this reference to decide what probe mask you should use:

    eld#0.0=device 3

    probe_mask=0x1

    eld#1.0=device 7

    probe_mask=0x2

    eld#2.0=device 8

    probe_mask=0x4

    eld#3.0=device 9

    probe_mask=0x8

  • Now, run your favorite text editor (as root) on /etc/modprobe.d/nvidiahdmi.conf
    • Add this line (replace 0xY by the Probe Mask number you saw for your device):
      options snd-hda-intel probe_mask=0xY
      Then save the document.
  • After that, run this Terminal command:
    sudo update-initramfs -u
  • Then run your favorite text editor (as root) on /etc/pulse/default.pa and find these lines:
    ### Load audio drivers statically (it's probably better to not load
    ### these drivers manually, but instead use module-hal-detect --
    ### see below -- for doing this automatically)
    #load-module module-alsa-sink
    #load-module module-alsa-source device=hw:1,0
    #load-module module-oss device="/dev/dsp" sink_name=output
    source_name=input
    #load-module module-oss-mmap device="/dev/dsp" sink_name=output
    source_name=input
    #load-module module-null-sink
    #load-module module-pipe-sink
    • Add at the end of it:
      load-module module-alsa-sink device=hdmi:NVidia
      Then save.
  • Run in a Terminal window:
    rm -rf ~/.pulse ~/.asound* ~/.pulse-cookie
  • Then reboot. If you still can't hear from the NVidia HDMI, then check out procedure Ad, and if it still doesn't work (after a reboot), try unmuting it with AlsaMixer.


Af (Reinstall ALSA safely)

  • Run this command:
    [ ! -f './purgeconfig.sh' ] && wget http://purgeconfig.sf.net/ purgeconfig.sh && sudo bash
    ./purgeconfig.sh alsa=base alsa-utils linux-sound-base libasound2
    • IconsPage/dont.png

    • WARNING: DO NOT RUN SYNAPTIC/APT/APTITUDE/DPKG/SOFTWARE CENTER WHILE ISSUING THIS COMMAND


Ag (Update/Reinstall Kernel)

  • Make sure that all official repos are enabled in the software sources.
  • Then run this:
    sudo apt-get update; sudo apt-get dist-upgrade
    • If there are no errors, continue.
  • Then run:
    sudo apt-get install --reinstall linux-image-`uname -r`
    and reboot.


Ba (Fix ALSA Hibernating Issue)

  • Run your favorite text editor (as root) on /etc/pm/sleep.d/50alsa
    • Enter this text:
      case "$1" in
      hibernate|suspend)
      # Stopping is not required
      ;;
      thaw|resume)
      /sbin/alsa force-reload
      ;;
      *) exit $NA
      ;;
      esac

Then save and reboot.


Bb (Enable MIDI)

  • IconsPage/important.png

  • WARNING: This procedure is experimental and not for inexperienced Ubuntu users
  • Make sure that you have a MIDI port (either one of the two) on your sound card.
  • If you are sure that your sound card has a MIDI port, check the kernel driver of the sound card with the MIDI port by this command (note that this will list the kernel drivers of all of your sound cards, so make sure that you know which sound card has the MIDI port):
    lspci -nnk | grep -A 3 '\[04[80][13]\]' | grep -e '\[04[80][13]\]' -
    e 'Kernel modules:' | sed 's/Kernel modules:/KERNEL DRIVER:/g'
    • After you have found the kernel driver for the sound card with the MIDI port, open /etc/modprobe.d/alsa-base.conf with your favorite text editor (as root).
      • Add the following line to it (replace KERNELDRIVER by the kernel driver for the sound card with the MIDI port. If you already have a line for KERNELDRIVER, add 'mpu_port=0x300' to it):
        options KERNELDRIVER mpu_port=0x330
        Save and close the file.
  • Edit /etc/modules with your favorite text editor (as root), and add the following lines to it:
    snd-seq
    snd-seq-device
    snd-seq-midi
    snd-seq-midi-event
    Save and close the file.
  • Run this command:
    sudo modprobe -a snd-seq snd-seq-device snd-seq-midi snd-seq-midi-event
  • Then reboot, and MIDI should work!


Appendix A (using a terminal)

  • Follow the tutorial here to learn how to use the terminal.


Appendix B (Using AlsaMixer)

General

  • Run this command:
    alsamixer
    This command should open up a mixer like in the screenshot:

Alsamixer.png

  • The currently selected control is the one in the red text, surrounded by <>. Use the ← and → keys to change the currently selected control.

  • The volume is the green/white/red sliders. Use the ↑ and ↓ keys to change the volume. The current volume is underneath the box.
  • The box below the volume sliders is the status. If it has a green OO, then it’s not muted, but if you see a black MM, then it’s muted. The M key is to toggle mute/unmute.
  • The grey section is a section that cannot be changed, because of some reason or another.
  • To change the sound card you are working on, press F6. It should open up a blue box.
    • Use the ↑ and ↓ keys to choose the card, and press ENTER to select it.
  • The default setting mode is Playback (F3). Recording (F4), and All (F5) are also available.
  • To exit, press ESC.

Recording

  • Press F4 to go to the recording setting mode. Here is my screenshot:

Alsamixerrecord.png

  • Recording problems almost always come from here (or if you didn't place the jacks correctly).
  • The first two options (might be more or less, depending on your sound card) are just boosts, so you'll have to play with them.
  • The last three (again, might be more or less) options are the ones that create/fix the most problems. When it captures from a level, beneath the level you will see red CAPTURE text. To disable capturing it, select it, and press SPACE.
  • The Input Source can be changed using the ↑ and ↓ keys.
  • If you want to save your settings for the next reboot, run in a terminal window (replace CARD by the card number that you are saving the settings from. You can find the card number on Alsamixer, pressing F6):

    sudo alsactl store CARD
  • Then to restore the settings you stored:
    sudo alsactl restore


Appendix C (Gather information needed to troubleshoot)

  • If the guide failed to help you with your sound problem, you can post on the Ubuntu Forums.

    • Run the following command in a Terminal window:
      wget http://www.alsa-project.org/alsa-info.sh && bash ./alsa-info.sh --upload;
      It will give you a link, so add the link to your post.


Appendix D (Make sure that the speakers are plugged in correctly)

  • One of the most common problems is that the speakers are not plugged in correctly, or the system wants to hear audio from the wrong speakers.

Jacks.png

  • You might see different images beside the jacks, but the colors rarely change.
  • Usually you would like to plug your speakers plugged in the green jack.#
  • Your microphone should almost always be plugged in the pink jack.
  • A useful way of finding what plug the jack belongs to is to match the color of the jack to the plug.



CategoryAudio

SoundTroubleshootingGuide (last edited 2017-09-06 21:23:59 by ckimes)