Weird problem just cropped up today on my iPhone 4 (no longer under warranty). If I try to play the Music app, Pandora, YouTube and many other sound apps I can't hear the audio over the speaker and on some apps a message appears saying 'No Volume Available' on the screen. It has this message in Pandora, in YouTube and the music app just don't have the volume slider.
If I plug in headphones all work normally.
If I use the Phone app, or Talkatone I can hear the audio via the earpiece and I can switch it to the speaker. So I know the speaker system works as some apps detect the speaker and can route audio through there. Skype on the other hand works via speakerphone but not via the earpiece. Key-clicks and lock sounds don't work via the speaker.
I've reset the iPhone a few times, 2x via holding down the power key and shutting it down then restarting with the Apple logo and once forcing a shutdown via power+home buttons.
I've restored the iPhone, I'm running iOS 5.0.1, bluetooth is off, mute switch on the side is on (I've switched it both on and off, didn't do anything). I've tried plugging/unplugging in headphones to see if debris or something would be knocked loose but that didn't work. Plugging/unplugging dock connector several times didn't work either.
I'm wondering if an app I tired did something weird electrically? I had a headphone jack plugged-in and ran the TASCAM recording app to try and record something. Had a tough time figuring it out and it was while I was trying it that the problem seemed to occur as I couldn't hear anything recorded via the app.
I've since removed the app and done all of the above to no avail. I'm going to try another restore. And don't suggest I just go to an Apple Store, the nearest one is a few hundred miles away on another island.