I used to have same trouble with my PC(but only on front port).
the things I tried..
1. Brought a stereo extender.(Donno what it is technically called, but its one with a stereo pin at one end and stereo port/plug(female) at the other end. (Must be stereo no mono)). Used it basicaly as an extender. I assume it solved some loose connections and got good audio for some moths before the same trouble started again.
2. I build the extender myself the next time and worked fine for long time.
3. If everything fails buy a USB audio adapter.There seems to be 5.1's also.
4. Also u can try a different set of headphones. Does that work??
Bluetooth headphones will work for sure
These are just work arounds for sure. I would also recommnet dropping by to some service centre and see if they can just replace the sound ports. Might nt be really possible but an enquiry wont hurt.
5. If you have a graphics card capable of HDMI ouput then you can use the HDMI audio device as default device and then seperate audio from that. One cool feature here would be u can use an all new audio driver and hardware(I think).
I really think its just the problem with the connectors, and its pretty common too I persume