I know this problem is quite common, but I failed to find a solution after searching some browsing.
I'm building a system and I'm using a gigabyte motherboard (GA-X58UD7) and my case is a CM Storm Sniper Black.
My problem is that after connecting the HD Audio connector to the mobo socket, every time I connect my headphones I get a popup indication that I've plugged a device but right after I get the indication that I've unplugged it (but I did not!!) and this goes on for ever until I actually unplug the headphones.
I am using Windows 7 Home Prem (64bit) and I have downloaded the latest drivers from Gigabyte and I've also tried the latest hd audio driver (Feb 2010) from realtek.
I check the wires and none of them seem to be loose, I even dismounted the case top panel and check the connections and all looks to be ok.
I've tried using the ac97 socket and turned down the detection in the audio config application and I get perfect sound from the audio panel.
With the HD socket I get sound as well when I turn off the detection as well.
Just to let you guys know that I have solved my problem just by routing the front panel audio cable. It is now going through a different path and that did it. IT seems I was getting some "noise" induced on the cable causing the problem, not sure though...