And then, even with the Touchpad's default configuration and something as basic as switching audio output between (wired) headphones/speakers, the situation is a total failure.
When it comes to audio provided by Flash (YouTube video), if the video has been paused and the screen powered off, reinserting the headphones with the screen off will not trigger a switch to headphones. I have to press power to see the lock screen before plugging in my headphones, and that's a 1st gen device problem (Pre-) from what i've read somewhere, back in '10.
This whole interface needs to be looked at, with so many similar bugs in the same area
To me, there's two problems, in detecting an event to switch output devices (or failing to generate one), and in exception handling. Maybe there's a boolean flag that is related to speakers being on, and that gets flipped or not, depending on the situation. I would think that enumerating audio output devices like a TV does with its video inputs is a better way to go. 0 for speakers, 1 for headphones, 2, 3 and 4 for Bluetooth and 5 through 9 for anything else. Give unique IDs to the devices and check if the devices are in operation (not always possible).... and then there'a also front speaker, rear speaker, headphones, bluetooth mono headset, bluetooth stereo headphones, car's bluetooth speaker, when we are talking about a phone (not tablet), with lots of room for bugs...
And then the Touchpad's "distorted noise" issue. Someone dropped the ball on audio....