This is a common problem, i know but when i plug in my headset the sound keeps coming out of the speakers. The pc model is Acer Aspire 5930. When i start the pc with the headset plugged in, the sound comes out right, but when I plug it in after i have turned it on the sound comes out everywhere. System is ubuntu 12.04 64 bit.
I think your sound card is an Intel. if yes try the solution here.
I had a problem with Sound settings in Ubuntu 12.04. It fixed now
I have just found another solution:
(It worked for me with Only S/PDIF profile, Sound from both headphone and speaker and not being able to switch profile)
Reboot, And See the result!