This is related to your eustachian tube dysfunction, because eustachian tube is a connection between nasopharynx and middle ear, so if it's blocked then you may feel the ear pain. Another point is Please don't use Ear phones for prolonged periods as it is harmful for your hearing in longer run.
Next Steps
Treatment:-
Tab Solvin OD 1-0-1 7 days.
Valsalva Maneuver Atleast 10-15 times a day. (There should be no active Common Cold if you are doing this exercise)
Health Tips
Lessen your usage of speakers,Headphones.