Intel High Definition Audio in Linux

A great number of laptops produced after 2004, including my vaio fz 190, come with an Intel® High Definition Audio chipset. Interestingly, these chipsets have problems in both Linux and Windows. If you are using an old version of alsa, I would recommend you to upgrade it because newer alsa drivers are almost problem-free. However, sometimes even if you upgrade your alsa driver, the default setup is not enough, for example, your headphones may not be working. In that case you need to pass some extra options to make alsa driver recognize your card. I guess “model” option is the most important one here, setting it according to my sound card was enough for me. In order to pass “model” option to snd-hda-intel module, first you need to know the model of your card. You can find it out by running this command:

cat /proc/asound/card0/codec#* | grep Codec

After that, you can find the appropriate parameter for your model in alsa documentation:

/alsa-driver-VERSION/alsa-kernel/Documentation/ALSA-Configuration.txt

If your driver is already a new one or you want to use the one shipped with your distro, you can find these configurations in:

/usr/src/KERNEL_VERSION/Documentation/sound/alsa/ALSA-Configuration.txt

If you don’t have any of these files, you can find the one for alsa-driver-1.0.18 here.
After finding the appropriate options for your card, you need to pass them to your alsa-base file. You can do that by typing

sudo nano /etc/modprobe.d/alsa-base

or choose your favourite text editor. Add the following line to the end of that file:

options snd-hda-intel model=MODEL

For instance mine was:

options snd-hda-intel model=vaio

Then find the applications that are using alsa by typing:

