IDG Answers is a community of experts who are passionate about technology. Ask a question or answer one below.
The optical audio connection is sometimes dodgy on MacBooks. There is a microswitch that can fail, and unfortunately it gives a signal that the headphones are plugged in even when they are not. About the only thing you can do short of taking it in for repair is to plug in some headphones and wiggle and plug/unplug it in an attempt to get the microswitch to actuate. Just be gentle, and know it might not work.