I had exactly the same proble, tried updating, master reset etc. but still only mananged to get sound through headphones or music music dock. Volume up and down buttons did nothing too. The problem wasn't software related at all but infact a simple fix. The headphone output was dirty and was making the phone think there was still an input there (volume buttons still didn't work though). I'd read that someone fixed this by repeatedly inserting and removing their headphones but I managed to fix it with a high pressure air line at work. Happy happy now!