My solution was the side switch
Sometime after I updated the os on my iPad I noticed I lost sound out of the speakers. 90% of my apps would not play through the speakers. I could still play sound from the iPod app through my speakers. It turned out it was tha pesky Side switch. I checked my settings.
I went into settings -> General -> use side switch. It was set to lock rotation. So I figured that it now had nothing to do with sound. WRONG! I changed it from lock orientation to mute. Bam it worked all sound can come out of either the speakers or the headphones.
The boys and girls in apple land must have messed up the functionality on the switch when they upgraded the os.
I hope this helps someone else.