Have you tried reinstalling the correct drivers
? IDT is the current company that owns what used to be SigmaTel and if you have a "SigmaTel" integrated sound module some times the newer IDT drivers will not work or work correctly. As you have a Compaq PC, first stop would be HP/Compaq and check for a sound driver
there for your specific model. If they do not have a Win 7 driver but have a Vista driver download and install that and see what happens as a first step.
There could also be a connection problem between the front panel and the motherboard for the headset jack connection. With the PC powered off, open the case and reseat (unplug then plug back in) the connector for the front panel Audio.