Hello. I am a longtime regular on Dell's Laptop Audio Forum and I just stumbled upon this thread. Here is some general info that echoes what has been said here about the audio jacks. This is for Dells but I think it is the same for HP if the computer in question has HD audio, because the specifications for HD are standardized. Off the top of my head I think the standard calls for reconfigurable jacks.

In the Dell's the jacks are "Universal Jacks" designed by IDT and are reconfigurable. When configured as headphone jacks they have a "sense pin" that triggers switching software, instead of the older mechanical switching system. When the sense pin fails then the system acts as though there is a plug in the jack. Sometimes the sense pin can be made to work if a plug is inserted and gently wiggled.

It can be a hard problem to diagnose because it is a hardware failure that has the symptoms of a software failure. I can tell a Dell owner how to verify that the sense pin has failed but don't know how on an HP.

If the sense pin has failed, the solution is to replace the jack, and that means either replace the jack daughter board if there is one or the entire motherboard if the jack is mounted directly on it. Because the repair can involve a lot of money it is a good idea to have it fixed while still under warranty.

Hope this was of some help. I am reading a lot that is helpful to me on this forum.