I have the problem that when I connect my headphones to the laptop, I have a bad sound playing in it. In the Windows preinstalled program Realtek HD can be set as what the plugged device is detected and if I switch between speakers and headphones, there's no difference in the sound. I did not have this problem before.
Try reinstalling the sound driver. Most of the time the problem lies with it.