Thursday 8 May 2008

Laptop Sound Issues in Linux

Quite by accident I realized that my laptop running Fedora 9 Preview release only outputs sound through the headphones. When the headphones are unplugged, although the music keeps playing, no sound comes out of the speakers. This set me off on a hunt for a solution which I only stumbled on to a few minutes ago.

First of all, a liitle bit of details regarding my setup. The laptop is a Sony Vaio VGN-CR11Z. lspci identifies my audio controller as Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) . Running
cat /proc/asound/card0/codec#0 | grep Codec produces Codec: Realtek ALC262 as the output.

Step 1
Download and compile alsa-drivers, alsa-lib and alsa-utils from http://www.alsa-project.org/. alsa-drivers refused to compile on my machine, and I had to edit the source files to get them to compile. I created a patch file to help others with similar problems, which can be found here. Apply the patch as follows:
./configure
make
cd ..
patch -p0 < alsa.patch


Step 2
Find the valid arguments to the model parameter. First check the output of cat /proc/asound/card0/codec#0 | grep Codec and then look at the valid models listed in the ALSA documentation for that codec. (Online copy at http://www.mjmwired.net/kernel/Documentation/sound/alsa/ALSA-Configuration.txt). Add this parameter to /etc/modprobe.conf as follows.
sudo echo "options intel-hda-sound model=fujitsu" >> /etc/modprobe.conf

Step 3
Reboot the machine and check whether the sound works as expected. You might need to fiddle with the value of model parameter to get it right. For my ALC262 card, neither fujitsu nor sony-assmd parameters worked. However, adding model=auto worked perfectly.

1 comment:

Anonymous said...

Got it, Thnx.
zin