Headphone jack not functioning properly

My phone is a Xperia z5 (e6653) just over a year of usage my phones headphone port started acting weird.. My phone kept thinking that my phone headphones were being plugged in and out constantly which rendered my phone useless unable to make calls play music or watch vidoes... Only solution to stop this was to have my headset plugged into the phone... Then the phone would work via the headset. Very inconvenient.

Next I found an app called soundabout which enables me to redirect the sound from the headset to the normal speaker as if the headset wasn't plugged in.. This is the only solution I have found... I have tried replacing the headphone port but it was still the same... I even tried completely removing the headphone port and the problem was still there... How can I fix this? without having something constantly being plugged in and rerouted from that app.

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0