The repair is usually the board the jack is on. For well under 10 bucks most folk use an USB Sound Card when this fails. Example at link.
http://www.amazon.com/Sabrent-External-Adapter-Windows-AU-MMSA/dp/B00IRVQ0F8/ref=CNET
This started the other day, where I'd plug my earphones into my Windows 7 headphone jack and find that no sound was coming out. I tried pulling it out and plugging it back in and notice sound comes out when it isn't plugged in all the way. Though, this causes it to be very easily disconnected. Another issue is a part of the times that I try (due to some random condition I haven't been bale to nail down), it simultaneously will play sound between the earphones and my speaker.
When I have it plugged in all the way, no sound comes out and it says in Playback devices that I have my speakers in. But, while I can clearly see a song is being played on my supposed "Speakers", nothing is happening whatsoever. My speculation was that my jack is damaged, but I got it to work a couple times through messing with playback devices and turning things on and off. Did a lot of enabling and disabling. It doesn't last though.
I tried uninstalling (Realtek High Definition Audio) drivers from the computer and re-installing them. No dough. Same results. Another thing I noticed is that both my Speakers and my Headphones are labeled under Realktek High Definition Audio, but no do not behave the same way. I'm on a Windows 7. Let me know if I missed any important information and I can include it.
Windows 7 64-Bit, HP-Pavillion, System model BK173AAR-ABA HPE-240f
Let me know if I have to include any other information. Would appreciate the assistance.

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic