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

About:

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

Links:

RSS feed

Jan "Yenya" Kasprzak

The main page of this blog

Categories:

Archive:

Blog roll:

alphabetically :-)