So I've been using an Asus ROG G51J gaming laptop for a while now, and a couple months back, I noticed this weird problem. Occasionally, when my headphones were plugged in, I'd hear this popping noise. Sometimes it was just one pop in minutes, sometimes it sounded like machinegun fire. After a bit of investigation, I realized that for the duration of each pop (a fraction of a second, at most) my computer would play sound through its onboard speakers instead of the headphones. It didn't seem to change based on what programs I had running or what devices I had connected to the computer, and restarting the machine entirely only temporarily defeated the problem.
Then it simply went away, and I didn't think anything of it. Since then, it's returned a couple of times, appearing and disappearing at random intervals, and it's starting to get very irritating.
Sounds like a dodgy headphone jack or it may simply be a bit worn out, causing your laptop to intermittently not detect the plugged in headphones and revert back to its speakers. I don't think there's a whole lot you can do without physically opening up the case though... maybe try carefully using some canned air or apply some contact cleaner to your headphone's connector and plug it in and out a few times. That said, I don't know if these jacks primarily rely on a mechanical or electrical detection system.
The problem does persist between different headphones, and while a shotty jack seems likely, I'm fairly certain the problem is software based. If the jack were failing, then even if the problem would continue to be so intermittent, I've got a sneaking suspicion the sound would be cutting out for more than a fraction of a second at a time. I'll give it a blow out with some compressed air though, and check back to you guys if that solves it.
Okay, I worked it out. There's something wrong with the USB hub I've been using; while it's connected, this conflict occasionally appears, but when it's disconnected, everything's fine. Pity; it's a good hub.