No audio with headphones, but audio works with integrated speakers

My solution may seem the dumbest but it worked great for me: put your laptop in suspend closing the lid, open it up again and it's fixed.


HPG2t Help: Speakers don't work - check post #4:

I think I've managed to solve this problem. At least for the moment, my speakers are working. What I did was install the drivers from the realtek site. Specifically, the Unix driver on their page for High Def Audio Codecs. Here's the link:

http://218.210.127.131/downloads/dow...onn=3&DownType ID=3&GetDown=false

I downloaded the tar ball, unpacked it, and followed the instructions in the file Readme.txt. I had previously installed the packages necessary for compiling I think ("build-essential"). I rebooted once and it still didn't work but then I noticed my gnome-alsamixer was missing, so I reinstalled that, and then on reboot the speakers began to work. Hopefully, it stays that way.