The Ubuntu Sound Problem Solution Guide


Ubuntu Linux is great for multimedia, but is has been host to it’s own sound problems. These can be very irritating to new and seasoned Ubuntu users. This will serve as a guide to help you diagnose and solve your Ubuntu sound problems. Hopefully this guide will cover most all of your Ubuntu sound issues. Some of these solutions may even apply to other distributions of Linux, but I’m not writing this guide with that expectation nor do I make any guarantees of the sort.

A Few Brief Warnings Before We Begin

  • It can’t be guaranteed that these solutions will work for everyone.
  • If you have any suggestions to improve this guide please post a comment or contact me at: [email protected]
  • If you fail to find the solution to your problem in this guide and find the solution elsewhere please let me know so I may add the solution to this guide so that it can help others.
  • If you can’t hear anything after installing Ubuntu then it very well could be a bug and you should consider the possibility of submitting a bug report. The Ubuntu developers need your feedback in order to keep improving upon the operating system.
  • In the realm of this guide Ubuntu mean Ubuntu, kubuntu, and xubuntu.
General (A place for when you have no clue to what the problem is)
(1) Go to the shell and type:
aplay -l
  • Success: You will get a list of all the soundcards installed on your system. This means that your sound could possibly just be muted. See the alsamixer section.
  • Failure: You will get a message similiar to:  (move to step 2)
  • aplay: device_list: 221: no soundcard found…

(2) Type the following into the shell:

lspci -v
  • Success: At this point you should see your soundcard listed. This is a good sign because it means that Ubuntu is detecting your soundcard. It does, however, mean that the drivers are not installed/running.
  • Faliure: If your soundcard is not listed then there a couple of things that can be done:
    1. If you have an onboard soundcard then it may be disabled in your system’s BIOS. Reboot and hit the key that enters your bios (usually the F2 key)
    2. If you do not use onbard audio than double check that the sound card is seated properly in the PCI/PCI-E slot. If your card was working under another OS then this is not an issue.

(3) Check if the ALSA driver for your soundcard exists. Go to http://www.alsa-project.org/main/index.php/Matrix:Main and search for your sound card (chipset) manufacturer. You will receive a matrix of the soundcards made by that manufacturer. Match the chipset you found in step 2with the driver.

  • Success: You have found the driver for your soundcard’s chipset
  • Failure: You have note found the driver for your chipset (In which case I can’t help you at the moment).

(4) Go back to shell and type:

sudo modprobe snd-
Press the TAB key BEFORE pressing the enter key to see a list of modules. Try to find the module that matched the driver that you found in step 3.
  • Success: This means that your souncard is installed, but it was not being loaded. Now you have to load it for the current session. To load it for all sessions (This is probably a good idea) you will need to edit /etc/modules.  To do this type this into shell:
sudo nano /etc/modules
  • Add only the name of the module to be loaded at the end of the file. Now just go onto Saving Sound Settings.
  • Failure: There are two options in this case:
    1. Move on to Getting the ALSA drivers from a *fresh* kernel. This is recommended for users that were tinkering with there sound settings and want to go back to the way it was just after installing Ubuntu (without having to reinstall Ubuntu)
    2. Move on to ALSA driver Compilation
Getting the ALSA drivers from a *fresh* kernel
Sometimes the sound was configured correctly, but our tinkering caused it to stop working for some reason or another. To go back to the old setup you could reinstall Ubuntu, but this is quite unnecessary. A much faster way is to just remove the problematic packages and reinstall them.
(1) Remove the packages:
sudo apt-get –purge remove linux-sound-base alsa-base alsa-utils
(2) Reinstall the same packages:
sudo apt-get install linux-sound-base alsa-base alsa-utils
IMPORTANT NOTE: Ubuntu (GNOME) users have reported that the packages ‘gdm’ and ‘ubuntu-desktop’ are removed after uninstalling the ‘linux-sound-base’ packages. If this happens then just run the following:
sudo apt-get install gdm ubuntu-desktop
(3) Reboot
IMPORTANT NOTE: Xubnut (XFCE) users have reported that the packages ‘gdm’ and ‘xubuntu-desktop’ are removed after uninstalling the linux-sound-base packages. If this happens then just run the following:
sudo apt-get install gdm xubuntu-desktop
(3) Reboot
The secret here is the –purge option. This removes all the extra information accumulated from tinkering and causes the packages to be reinstalled in a completely clean state.
(4) Run the following command:
aplay -l
  • Success: Your soundcard is detected. Move onto the Using alsamixer section the try playing something on your computer.
  • Failure: Your soundcard was not detected. You should try compiling your driver. Move onto ALSA driver compilation.
