maemo.org Bugzilla – Bug 7159
Streams with "media.role" == "game" should play with system volume
Last modified: 2010-04-14 13:40:17 UTC
You need to log in before you can comment on or make changes to this bug.
SOFTWARE VERSION: 1.2009.42-11 EXACT STEPS LEADING TO PROBLEM: 1. Mute the system volume on a device (do not choose "muted" profile, but drag the volume bar). 2. Build attached test application 'play-sound' (based on the system utility of the same name) with "gcc -o play-sound play-sound.c -lcanberra" on FREMANTLE_ARMEL target with "libcanberra-dev" package installed. 3. Copy application to the device. 4. Run ./play-sound /usr/share/sounds/ui-key_press.wav EXPECTED OUTCOME: You hear nothing, since the system volume is muted and CA_PROP_MEDIA_ROLE is "game". ACTUAL OUTCOME: You hear the "key press" sound effect in full volume. So don't use headphones, please. REPRODUCIBILITY: always EXTRA SOFTWARE INSTALLED: libcanberra OTHER COMMENTS: Note: ca_proplist_sets(pl, CA_PROP_MEDIA_ROLE, "game"); and http://0pointer.de/lennart/projects/libcanberra/gtkdoc/libcanberra-canberra.html#CA-PROP-MEDIA-ROLE--CAPS I'm assuming the Maemo Sound Guidelines require Games to follow the system volume instead of the profile/events/notifications volume. If that's not the case, please close this bug. If I switch the "media.role" to "x-maemo" it then correctly follows the system volume. "x-maemo" seems to be the default for pulseaudio clients that don't specify a media role (this is how SDL apps, Bounce, etc. work). Unfortunately, Canberra will by default set up media.role to "event" for applications that don't specify it. So you basically need to force the media.role to "x-maemo" if you want your sounds to be played with the system volume (you can test this in the test app). This is of course something very Maemo specific which IMHO is undesirable, specially when the "standard way" is to set media.role to game, music, phone, etc. and let the system configure the volume appropriately.
Created an attachment (id=1811) [details] Test case Build with "gcc -o play-sound play-sound.c -lcanberra". GPL2 license.
Yes, games are in the "Media / Application volume" Audio category (same category that Media Player is in).
Is this still reproducible in the latest firmware 3.2010.02-8?
Yes; build the test case and run it on N900 (for example with ./play-sound /usr/share/sounds/ui-default_beep.wav ) and you'll notice that no matter what the system/game volume is (even zero), the beep will loudly play (unless you alter your profile or select Mute). But the code is setting up media.role to "game", so this should not happen. (Easy workaround is still present and working -- "x-maemo" -- thus minor severity).