HP xw6400 Workstation: How to fix your machine if your speakers don’t work.
Determine your sound card model:
cat /proc/asound/card0/codec#* | grep Codec
Look up the model in this list:
http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt
Edit your ALSA (Advanced Linux Sound Architecture) conf file:
/etc/modprobe.d/alsa-base.conf: options snd-hda-intel model=hp-bpc
In general:
options snd-hda-intel model=MODEL
Reboot.
Source: https://help.ubuntu.com/community/HdaIntelSoundHowto