If it only hurts when you're listening to music on headphones, then it's a sign you're damaging for hearing. I did that about 2 years after joining head-fi from excessive use of headphones. If it's a wincing kind of pain, like sharp little stabbing, you're on the cusp (or in the midst) of damanging the cillia of your inner ear. They are becoming damaged from over stimulation. The next stage will be serious tinnitus. The only cure for you now is to take about 3 to six months off from headphones to let them rest and repair. Then try to gingerly work your way back into them with short listening periods. I know this from a decade of experience and consulting hearing specialists. It isn't anything any external medicine or cleaning will fix. It's the inner ear saying - I'm being damaged. And if you develop tinnitus, you may or may not ever recover from it. I luckily recovered by staying away from headphone for two years. It wasn't easy. It's a fun hobby. But I can now use headphone, but the moment I feel a stab of pain. I lay off them for a couple days. And yes, I do still have mild tinitus.