When I plug my headphones into my laptop (HP dv6 6176sa), I can get no sound through them, while the laptop's speakers work perfectly.
I managed to fix this by opening alsamixer and seeing that when I plug in my headphones the 'speakers' become muted, I unmuted them and increased the volume, my headphones worked. However I then unplugged them, and plugged them back in, and once again speakers became muted and 0 volume.
Why does this occur and how can I fix it so that I don't have to go into Alsamixer every time I want to use headphones?