I'd assume since it depends how it is plugged in that the ports at the back are becoming a bit faulty, since the stereo port would give left and right, then this could be the problem
I think that the ports all run to the same source at the back and this could be the problem.
To fix things fast, i'd if i were you, buy a PCI sound card for cheap (Soubnds Blaster Live possibly) and just plug it in, disable the onboard, and install drivers for the new. You'll also get better quality.
I can't say what could fix the ports, but i don't think its software related.