ALSA driver compilation
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. There are two ways that ALSA drivers are made available to you. One is through the apt-get system. This is the recommended system since most of the hard stuff is done for you. The other way is  getting the latest drivers from alsa-project.org. This page has the latest drivers available, but these have not been tested with Ubuntu and should therefore be used with caution.
Using alsa-source
1. Type the following into shell (module-assistant is optional. It will compile packages for you):
sudo apt-get install build-essential linux-headers-$(uname -r) module-assistant alsa-source
2.
sudo dpkg-reconfigure alsa-source
3. You should now have a big blue dialog box. Answer yes (for ISA-PNP - recommended by package maintainers), then yes again (for debugging - recommended by package maintainers).
4. Now you must pick what driver to install. Use space to select and deselect modules, and up and down to navigate. You should know your driver from General step 3. Deselect all and navigate to and select your driver. Hit enter.
6. If you chose module-assistant:
sudo module-assistant a-i alsa-source
If the progress bar reaches 100% without any errors you have installed the drivers successfully. Resume the guide from General Step 4.
If you didn’t choose module-assistant:
Remember the name of your driver and substitute it in place of the blue text below:
cd /usr/src sudo tar xjvf alsa-driver.tar.bz2 cd modules/alsa-driver
sudo ./configure –with-kernel=/usr/src/linux-headers-$(uname -r) –with-cards= –with oss=yes
sudo make install
If you don’t get any error messages then you have successfully installed the drivers.
  • Success: Resume the guide from General step 4
  • Failure: Please inform of the error you received so I may help.
Using ALSA mixer
Type the following into shell:
alsamixer
You will now see a graphical equilizer. Use your arrow keys to navigate left and right. Up and down keys will raise and lower the volume respectively. ‘M’ mutes and unmutes. There is also a program that you can install called “Gnome ALSA Mixer” that may be easier for some users to use.
Saving sound settings
Do this to ensure that your ALSA sound settings are reloaded on every boot. First be sure your settings are the way you want them in alsa mixer. Then run:
sudo alsactl store 0
or if this is your nth soundcard (n being your number of soundcards) then replace 0 with n-1.
Configuring default soundcards
Run the following:
cat /proc/asound/modules
This will give you the name and index of each soundcard you currently have. Make a note of their names, and decide which one you want to be the default.
Type:
sudo nano /etc/modprobe.d/alsa-base
At the very end of the file add: (This assumes 3 sound cards (ABC) ordered CAB)
options snd-C index=0
options snd-A index=1
options snd-B index=2
Adding the current user to the audio group
One very common cause of a user not having sound is not having the username in the /etc/group. To check run:
grep ‘audio’ /etc/group
You should see a line similar to:
audio: x:29:
followed by a username. If not you can add your username to the file by running:
sudo nano /etc/group
Search for a line that looks something like:
audio:x:29:root
Change it to:
audio:x:29:root:username
Replace username with your actual username. Hit CTRL + O to save then CTRL + X to exit.
I hope that this was able to help you solve your Ubuntu sound problems. If not please leave a comment so we may help you. As I said at the beginning this will not solve everyone’s problems.

About Adam Thompson

