Comment 14 for bug 1478506

Revision history for this message
Matthew Paul Thomas (mpt) wrote : Re: Apps change audio output role all the time

It's on-topic because changing SoundEffect to the alert role (and fixing bug 1418210, which should be fixed regardless) would fix this bug. The volume hardware buttons would control the volume of the game sound effects. But maybe there's a better solution. So let's step back a bit.

The goal of the audio roles is to minimize the number of times you feel the need to adjust the volume per hour of use. We achieve that by remembering your last preferred volume for different categories of sound. It's a balancing act. The fewer categories we have, the more likely it is that disparate things will share a category, so you'll more often be changing the volume to suit one or the other. On the other hand, the more categories we have, (a) the more you'll feel like the phone is forgetting your choice when really it's just not sharing it widely enough; (b) the more app developers will use the wrong one by mistake; and (c) the more often sounds from multiple categories will be playing at once, so you may get frustrated that the volume buttons affect only one of them and not the other(s).

Then we give those categories a priority order, based mostly on what's likely to be most important to you in that case when multiple categories are playing at once. We put alarm first, because it's relatively uncommon, but you can (if you want to) leave an alarm playing as long as you like while fine-tuning its volume. We put alert last, because it's likely to be short-lived, so (as demonstrated by this bug report) it's not reasonable to expect you to adjust it during the brief period it's playing.

Per spec, we currently have four categories, in order: alarm, phone (for call audio), multimedia, and alert. I think that the alert category should include both game sound effects (because they're often <1s long), and the ringtone (because you're likely to want it to be at the same volume). Drawbacks of this approach:
- Whenever a game is playing music as well, the volume buttons change the volume of the music but not the sound effects.
- Any others?

If the ringtone issue was a problem, we could solve it by putting ringtone into a category all by itself, or moving it to the alarm category: alarm/ringtone, phone call, multimedia, alert. Most/all apps should stop playing audio altogether when the phone is ringing, so the change in order should make little difference. But it would still have the same drawback with apps that play both music and sound effects: the volume buttons will change the former but not the latter.

It seems to me the only way to resolve that drawback would be to put sound effects and music in the same category, as they are now. But that would have a different drawback:
- If you're using an app that plays only sound effects (e.g. each time you send a message), while a different app is playing music, the sound effects will often be too loud, and there's nothing you can do about it short of going into Silent Mode.

I don't see any way to solve all those problems at once, so it's a matter of choosing the least bad.