个人工具

UbuntuHelp:HdaIntelSoundHowto

来自Ubuntu中文

Wikibot讨论 | 贡献2007年11月22日 (四) 13:01的版本

跳转至: 导航, 搜索


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

Update to the Latest Version of ALSA

{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 (Please read the Caveats section!)
  • Install the required tools
sudo apt-get install build-essential ncurses-dev gettext
  • Install your kernel headers
sudo apt-get install linux-headers-`uname -r`
  • 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.
  • 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-1.0.14
sudo ./configure --with-cards=hda-intel
sudo make
sudo make install
  • Compile and install alsa-lib
cd ../alsa-lib-1.0.14a
sudo ./configure
sudo make
sudo make install
  • Compile and install alsa-utils
cd ../alsa-utils-1.0.14
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

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 (replace KERNEL_VERSION with your kernel's version!):
/usr/src/KERNEL_VERSION/Documentation/sound/alsa/ALSA-Configuration.txt

If you didn't have this file, for version 2.6.22, you can check out this link or you can find ALSA-Configuration.txt in the subdirectory /alsa-kernel/Documentation/ of the alsa-driver-1.x.x directory you created.

  • 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

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


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" 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

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.

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.