lsof /dev/snd/*

and kill them with

killall APPLICATION

(you may need root priviliges for that) Unload and reload the module again by:

sudo rmmod snd_hda_intel
sudo modprobe snd-hda-intel

or if these do not work reboot your computer. Your sound should be working with no problems.

If you still have problems, please run this script and report it to the alsa-developer mailing list to get more help.

Advertisements

26 thoughts on “Intel High Definition Audio in Linux

  1. I know the command “rmmod” but somehow it did not work with snd-hda-intel. it gives an error:”ERROR: Module snd_hda_intel is in use”. Then i used “-f, –force” option but it caused a crash. I think simply rebooting is the most ideal way to reload the module. Thanks for the info, Philip.

  2. Andreas, I got your point and I totally agree with you. I actually think that submitting reports to the related projects is the most important step in reducing the problems we have today in many Linux distros. But:

    >”it’s individual users who are at fault here”.

    I guess you are somewhat wrong here. Because I think the main fault belongs to the hardware manufacturers that does not support linux. You can’t blame a noob for not submitting the information that s/he has. Because s/he simply don’t know how to do it. It is voluntary users job to submit such kind of reports. After all, you don’t sign a contract to submit reports when you install a distro. Of course, from another point of view, you can say “if you want better support, you should support your provider first.” What I mean by “supporting your provider” may be hacking the code or reporting a bug. That’s agreeable too. Anyways, but I don’t think that it’s only individual users who are at fault here.

    Thanks for your comment. I hope people will also do what you are suggesting.

  3. Steve, actualy, you are right. I would also want to use “rmmod” or “modprobe -r” in that case. But I have tried these options before and they didn’t work. That’s why, I said rebooting is the ideal way. Those commands are, of course, more handy than rebooting your box many times. Thanks for the comment.

  4. You don’t need to reboot, just do
    rmmod snd-hda-intel followed by modprobe snd-hda-intel.
    And you can grep Code /proc/asound/card?/codec#* directly, no need for another useless use of cat.

  5. “I guess “model” option is the most important one here, setting it according to my sound card was enough for me.”

    – no it is _NOT_ enough. It will work for you but fail for the hundreds of clueless noobs that are following you on the same machine and don’t know to manually fumble these things. Result: Bad Linux Usability, again (and again and again).
    And it’s individual users who are at fault here, simply due to not reporting this vital information to the projects.

    Or, to state this in a more detailed way: once you _did_ manage to figure out a good model parameter (and try to find a good match if possible), _please_ submit this information to ALSA!
    Run lspci -n -v and submit the PCI vendor and device ID plus the subsystem vendor and device ID of the device that’s displayed as “Kernel modules: snd-hda-intel”.

    Example:
    00:14.2 0403: 1002:4383
    Subsystem: 1458:a002
    Flags: bus master, slow devsel, latency 32, IRQ 16
    Memory at fe024000 (64-bit, non-prefetchable) [size=16K]
    Capabilities:
    Kernel driver in use: HDA Intel
    Kernel modules: snd-hda-intel

    That would thus be 1002:4383 , 1458:a002, plus the model parameter you need, plus the product name of the machine you’re using, plus whether this model name fully supports your configuration or you noticed some weirdness/insufficiency.

    That way ALSA can add your machine / soundcard to the quirk tables in linux/sound/pci/hda/patch_*.c, which look like this:
    static struct snd_pci_quirk alc260_cfg_tbl[] = {

    SND_PCI_QUIRK(0x1025, 0x007b, “Acer C20x”, ALC260_ACER),
    SND_PCI_QUIRK(0x1025, 0x008f, “Acer”, ALC260_ACER),
    SND_PCI_QUIRK(0x103c, 0x2808, “HP d5700”, ALC260_HP_3013),
    SND_PCI_QUIRK(0x103c, 0x280a, “HP d5750”, ALC260_HP_3013),

    Result: no more model fumbling, everybody happy from the beginning due to auto-setting the correct type.
    (I’ve had a wee bit too many broken Intel-HDA setups, thus I’d certainly be grateful to people who submit this information properly)

    Thanks!

  6. > I still think that simply rebooting is the most ideal way to reload the module.

    The reason this isn’t always so ideal is that there are often many model values supported by your card, where none of them are an obvious match for your hardware. In that case you end up trying all the model values, and rebooting after trying each value is painful.

  7. modprobe isn’t perfect

    rebooting is never necessary
    and i’m pretty sure there is documentation
    that advises against rmmod -f (i’m pretty sure support has to be conpiled in-kernel)

    what you need to do is
    lsmod .. grep .. for the modules you wwant to remove
    determine the dependencies
    and remove them manually

  8. I have recently purchased an Acer TravelMate 5320 which has an HDA Intel sound card (82801H (ICH8 Family) HD Audio Controller) on which I run PCLinuxOS MiniMe 2008. I was having problems with this laptop in as much as the speakers worked but the headphones didnt, both the inbuilt mic and the external mic socket didnt work and the inbuilt wifi card (AR242x 802.11abg Wireless PCI Express Adapter) wasnt recognised.

    I was able to overcome all these problems by simply upgrading the kernel to 2.6.26.6.

    Regards

    Dave Le Huray
    Guernsey

  9. As a former developer for Alsa HD Audio (I’m currently focusing on getting my degree), I can tell you that:

    1. removing/reloading the driver is far more efficient than rebooting. If it won’t remove due to an in-use error, type “lsof /dev/snd/*” to find out what applications are using the sound driver. It is more than likely either the little speaker icon on your toolbar that allows you to adjust volume, your desktop’s sound server (artsd, esd, PulseAudio), or an application (firefox). Kill the app and you should be able to remove/reload in real time without rebooting.

    2. Most vendors don’t report information to Alsa because they feel that the generic drivers from the codec vendors should be enough. In reality, this is partially true. The reason that the auto-config doesn’t work with new systems is that us developers have to manually ad each new system to the driver. With some vendors, this is very tedious. For example, Intel has around 19 different board ids for the 945 series motherboards, 15 of which are identical in configuration. This is why we need user reports. The easiest way to report your system info is to first make sure you are running the latest released driver, then run alsa-info.sh, and report it to the alsa-developer mailing list.

    The biggest problem is in the way the HD Audio driver is written for Linux. It was submitted by Intel during early development of the audio bus when there were only 2-3 different sound chips available. Now, there are currently 7 known sound codec vendors with ~130 different sound chips and over 475 computers (v1.0.17RC2 numbers). Ideally, the driver needs to be rewritten to be more generic on the kernel side (greatly reducing the footprint as a side benefit) with the individual system configuration code being moved to user space. This way, new systems can be added to configuration files by end users or vendors very easily and more rapidly than developers can release code fixes. Some testing has been done with this and proven to work, but there just isn’t enough programmers with available time to take this on.

    I, for one, would be willing to restart work on this, but I am going to college full time to get my BS degree, and looking for a paying job to cover the mortgage (gotta love the local economy). I have quite a few test boards to work with, but without any financial support, my time to focus on this is very limited. I already spent a year (2006-2007) working on this driver system while unemployed, and can’t afford to continue.

    Good story otherwise.

    Tobin

  10. The current driver is a mess, there are a lot of exceptions, tweaks and quirks for each model and chipset brand. So I agree with the idea of the complete rewrite. It seems like parsing the info from the codec#* files could be enough to let the driver guess the configuration and adapt itself accordingly. The chipsets themselves also have functions to retrieve their capabilities.

  11. ooooppss!!!! didnt work 4 me, but i have to tell that im really a newbie here, i did everything the guide said, but after i restarted and not even the icon of sound in the tray is there, so can any1 help me??? i relly really need sound in my machine.

    when i typed the code:
    $ cat /proc/asound/card0/codec#* | grep Codec

    it says:
    Codec: Analog Devices AD1986A
    Codec: LSI ID 1040

    but now it says:
    no such file or folder….

    so can any1 help me??? plzz its urgent

    $ lspci:

    00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
    00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
    00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
    00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
    00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)
    00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)
    00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)
    00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)
    00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)
    00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)
    00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)
    00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)
    00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
    00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
    00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)
    02:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01)
    05:01.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ba)
    05:01.2 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 21)
    05:01.4 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 11)
    05:01.5 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 11)
    05:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

  12. try these parameters, whichever suits you best:

    6stack 6-jack, separate surrounds (default)
    3stack 3-stack, shared surrounds
    laptop 2-channel only (FSC V2060, Samsung M50)
    laptop-eapd 2-channel with EAPD (Samsung R65, ASUS A6J)
    laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100)
    ultra 2-channel with EAPD (Samsung Ultra tablet PC)

    hope this helps!

  13. Thnx 4 answering me, its a Toshiba L45SP 4016

    nacho@jorgepalacios:~$ aplay -l
    **** Lista de PLAYBACK Dispositivos Hardware ****
    tarjeta 0: Intel [HDA Intel], dispositivo 0: AD198x Analog [AD198x Analog]
    Subdispositivos: 1/1
    Subdispositivo #0: subdevice #0

    nacho@jorgepalacios:~$ aplay -L
    default:CARD=Intel
    HDA Intel, AD198x Analog
    Default Audio Device
    front:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    Front speakers
    surround40:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    4.0 Surround output to Front and Rear speakers
    surround41:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
    surround50:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    5.0 Surround output to Front, Center and Rear speakers
    surround51:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
    surround71:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
    hdmi:CARD=Intel,DEV=0
    HDA Intel
    HDMI Audio Output
    null
    Discard all samples (playback) or generate zero samples (capture)

  14. ok thnx i’ll try, but only if you can tell me how, sorry to bother again but im really a newbie here….. i also have installed a hackintosh mac os on another partition and the sound works fine with ac97, i don’t know if it helps in anything but maybe…. plz plz help me again…..

  15. also, if i run my kubuntu partition in vmware uder windows the sound is perfect, it uses the ENSONIQ AUDIO PCI ENS 1371 driver to work…..

  16. try putting “options snd-hda-intel position_fix=1 model=3stack” (without quotes) at the end of “/etc/modprobe.d/alsa-base”. You can also try other options that I gave before, like “options snd-hda-intel model=6stack” or “”options snd-hda-intel model=6stack”.

  17. thnk u so very much!!!!
    and finally i got sound!!!!!! i used “options snd-hda-intel position_fix=1 model=3stack” this was kinda hard, like 3 weeks searching for a solution and i finally i got it!!!!! thnx!!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s