No Sound from Headphones on Ubuntu

19 Sep 2011

On my Compaq Presario (Model: SR5152NX, Soundcard: ALC888), the audio wasn’t working quite right; when I plugged my headphones in, the audio came out of both the speakers and the heaphones. Here’s how I fixed it.

Finding the Sound Card Model

Issue the following command in a terminal:

head -n 1 /proc/asound/card0/codec*

On my Compaq, that prints “Codec: Realtek ALC888”.

Find the Correct Model Parameter

We’re going to modify /etc/modprobe.d/alsa-base.conf to specify the sound card model, but first we need to know what model parameter we need. Look through the documentation here to find your model:

zless /usr/share/doc/alsa-base/driver/HD-Audio-Models.txt.gz

You’ll find a number of possible settings – you’ll need to pick the closest setting to your hardware. You may need to try a couple by trial and error before you get it just right.

I looked under the ALC882/883/885/888/889 section and tried 3stack-6ch, as I have three ports in the back, and 6 channels per my hardware specs. Unfortunately, that wasn’t quite right, so I tried 3stack-hp instead, which did the trick.

Tweak alsa-base.conf

We must now teak alsa-base.conf:

# Edit the config file:
sudo vim /etc/modprobe.d/alsa-base.conf

# Add the following line to the bottom:
# options snd-hda-intel model=3stack-hp

Et voilã , audio works flawlessly now.