Laptop Headphone jack sometimes work. but sometimes don't


Dec 15, 2016
Hi guys i'm new here.. i hope you'll answer my problem..
i have a DELL INSPIRON 15r 5520.. and it's been 1 year when i started using it.. this laptop has a microphone jack and a headphone jack. time goes by.. the headphone jack started not to work but the microphone jack is working... i installed some drivers but no luck.. i tried every solution i've searched in the internet.. the set as default(which i can't do because my laptop won't detect the headphone), reinstall drivers, checked my headphone if it's broken etc.. so i thought my laptop has a virus so i reformatted it.. i used a lot of operating system but still no luck.. even linux.. sometimes it works but when i insert a headphone the second time, it won't work again....
please help me.. i don't know what to do..

PS. only the headphone jack is broken(i think). but the speakers do.