I have a computer with a headphone jack in the front and about half of the time when I plug in headphones it does not recognize that I have done so (i.e. it doesn't play audio through them, doesn't add them as an audio output device in the volume control tray icon). Also sometimes when they are recognized and then I unplug them, the computer doesn't recognize that they have been unplugged, and still tries to play through the headphone audio device. This happens with any pair of headphones I plug in, not just a specific pair.
Visibly the jack doesn't look damaged, and the computer is less than two years old. Is there anything else that could cause this besides the jack itself being damaged? Or anything else I can try to troubleshoot besides replacing the component?