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: adam@lotpblog.com
- 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...
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:
- 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)
- 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.
- 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).
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:
- 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)
- 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.












0 comments:
Post a Comment