This question already has an answer here:

I recently upgraded to the 3.9 Linux Kernel (on Ubuntu 13.04) and lost all sound at first, and then miraculously brought back sound to the speakers (after playing a bit with alsamixer, but still no sound when plugging headphones.

merged by Luis Alvarado Jun 2 '13 at 1:28

This question was merged with Sound problem on both Speakers and HeadPhones because it is an exact duplicate of that question.