An enigma wrapped in a riddle, Adam is a mysterious character. Said to be part cyborg, Adam is known for his superhuman abilities with technology and science. Adam is a Linux guru who designs and builds operating systems for giggles.
  • Pingback: No sound on Ubuntu 10.04 LTS

  • Tony Heskett

    This link works, but doesn’t give a search box:

    Go to http://www.alsa-project.org/alsa-doc/ and search for your sound card (chipset) manufacturer in the dropdown box.

  • http://lotphelp.com Adam

    Thanks for pointing that out. They actually moved it to a wiki, so you can find the information here:
    http://www.alsa-project.org/main/index.php/Matrix:Main
    This has been fixed in the above article as well.

  • VirLad

    it was very interesting to read.
    I want to quote your post in my blog. It can?
    And you et an account on Twitter?

  • http://lotphelp.com Adam

    Our Twitter account is @penguinland
    You can quote from articles as long as proper citation is given so that credit is given where credit is deserved and the article isn’t being down right copied from our blog.

  • Pingback: Error while installing sound driver

  • Pingback: Error while installing sound driver | Coders & Admins

  • Pingback: Linux Mint 12 - no sound - Page 2

  • Juliocesar_jcm

    Thank you very much! Now my computer is working very fine!!

  • http://www.facebook.com/profile.php?id=581979560 Raphaël Jubin

    Hello,
    togivean exempleon howit works. And indeed it worked for me ! under Ubuntu 11.10.
    Some remarks about your guide : 
    – I’ve an *Intel 82801DB-ICH4* card, recognized as a ICH 4 serie card

    – sudo modprobe snd-should be in fact :sudo modprobe snd_intel8x0doing the TAB doesn’ t give options
    – doing    aplay -l    I get :
    # aplay -l**** List of PLAYBACK Hardware Devices ****card 0: I82801DBICH4 [Intel 82801DB-ICH4], device 0: Intel ICH [Intel 82801DB-ICH4]  Subdevices: 0/1  Subdevice #0: subdevice #0card 0: I82801DBICH4 [Intel 82801DB-ICH4], device 4: Intel ICH – IEC958 [Intel 82801DB-ICH4 - IEC958]  Subdevices: 1/1  Subdevice #0: subdevice #0

    – doing  lspci -v    I get :
    # lspci | grep -5 audio Subsystem: IBM ThinkPad Flags: medium devsel, IRQ 11 I/O ports at 1880 [size=32] Kernel modules: i2c-i80100:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC’97 Audio Controller (rev 01) Subsystem: IBM Device 0534 Flags: bus master, medium devsel, latency 0, IRQ 11 I/O ports at 1c00 [size=256] I/O ports at 18c0 [size=64] Memory at c0000c00 (32-bit, non-prefetchable) [size=512]

    – In the modeprobe file, I add :
    sudo nano /etc/modprobe.d/alsa-baseAt the very end of the file add: (This assumes 3 sound cards (ABC) ordered CAB)options snd_intel8x0 index=0

    – adding a user to the ‘audio group’, as you should have titled it, was done by using commas and not colons, as I took note on how it was done for other groups :

    sudo nano /etc/groupSearch for a line that looks something like:audio:x:29:root
    Change it to:audio:x:29:pulse,username,root

    – Allow me a comment : good guide, could be better structured into chapters. Some adaptation  for each step to suit last versions. I strongly expect it’s mainly a question of adding the user to the ‘audio group’ most of the time.
    Thanks.

  • http://www.facebook.com/profile.php?id=581979560 Raphaël Jubin

    Your comment system doesn’t take into account ‘linefeeds’, making the comments look compacted

  • Alf

    Thanks for your help. In the alsa purge remove instruction above, a hyphen is omitted ,i.e. should be –purge. This tiny thing could derail a fix for some.
    BTW, when I grepped etcgroup I did get audioX29, but when I nanoed it, no audio entry to add username to..so still after 2 weeks fail to restore sound for my  main OS (ext.drive Lucid), whilst secondary OS (onboard Maverick) is unaffected by whatever it is.

  • Ana

    Worked fine for me,
    apparently it had somehow muted the alsamixer and the output was wrong.

  • nasibi

    worked for me. but instead of audio:x:root i had audio:x:29:pulse. i changed as per your recommendation any way