Share your experience!
Hi @Ezgi,
I'm sorry to hear that.
Have you tried connection more then one pair of headphones to you Xperia M5? If not I'd recommend that you try that. Also if you could try with a pair of Sony original headphones.
I would also recommend that you try and reboot your device to safe mode to see if this behavior is caused by one or more of your downloaded apps, as these will be temporarily disabled in this mode.
Let me know how it goes!