The problem appears to be dust or debris in the headphone jack. You can try to blow the dust out, or suck it out. The latter is more effective but not so tasty. You can guess I tried the latter, and the sound came back.