个人工具

“UbuntuHelp:HdaIntelSoundHowto”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/HdaIntelSoundHowto}} {{Languages|UbuntuHelp:HdaIntelSoundHowto}} === Booting === If your boot hangs on loading the module for snd-hda-intel, try ...)
 
 
(未显示同一用户的9个中间版本)
第2行: 第2行:
 
{{Languages|UbuntuHelp:HdaIntelSoundHowto}}
 
{{Languages|UbuntuHelp:HdaIntelSoundHowto}}
 
=== Booting ===
 
=== Booting ===
 
 
If your boot hangs on loading the module for snd-hda-intel, try disabling the card in your BIOS. It is called "HD Audio Controller", "Azalia Audio" or similar. Then try solving the problem using the instructions below.
 
If your boot hangs on loading the module for snd-hda-intel, try disabling the card in your BIOS. It is called "HD Audio Controller", "Azalia Audio" or similar. Then try solving the problem using the instructions below.
 
+
=== Identify the Problem ===
=== Identify the problem ===
+
 
+
 
Most cards seem to work as of Ubuntu 6.06 LTS using the stock kernel. However, the following problems might occur on some setups:
 
Most cards seem to work as of Ubuntu 6.06 LTS using the stock kernel. However, the following problems might occur on some setups:
 
 
* No sound at all
 
* No sound at all
 
* Low volume output
 
* Low volume output
第14行: 第10行:
 
* Poor sound quality
 
* Poor sound quality
 
* Sound disappears when touching volume controls
 
* Sound disappears when touching volume controls
* Sound works at random after each reboot (possibly flavour 'm2-2' below)
+
* Sound works at random after each reboot
 
+
* No mic working
=== Possible easy fix ===
+
* Sound only plays through headphones or internal speakers (not through attached audio sets)
 
