No sound when plugging in headphones

Notebook model: Terra Mobile 1773P
OS: Ubuntu 12.04, 64bit
Loaded modules: snd_hda_codec_realtek, snd_hda_intel

Sound works fine while listening via notebook speakers.
But when plugging in headphones, there is no sound at all.

Checking alsamixer (in command line) shows that “Headphone” cannot be chosen, and “Speaker” is muted. When turning up “Speaker” volume, there is sound on the headphones…

Permanent solution:
Edit /usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf :

[Element Speaker]
switch = mute
volume = merge