The headphone input is dirty and the device thinks something is plugged in. Use a Q-tip with most of the cotton stripped off and apply a little alcohol then clean out the headphone input. I have also used the corners of facial cotton pads. This happened to me with an iPhone and an iPad. Works every time.
DUDE IT WORKED!!! Previously i thought that your method wouldn't work at all since i've wasted 3 Q-tips to fix it and it wouldn't work. Turns out, if you sweep it from a certain angle and hit a specific hardware detection "bulge" inside of the hole (which is barely visible with naked eyes) and voila! I got the error erased! I really appreciate your tips!! You're a great guy!
Heyy brohhh i can help youu... Just a while ago I'm also suffering this.... I tried all but didnt work... Just take a pice of cloth and wrap it and clean the heahphones port and you will get your sound