+
=== Manually Specify Module Parameters ===
The following command seems to fix some problems (specifically volume/sound quality) but may need to be run after each reboot (see bug #92171, https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/92171)
+
* First you must find which model of sound card you use, so run this command:
 
+
<pre><nowiki>
kill $(lsof -t /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*) ; sudo modprobe -r $(lsmod |grep ^snd |awk '{print $1}') && sudo modprobe snd-hda-codec && sudo modprobe snd-hda-intel model=auto
+
cat /proc/asound/card0/codec#* | grep Codec
 
+
</nowiki></pre>
=== Update to the latest version of alsa ===
+
It will return model of your sound card(s), for example: "Codec: Realtek ALC260", so your sound card is ALC260.
 
+
* You should open a file in ALSA documentation. This file is here:
 +
<pre><nowiki>
 +
/usr/share/doc/alsa-base/driver/HD-Audio-Models.txt.gz
 +
</nowiki></pre>
 +
or if that file does not exist, try:
 +
<pre><nowiki>
 +
/usr/share/doc/alsa-base/driver/ALSA-Configuration.txt.gz
 +
</nowiki></pre>
 +
(If you compiled your own kernel or ALSA modules, the documentation for your version can probably be found in the source package you used)
 +
* Search for your model, and take a look at its types, for example I found the following lines for ALC260:
 +
<pre><nowiki>
 +
hp HP machines
 +
hp-3013 HP machines (3013-variant)
 +
fujitsu Fujitsu S7020
 +
acer Acer TravelMate
 +
basic fixed pin assignment (old default model)
 +
auto auto-config reading BIOS (default)
 +
</nowiki></pre>
 +
Read all of them and try to find the one which is more similar to your sound card, for example if you have a laptop, you can choose "acer".
 +
* Open /etc/modprobe.d/alsa-base with the following command:
 +
<pre><nowiki>
 +
sudo nano /etc/modprobe.d/alsa-base
 +
</nowiki></pre>
 +
* In Ubunty Jaunty and more recent, the file ends with .conf :
 +
<pre><nowiki>
 +
sudo nano /etc/modprobe.d/alsa-base.conf
 +
</nowiki></pre>
 +
Then paste the following line at the end of the file (change MODEL with the type of sound card's model, in our example it should be "acer" (without quotation marks)):
 +
<pre><nowiki>
 +
options snd-hda-intel model=MODEL
 +
</nowiki></pre>
 +
* Reboot
 +
Suitable options for many popular laptop models can be found in [http://ubuntuforums.org/showthread.php?t=1043568 this forum thread]
 +
==== Example ====
 +
I'd like to add an example to clarify: my mic di not work under Ubuntu (whereas playback did and the mic itself worked under Vista). I actually found out that my Realtek audio codec was ALC269 by typing
 +
<pre><nowiki>
 +
cat /proc/asound/card0/pcm0c/info
 +
</nowiki></pre>
 +
(and/or by looking into Vista Control Panel (Sound)). Looking at the ALSA-Configuration.txt this corresponds to model basic, so I added
 +
<pre><nowiki>
 +
options snd-hda-intel model=basic
 +
</nowiki></pre>
 +
at the end of /etc/modprobe.d/alsa-base and rebooted.
 +
==== Playing with probe_mask ====
 +
Another possible option is the 'probe_mask' parameter, which has been known to fix sound
 +
issues characterized by the occurrence of "azx_get_response timeout, switching to single_cmd mode" messages reported with
 +
'dmesg'.  Try either "probe_mask=1" or "probe_mask=8" by adding a line like:
 +
<pre><nowiki>
 +
options snd-hda-intel probe_mask=1
 +
</nowiki></pre>
 +
For detailed information about this problem, see [http://www.kernel.org/pub/linux/kernel/people/tiwai/docs/HD-Audio.html More Notes on HD-Audio Driver by Takashi Iwai], section 2.2. "Codec-Probing Problem".
 +
=== Choosing Your Model ===
 +
The full list of models is available in ALSA-Configuration.txt in the subdirectory /alsa-kernel/Documentation/ of the alsa-driver-1.0.14 directory you created. Note that this list is ordered on modules and codec chips. To find your codec use this command from a terminal:
 +
<pre><nowiki>
 +
cat /proc/asound/card0/codec#*
 +
</nowiki></pre>
 +
If one of those worked but was not autodetected, you can help the alsa developers by sending them the output of lspci -nv and the model you used on [http://bugtrack.alsa-project.org Alsa BTS].
 +
=== Extra Hints to Get Sound Working ===
 +
'''Wrong mixer in use:''' Sometimes the volume control chooses the OSS mixer if the compatibility module is loaded. You may need to right click on the volume control applet in your gnome-panel and go to the preferences and change the device to the one called Alsa Mixer. The same applies to the gnome volume control program.
 +
'''Mixer doesn't seem to work:''' The HD Audio standard has many output channels. As a result, the correct volume sliders might not be visible. Enable the volume sliders through Edit->Preferences in gnome volume control.
 +
'''No mic working, rest OK: ''' After installing and configuring the Intel-SigmaTel STAC 9205 soundcard in my DELL Latitutde D630 as described above, I could use xmms to play sound on this machines. The microphone did, however, not work. To make the mic work as well, I booted Win XP on the same machine, plugged the microphone in and selected Microphone instead of the menu items "Line-In" or "No action" in the Intel-SigmaTel event window. That event window was opened by the Win XP soundcard driver when I plugged in the microphone. I then booted ubuntu 7.04 with alsa-driver-1.0.15-rc3 and used alsamixer to make the following changes:
 +
Front-Gain: 94<>94, both Input Sources = Front Mic, then pressed F4 and set the 2 captures to 100<>100 and to 93<>93. Eventually, I pressed Esc to end alsamixer and save my changes. After these steps, I could use arecord -f cd out.wav to record sound using my microphone. BTW, I used "options snd-hda-intel model=auto" as the last line of /etc/modprobe.d/alsa-base for this particular soundcard and OS.
 +
I too had a problem with mic not working with playback OK, and it turned out that (probably due to model mismatch in '''snd-hda-intel''' options) the capture volume controls were mislabeled and the slider that was responsible for the microphone was the one with "Digital" caption. "Capture" and "Capture1" didn't control the recording regardless of recording devices chosen for those channels in "Input Source" and "Input Source 1".
 +
On the ASUS A7J (audio chip Realtek ALC882), I got a problem with the front mic after updating to Jaunty. To enable the microphone, I had to select "Mic" (and not "Front mic") in the option tab as first capture device. It's probably as well a labeling issue. Contact me (skadge -at- gmail -dot- com) if you have the same issue.
 +
=== Solution for Apple Macs ===
 +
In case of slightly distorted, weird, crackled sound on Apple Macs it have been reported by several users, that unload '''snd_hda_intel''' module at boot time and then reload it, can help to get rid of crackled sound. For do this, edit '''/etc/rc.local''' by typing in [[UbuntuHelp:UsingTheTerminal|Terminal]] <pre><nowiki>
 +
gksudo gedit /etc/rc.local
 +
</nowiki></pre>
 +
And add two following lines to the end of file before "exit 0":
 +
<pre><nowiki>
 +
rmmod snd_hda_intel
 +
modprobe snd_hda_intel
 +
</nowiki></pre>
 +
- This fix also worked for me using a Fujitsu Siemens Amilo Si 1520 laptop, Codec: Conexant CX20549 (Venice), using Ubuntu 8.10. The sound worked out of the box, but it was weird and distorted. After removing the module and adding it again, the sound is back to normal. -- [[UbuntuHelp:LaunchpadHome:mairabc|LaunchpadHome:mairabc]] <<DateTime(2008-11-27T09:32:33Z)>>
 +
- One more update: at some point it seemed that the sound was distorting again. In fact, the problem is that I was using too high volume levels. Checking [http://ubuntuforums.org/showpost.php?p=6350000&postcount=1267 this forum post] and [http://alsa.opensrc.org/index.php/TroubleShooting#Sound_can_be_heard_but_it_is_distorted this guide], I've managed to get a configuration that seems to work fine. Use alsamixer to set the PCM level to below 50, and use only the Master channel to control the volume. Save your settings so that they keep the same after boot by running
 +
<pre><nowiki>
 +
$ sudo alsactl store 0
 +
</nowiki></pre>
 +
Sound is no longer distorted, though it is somewhat low. I guess the speakers are not powerful enough to handle more than that.
 +
(Note: using Ubuntu 8.10, kernel 2.6.27-11-generic, alsa 1.0.17 provided by the official packages.) -- [[UbuntuHelp:LaunchpadHome:mairabc|LaunchpadHome:mairabc]] <<DateTime(2009-03-27T20:10:27+0140)>>
 +
=== Update to the Latest Version of ALSA ===
 +
'''Update: The build instructions in this paragraph are outdated. For Ubuntu 8.04 and 8.10 (at least) following the these instructions won't work.  Please see http://ubuntuforums.org/showthread.php?t=962695 for a convenient script that will build the latest ALSA release.  Also, it is recommended that you see the more generic [[UbuntuHelp:SoundTroubleshooting|SoundTroubleshooting]] page for information on how to update audio drivers.'''
 
{|border="1" cellspacing="0"
 
{|border="1" cellspacing="0"
|<rowbgcolor="#FFFFE0"> {i} These instructions do not interfere with the Ubuntu package structure or other kernel modules - in other words, the changes seem drastic however they are simply adding greater functionality to an existing kernel module  
+
| {i} As of Ubuntu 6.06, these instructions do not interfere with the Ubuntu package structure or other kernel modules - in other words, the changes seem drastic however they are simply adding greater functionality to an existing kernel module (Please read the Caveats section!)
 
|}
 
|}
 
+
* Install the required tools and kernelheaders
* Install the required tools
+
 
+
 
<pre><nowiki>
 
<pre><nowiki>
sudo apt-get install build-essential ncurses-dev
+
sudo aptitude install build-essential libncurses-dev gettext xmlto xmltoman linux-headers-`uname -r`
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Install your kernel headers
 
* Install your kernel headers
 
+
* Download the latest version of alsa from [http://www.alsa-project.org/ Alsa project] (driver, lib, and utils) to a directory (eg. ~/downloads). In the following we assume that the latest version is 1.0.14. Please change this in accordance with the one you downloaded from the Alsa project site.
<pre><nowiki>
+
* [ftp://ftp.alsa-project.org/pub/driver/ alsa-driver]
sudo apt-get install linux-headers-`uname -r`
+
* [ftp://ftp.alsa-project.org/pub/lib/ alsa-lib]
</nowiki></pre>
+
* [ftp://ftp.alsa-project.org/pub/utils/ alsa-utils]
 
+
* Download the latest version of alsa from [http://www.alsa-project.org Alsa project] (driver, library, and utils) to a directory (eg. /home/naaman/installers/alsa)
+
 
+
** [http://www.alsa-project.org/alsa/ftp/driver/ alsa-driver]
+
** [http://www.alsa-project.org/alsa/ftp/lib/ alsa-lib]
+
** [http://www.alsa-project.org/alsa/ftp/utils/ alsa-utils]
+
 
+
 
* Setup installation directories
 
* Setup installation directories
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo mkdir -p /usr/src/alsa
 
sudo mkdir -p /usr/src/alsa
 
cd /usr/src/alsa
 
cd /usr/src/alsa
sudo cp /home/naaman/installers/alsa/* .
+
sudo cp ~/downloads/alsa* .
sudo tar xjf alsa-driver-1.0.14rc1.tar.bz2
+
sudo tar xjf alsa-driver*.bz2
sudo tar xjf alsa-lib-1.0.14rc1.tar.bz2
+
sudo tar xjf alsa-lib*.tar.bz2
sudo tar xjf alsa-utils-1.0.14rc1.tar.bz2
+
sudo tar xjf alsa-utils*.tar.bz2
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Compile and install alsa-driver
 
* Compile and install alsa-driver
 
 
<pre><nowiki>
 
<pre><nowiki>
cd alsa-driver-1.0.14rc1
+
cd alsa-driver*
sudo ./configure --with-cards=hda-intel
+
sudo ./configure --with-cards=hda-intel --with-kernel=/usr/src/linux-headers-$(uname -r)
 
sudo make
 
sudo make
 
sudo make install
 
sudo make install
 
</nowiki></pre>
 
</nowiki></pre>
 
+
-- The configure step fails in Ubuntu 8.10 with the kernel 2.6.27-7. The configure script is unable to find the autoconf.h file and complains that it wants the full kernel sources. Aditya
 +
-- The configure step will work on Ubuntu 8.10 if the --with-kernel option is removed.  After installing the linux-source package, the ALSA driver can be configured for Ubuntu 8.10 with this command: sudo ./configure --with-cards=hda-intel
 
* Compile and install alsa-lib
 
* Compile and install alsa-lib
 
 
<pre><nowiki>
 
<pre><nowiki>
cd ../alsa-lib-1.0.14rc1
+
cd ../alsa-lib*
 
sudo ./configure
 
sudo ./configure
 
sudo make
 
sudo make
 
sudo make install
 
sudo make install
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Compile and install alsa-utils
 
* Compile and install alsa-utils
 
 
<pre><nowiki>
 
<pre><nowiki>
cd ../alsa-utils-1.0.14rc1
+
cd ../alsa-utils*
 
sudo ./configure
 
sudo ./configure
 
sudo make
 
sudo make
 
sudo make install
 
sudo make install
 
</nowiki></pre>
 
</nowiki></pre>
 
+
Note that you must have the curses library installed to be able to compile alsa-utils. You can install it with this command from a terminal: sudo apt-get install libncurses5-dev
 
* Reboot
 
* Reboot
 
+
* if you have no sound, run dmesg and look for the string "snd_"
=== Manually specify which flavor you are using ===
+
=== Troubleshooting ===
 
+
==== dmesg shows "disagrees about version of symbol" and "Unknown symbol" for snd_ctl_add, etc ====
If your sound still doesn't work after installing the latest alsa, it is likely that it was unable to autodetect your flavour.
+
if you reboot and have no sound, and check dmesg to find:
 
+
* Edit the file /etc/modprobe.d/alsa-base
+
 
+
 
<pre><nowiki>
 
<pre><nowiki>
gksudo gedit /etc/modprobe.d/alsa-base
+
[ 1058.932000] snd_hda_intel: disagrees about version of symbol snd_ctl_add
 +
[ 1058.932000] snd_hda_intel: Unknown symbol snd_ctl_add
 +
[ 1058.932000] snd_hda_intel: disagrees about version of symbol snd_pcm_new
 +
[ 1058.932000] snd_hda_intel: Unknown symbol snd_pcm_new
 +
[ 1058.932000] snd_hda_intel: disagrees about version of symbol snd_pcm_limit_hw_rates
 +
[ 1058.932000] snd_hda_intel: Unknown symbol snd_pcm_limit_hw_rates
 +
[ 1058.932000] snd_hda_intel: disagrees about version of symbol snd_card_register
 +
[ 1058.932000] snd_hda_intel: Unknown symbol snd_card_register
 
</nowiki></pre>
 
</nowiki></pre>
 
+
... etc. then you need to do a few extra steps.
* Add the following line to the file, replacing '3stack' with your flavor (see below)
+
ubuntu default snd-hda-intel.ko location:
 
+
/lib/modules/2.6.22-14-generic/ubuntu/media/snd-hda-intel/snd-hda-intel.ko
 +
alsa 1.0.15's installation location:
 +
/lib/modules/2.6.22-14-generic/kernel/sound/pci/hda/snd-hda-intel.ko
 +
so copy /lib/modules/2.6.22-14-generic/kernel/sound/pci/hda/snd-hda-intel.ko to /lib/modules/2.6.22-14-generic/ubuntu/media/snd-hda-intel/snd-hda-intel.ko .
 +
and put the modules/* in alsa's compile directory into /lib/modules/.../kernel/sound, you can use "find" to get their location.
 +
snd-hda-intel.ko
 +
snd-hwdep.ko
 +
snd.ko
 +
snd-mixer-oss.ko
 +
snd-page-alloc.ko
 +
snd-pcm.ko
 +
snd-pcm-oss.ko
 +
snd-rtctimer.ko
 +
snd-seq-device.ko
 +
snd-seq.ko
 +
snd-seq-midi-event.ko
 +
snd-seq-oss.ko
 +
snd-timer.ko
 +
then, depmod -a
 +
reboot, try again.
 +
(Thanks to [http://ubuntuforums.org/member.php?u=5092 forum user pcmanlin] on [http://ubuntuforums.org/showthread.php?t=577699 this ubuntu forum thread])
 +
==== alsa-utils don't compile ====
 +
If you have trouble compiling alsa-utils simply run
 
<pre><nowiki>
 
<pre><nowiki>
options snd-hda-intel model=3stack
+
alsactl -v
 
</nowiki></pre>
 
</nowiki></pre>
 
+
and it will show you the installed version. Check on http://www.alsa-project.org/ if your card is supported in that version and download the source packages. Go back to the "Setup installation directories" step above and try again.
* Reboot
+
=== Caveats ===
 
+
Overwriting packaged files and adding unmanaged files by running ''sudo make install'' may break upgrades. A better way is to create a backport by using the build scripts from your current alsa source packages. This would also allow you to undo the changes if they don't work, by simply downgrading back to the original package version.
==== Choosing your flavour ====
+
=== Links ===
 
+
[http://www.kernel.org/pub/linux/kernel/people/tiwai/docs/HD-Audio.html More Notes on HD-Audio Driver by Takashi Iwai] - excellent document that explains many issues with the snd-hda-intel driver written by one of the module's authors.
You can try some flavours which have a good chanche of working with your setup. '3stack' works for many motherboard integrated chips with shared surrounds. Other models include '5stack', '6stack', 'laptop' and 'laptop-eapd'.
+
=== Another solution ===
 
+
Check if your device card model is a Realtek and download alsa from Realtek site:
Sometimes it is also possible to use the more generic 'ref' flavour, which the hda driver uses to load manufacturer specfic presets (SigmaTel, Realtek, etc.).
+
<pre><nowiki>
 
+
cat /proc/asound/card0/codec#* | grep Codec
==== Flavour m2-2 ====
+
Codec: Realtek ALC888
 
+
</nowiki></pre>
If your sound sometimes just doesn't work when you boot up, but works again after a reboot (or 2 or 3), you may have the 'm2-2' flavour.
+
[http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=24&PFid=24&Level=4&Conn=3&DownTypeID=3&GetDown=false#High%20Definition%20Audio%20Codecs Realtek High Definition Audio Codecs]
 
+
Explained at this [http://ubuntuforums.org/showthread.php?t=534070 ubuntu forums] thread
==== More flavours ====
+
 
+
The full list of flavours is available in ALSA-Configuration.txt in the driver tarball under alsa-kernel/Documentation/. If one of those worked but was not autodetected, you can help the alsa developers by sending them the output of lspci -nv and the model you used on [http://bugtrack.alsa-project.org Alsa BTS].
+
 
+
=== Extra hints to get sound working ===
+
 
+
'''Wrong mixer in use:''' Sometimes the volume control chooses the OSS mixer if the compatibility module is loaded. You may need to right click on the volume control applet in your gnome-panel and go to the preferences and change the device to the one called Alsa Mixer. The same applies to the gnome volume control program.
+
 
+
'''Mixer doesn't seem to work:''' The HD Audio standard has many output channels. As a result, the correct volume sliders might not be visible. Enable the volume sliders through Edit->Preferences in gnome volume control.
+
 
----
 
----
 
[[category:CategoryHardware]]
 
[[category:CategoryHardware]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月19日 (三) 22:39的最新版本


Booting

If your boot hangs on loading the module for snd-hda-intel, try disabling the card in your BIOS. It is called "HD Audio Controller", "Azalia Audio" or similar. Then try solving the problem using the instructions below.

Identify the Problem

Most cards seem to work as of Ubuntu 6.06 LTS using the stock kernel. However, the following problems might occur on some setups:

  • No sound at all
  • Low volume output
  • High pitched noise
  • Poor sound quality
  • Sound disappears when touching volume controls
  • Sound works at random after each reboot
  • No mic working
  • Sound only plays through headphones or internal speakers (not through attached audio sets)

Manually Specify Module Parameters

  • First you must find which model of sound card you use, so run this command:
cat /proc/asound/card0/codec#* | grep Codec

It will return model of your sound card(s), for example: "Codec: Realtek ALC260", so your sound card is ALC260.

  • You should open a file in ALSA documentation. This file is here:
/usr/share/doc/alsa-base/driver/HD-Audio-Models.txt.gz

or if that file does not exist, try:

/usr/share/doc/alsa-base/driver/ALSA-Configuration.txt.gz

(If you compiled your own kernel or ALSA modules, the documentation for your version can probably be found in the source package you used)

  • Search for your model, and take a look at its types, for example I found the following lines for ALC260:
hp		HP machines
hp-3013		HP machines (3013-variant)
fujitsu		Fujitsu S7020
acer		Acer TravelMate
basic		fixed pin assignment (old default model)
auto		auto-config reading BIOS (default)

Read all of them and try to find the one which is more similar to your sound card, for example if you have a laptop, you can choose "acer".

  • Open /etc/modprobe.d/alsa-base with the following command:
sudo nano /etc/modprobe.d/alsa-base
  • In Ubunty Jaunty and more recent, the file ends with .conf :
sudo nano /etc/modprobe.d/alsa-base.conf

Then paste the following line at the end of the file (change MODEL with the type of sound card's model, in our example it should be "acer" (without quotation marks)):

options snd-hda-intel model=MODEL
  • Reboot

Suitable options for many popular laptop models can be found in this forum thread

Example

I'd like to add an example to clarify: my mic di not work under Ubuntu (whereas playback did and the mic itself worked under Vista). I actually found out that my Realtek audio codec was ALC269 by typing

cat /proc/asound/card0/pcm0c/info

(and/or by looking into Vista Control Panel (Sound)). Looking at the ALSA-Configuration.txt this corresponds to model basic, so I added

options snd-hda-intel model=basic

at the end of /etc/modprobe.d/alsa-base and rebooted.

Playing with probe_mask

Another possible option is the 'probe_mask' parameter, which has been known to fix sound issues characterized by the occurrence of "azx_get_response timeout, switching to single_cmd mode" messages reported with 'dmesg'. Try either "probe_mask=1" or "probe_mask=8" by adding a line like:

options snd-hda-intel probe_mask=1

For detailed information about this problem, see More Notes on HD-Audio Driver by Takashi Iwai, section 2.2. "Codec-Probing Problem".

Choosing Your Model

The full list of models is available in ALSA-Configuration.txt in the subdirectory /alsa-kernel/Documentation/ of the alsa-driver-1.0.14 directory you created. Note that this list is ordered on modules and codec chips. To find your codec use this command from a terminal:

cat /proc/asound/card0/codec#*

If one of those worked but was not autodetected, you can help the alsa developers by sending them the output of lspci -nv and the model you used on Alsa BTS.

Extra Hints to Get Sound Working

Wrong mixer in use: Sometimes the volume control chooses the OSS mixer if the compatibility module is loaded. You may need to right click on the volume control applet in your gnome-panel and go to the preferences and change the device to the one called Alsa Mixer. The same applies to the gnome volume control program. Mixer doesn't seem to work: The HD Audio standard has many output channels. As a result, the correct volume sliders might not be visible. Enable the volume sliders through Edit->Preferences in gnome volume control. No mic working, rest OK: After installing and configuring the Intel-SigmaTel STAC 9205 soundcard in my DELL Latitutde D630 as described above, I could use xmms to play sound on this machines. The microphone did, however, not work. To make the mic work as well, I booted Win XP on the same machine, plugged the microphone in and selected Microphone instead of the menu items "Line-In" or "No action" in the Intel-SigmaTel event window. That event window was opened by the Win XP soundcard driver when I plugged in the microphone. I then booted ubuntu 7.04 with alsa-driver-1.0.15-rc3 and used alsamixer to make the following changes: Front-Gain: 94<>94, both Input Sources = Front Mic, then pressed F4 and set the 2 captures to 100<>100 and to 93<>93. Eventually, I pressed Esc to end alsamixer and save my changes. After these steps, I could use arecord -f cd out.wav to record sound using my microphone. BTW, I used "options snd-hda-intel model=auto" as the last line of /etc/modprobe.d/alsa-base for this particular soundcard and OS. I too had a problem with mic not working with playback OK, and it turned out that (probably due to model mismatch in snd-hda-intel options) the capture volume controls were mislabeled and the slider that was responsible for the microphone was the one with "Digital" caption. "Capture" and "Capture1" didn't control the recording regardless of recording devices chosen for those channels in "Input Source" and "Input Source 1". On the ASUS A7J (audio chip Realtek ALC882), I got a problem with the front mic after updating to Jaunty. To enable the microphone, I had to select "Mic" (and not "Front mic") in the option tab as first capture device. It's probably as well a labeling issue. Contact me (skadge -at- gmail -dot- com) if you have the same issue.

Solution for Apple Macs

In case of slightly distorted, weird, crackled sound on Apple Macs it have been reported by several users, that unload snd_hda_intel module at boot time and then reload it, can help to get rid of crackled sound. For do this, edit /etc/rc.local by typing in Terminal
gksudo gedit /etc/rc.local

And add two following lines to the end of file before "exit 0":

rmmod snd_hda_intel
modprobe snd_hda_intel

- This fix also worked for me using a Fujitsu Siemens Amilo Si 1520 laptop, Codec: Conexant CX20549 (Venice), using Ubuntu 8.10. The sound worked out of the box, but it was weird and distorted. After removing the module and adding it again, the sound is back to normal. -- LaunchpadHome:mairabc <<DateTime(2008-11-27T09:32:33Z)>> - One more update: at some point it seemed that the sound was distorting again. In fact, the problem is that I was using too high volume levels. Checking this forum post and this guide, I've managed to get a configuration that seems to work fine. Use alsamixer to set the PCM level to below 50, and use only the Master channel to control the volume. Save your settings so that they keep the same after boot by running

$ sudo alsactl store 0

Sound is no longer distorted, though it is somewhat low. I guess the speakers are not powerful enough to handle more than that. (Note: using Ubuntu 8.10, kernel 2.6.27-11-generic, alsa 1.0.17 provided by the official packages.) -- LaunchpadHome:mairabc <<DateTime(2009-03-27T20:10:27+0140)>>

Update to the Latest Version of ALSA

Update: The build instructions in this paragraph are outdated. For Ubuntu 8.04 and 8.10 (at least) following the these instructions won't work. Please see http://ubuntuforums.org/showthread.php?t=962695 for a convenient script that will build the latest ALSA release. Also, it is recommended that you see the more generic SoundTroubleshooting page for information on how to update audio drivers.

{i} As of Ubuntu 6.06, these instructions do not interfere with the Ubuntu package structure or other kernel modules - in other words, the changes seem drastic however they are simply adding greater functionality to an existing kernel module (Please read the Caveats section!)
  • Install the required tools and kernelheaders
sudo aptitude install build-essential libncurses-dev gettext xmlto xmltoman linux-headers-`uname -r`
  • Install your kernel headers
  • Download the latest version of alsa from Alsa project (driver, lib, and utils) to a directory (eg. ~/downloads). In the following we assume that the latest version is 1.0.14. Please change this in accordance with the one you downloaded from the Alsa project site.
  • alsa-driver
  • alsa-lib
  • alsa-utils
  • Setup installation directories
sudo mkdir -p /usr/src/alsa
cd /usr/src/alsa
sudo cp ~/downloads/alsa* .
sudo tar xjf alsa-driver*.bz2
sudo tar xjf alsa-lib*.tar.bz2
sudo tar xjf alsa-utils*.tar.bz2
  • Compile and install alsa-driver
cd alsa-driver*
sudo ./configure --with-cards=hda-intel --with-kernel=/usr/src/linux-headers-$(uname -r)
sudo make
sudo make install

-- The configure step fails in Ubuntu 8.10 with the kernel 2.6.27-7. The configure script is unable to find the autoconf.h file and complains that it wants the full kernel sources. Aditya -- The configure step will work on Ubuntu 8.10 if the --with-kernel option is removed. After installing the linux-source package, the ALSA driver can be configured for Ubuntu 8.10 with this command: sudo ./configure --with-cards=hda-intel

  • Compile and install alsa-lib
cd ../alsa-lib*
sudo ./configure
sudo make
sudo make install
  • Compile and install alsa-utils
cd ../alsa-utils*
sudo ./configure
sudo make
sudo make install

Note that you must have the curses library installed to be able to compile alsa-utils. You can install it with this command from a terminal: sudo apt-get install libncurses5-dev

  • Reboot
  • if you have no sound, run dmesg and look for the string "snd_"

Troubleshooting

dmesg shows "disagrees about version of symbol" and "Unknown symbol" for snd_ctl_add, etc

if you reboot and have no sound, and check dmesg to find:

[ 1058.932000] snd_hda_intel: disagrees about version of symbol snd_ctl_add
[ 1058.932000] snd_hda_intel: Unknown symbol snd_ctl_add
[ 1058.932000] snd_hda_intel: disagrees about version of symbol snd_pcm_new
[ 1058.932000] snd_hda_intel: Unknown symbol snd_pcm_new
[ 1058.932000] snd_hda_intel: disagrees about version of symbol snd_pcm_limit_hw_rates
[ 1058.932000] snd_hda_intel: Unknown symbol snd_pcm_limit_hw_rates
[ 1058.932000] snd_hda_intel: disagrees about version of symbol snd_card_register
[ 1058.932000] snd_hda_intel: Unknown symbol snd_card_register

... etc. then you need to do a few extra steps. ubuntu default snd-hda-intel.ko location: /lib/modules/2.6.22-14-generic/ubuntu/media/snd-hda-intel/snd-hda-intel.ko alsa 1.0.15's installation location: /lib/modules/2.6.22-14-generic/kernel/sound/pci/hda/snd-hda-intel.ko so copy /lib/modules/2.6.22-14-generic/kernel/sound/pci/hda/snd-hda-intel.ko to /lib/modules/2.6.22-14-generic/ubuntu/media/snd-hda-intel/snd-hda-intel.ko . and put the modules/* in alsa's compile directory into /lib/modules/.../kernel/sound, you can use "find" to get their location. snd-hda-intel.ko snd-hwdep.ko snd.ko snd-mixer-oss.ko snd-page-alloc.ko snd-pcm.ko snd-pcm-oss.ko snd-rtctimer.ko snd-seq-device.ko snd-seq.ko snd-seq-midi-event.ko snd-seq-oss.ko snd-timer.ko then, depmod -a reboot, try again. (Thanks to forum user pcmanlin on this ubuntu forum thread)

alsa-utils don't compile

If you have trouble compiling alsa-utils simply run

alsactl -v

and it will show you the installed version. Check on http://www.alsa-project.org/ if your card is supported in that version and download the source packages. Go back to the "Setup installation directories" step above and try again.

Caveats

Overwriting packaged files and adding unmanaged files by running sudo make install may break upgrades. A better way is to create a backport by using the build scripts from your current alsa source packages. This would also allow you to undo the changes if they don't work, by simply downgrading back to the original package version.

Links

More Notes on HD-Audio Driver by Takashi Iwai - excellent document that explains many issues with the snd-hda-intel driver written by one of the module's authors.

Another solution

Check if your device card model is a Realtek and download alsa from Realtek site:

cat /proc/asound/card0/codec#* | grep Codec
Codec: Realtek ALC888

Realtek High Definition Audio Codecs Explained at this ubuntu forums thread