Ask Max: iMac Audio Only Works With Headphones
I purchased a used iMac, but I can only get the audio to work when I'm using headphones.
When my headphones aren't plugged in, my only choice for sound is Digital Out, which lists the Type as Built-in Output. The settings say that this device has no output controls. When I turn on the computer, I get the tone/chord just fine, so I know some speaker is working.
There is a type of failure, on the combo analog/optical audio ports, that causes it the unit to think there is always an item plugged in. This happens because the port senses that a non-metallic item has been inserted. This is supposed to indicate that an Optical audio jack is in use.
You can try blowing compressed air into the port - but I have seen few reports where that solves the problem. In most cases, replacing the affected ports is the solution.