I was listening to some music with my headphone when suddenly the jack jumps out by itself. I try to put it in again but it seems something is blocking it, preventing it to be properly connected. What has possibly happened? And more importantly how do I fix it? Any ideas?
Inside the female jack there are flat metal connectors/tabs (cant think of the proper term) that are bent in a fashion that when a the male end of the jack is inserted, they press up against the male connector's pins with tension to make an electrical connection.
It is possible one of these connectors has broken under its own tension and popped the male end out and is preventing you from inserting it again.
Check that the jack is flush against the case bezel and/or there is a wide-enough hole around it (figure 1). In my experience, this tends to be a common cause of 3.5mm connectors popping out.
It is not uncommon for the jack of the front-panel module (figure 2) to be a recessed few millimeters behind the plastic of the case (figure 3), thus making it too deep for the connector to go in all the way. Even a few millimeters is enough to cause it to pop out from a little vibration (which computers provide in spades).
Also check the headphone connector itself. Some headphones have a lot of rubber around the connector which makes it difficult for it to go all the way in, especially with recessed jacks. (Interestingly enough, while looking for a photo of fat and thin earphone jacks, I found one with both (figure 4) because someone was specifically concerned about the difference.)
Figure 1: The left connectors are slightly recessed but have an indent in the case; the right connectors are flush against the case
Figure 2: A front-panel connector module with audio connectors
Figure 3: A front-panel with recessed connectors
Figure 4: Fat and thin headphone connectors