Yenya's World

Sun, 14 Sep 2008

Intel HDA: Headphones versus Speakers

I have solved an interesting driver problem yesterday: I have a new laptop (more on it later) with an Intel HDA sound device. The problem was that it did not detect when the headphone jack was plugged in, and did not switch the built-in speakers off in that case. After reading many web forums, I have finally managed to get it working. I will try to summarize the steps required, in case somebody in the future will have a similar problem on a different hardware:

  1. It is necessary to find out which codec chip do you have. It is written in the first line of the /proc/asound/card0/codec#0 file, and also displayed in the line labeled Chip: in alsamixer -D hw:0.
  2. Find out valid "model" options for this chip. Look at the file /usr/src/linux*/Documentation/sound/alsa/ALSA-Configuration.txt, find the section "Module snd-hda-intel", and in this section find a subsection for your codec chip. Mine was "Realtek ALC660-VD", described in subsection "ALC861VD/660VD".
  3. Now run the command "rmmod snd-hda-intel; modprobe snd-hda-intel model=XXXX" for each model valid for your chip. Try to plug the headphones in, play some sound (like "aplay -D hw:0 /usr/share/sounds/generic.wav), and determine whether the built-in speaker were switched off or not. Warning, the trickiest part ahead: it is necessary to re-plug the headphone jack after each "modprobe" command. It detects only the event of plugging a jack, not the state of it being plugged in. It took me an hour to discover this, when none of the available models seemed to work.
  4. Finally, to use the "model=" option you have just selected (mine was "model=lenovo", how strange it may look for the ASUS laptop ;-), use the following command: echo 'options snd-hda-intel model=XXXX' > /etc/modprobe.d/snd-hda-intel (of course substituting XXXX by the correct model name).

Hope this mini-HOWTO will help somebody.

Section: /computers (RSS feed) | Permanent link | 4 writebacks

4 replies for this story:

Abraxis wrote: And this...

And this is the reason, why I use Mac - I can just work instead of spending hours to find a way to workaround some small-yet-annoying issues. BTW - MacOS remembers volume levels - so when you need to have higher volume for your headphones then built-in speaker, no need to touch anything, just them in. I'm sure you can do this with Linux also, but here it works out of the box.

daec wrote:

Thank you for your how-to. The way of finding out and modprobing the right drivers for Intel HDA Sound device is now clear enough to get sound in Linux working on MacBook :-)

anne wrote:

great! I fought too long against headphone switch on my Asus F3E, both under Debian and Ubuntu. Many thanks!

mf wrote:

Thanks a lot. Especially for the plugging part.

Reply to this story:

URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Key image: key image (valid for an hour only)
Key value: (to verify you are not a bot)


Yenya's World: Linux and beyond - Yenya's blog.


RSS feed

Jan "Yenya" Kasprzak

The main page of this blog



Blog roll:

alphabetically :-)