Ubuntu on an HP Compaq dx2300 Microtower

My new desktop at varsity is, as described in the title, an HP Compaq dx2300 Microtower. First thing I did when I got access to it was, of course, to install Linux – Ubuntu 8.10 in this case. It’s a pretty nice machine (although not particularly high-spec) and pretty much everything worked straight away from install. The graphics card is Intel, so I’m not going to be doing any serious gameplaying (this is a work computer, anyway) but it runs Compiz pretty well. Being a desktop, suspend and hibernate aren’t terribly important, but as it happens they work fine.

The only problem – and this is the main point of this post – was with the soundcard (an Intel HDA). The box has three audio outputs: headphone plugs front and back, and a tinny built-in speaker. Under Ubuntu all three outputs were switched on all the time, and it wasn’t possible to adjust them separately. The purpose of headphones in a shared lab environment is entirely defeated if the built-in speaker is always on! I tried fiddling with all of the multitude of ALSA settings, but nothing worked. It couldn’t have been a hardware problem, because it did the right thing under Windows.

So, the problem was narrowed down to the audio driver, snd-hda-intel to be specific. Some googling established that changing the model parameter to the module might have some effect on the output selection behaviour. Further searching established that the possible values are listed in Documentation/sound/alsa/HD-Audio-Models.txt in the kernel source.

To find out what the possible values are, you have to know which codec your card uses. This you can do by running

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

For the dx2300 the result was Realtek ALC888. Indeed, under the list of models for the ALC888, there is one called “3stack-hp” for “HP machines with 3stack”. Guessing that this was the correct one, I added to /etc/modprobe.d/alsa-base the line

options snd-hda-intel model=3stack-hp

and rebooted. Hey presto, suddenly the internal speaker switches off when headphones are plugged in.

tl;dr summary: If you have a dx2300 and you’re having problems with the audio under Linux, then add the line options snd-hda-intel model=3stack-hp to the file /etc/modprobe.d/alsa-base (at least in Ubuntu; your distro might put module options in a different file).

Tags: , , , , , , ,

6 Responses to “Ubuntu on an HP Compaq dx2300 Microtower”

  1. Philip Bliss says:

    Sounds good, but can it do per-application volume control (that’s the next step, right)

  2. adrian says:

    Well, that’s what pulseaudio is for, if I understand correctly. On Ubuntu 8.10 or 9.04 you can install the “PulseAudio Volume Control” (package ‘pavucontrol’) which will allow you to do per-application volume control.

  3. Ubuntugeek says:

    I want to give special thanks to you for publishing this article! In fact, the information you just gave was very usefull for me!

    It’s been a long time that I’m searching back and forth but in vane!

    Now evrything works quite well!!

    Thank you very much!!
    I thought it was very tough to find out the solution!!

  4. Phil SOuthwell says:

    Hi Adrian
    would you perhaps be interested in helping with an uBuntu 9.04 / XBMC project – basically building a commercial instant-on media appliance. We need help solving sound issues (HDMI and Toslink) and reducing the boot time (i.e. a nice clean Kernel). We are building 10 or so of these cases and they are VERY smooth – or will be.
    Please let me know ASAP. We are in Greenpoint

    cheers

  5. bbot says:

    I’ve got the same problem at dx2300 mT and this solutuion is equal mine.

    Just little advice – you can do this without reboot:

    # sudo modprobe -r snd_hda_intel
    # sudo modprobe snd_hda_intel model=3stack-hp

    And don’t forget about mixer:

Leave a Reply