Bug 7159 - (int-151579) Streams with "media.role" == "game" should play with system volume
(int-151579)
: Streams with "media.role" == "game" should play with system volume
Status: NEW
Product: Multimedia
Pulseaudio
: 5.0/(3.2010.02-8)
: All Maemo
: Low minor with 1 vote (vote)
: ---
Assigned To: unassigned
: pulseaudio-bugs
:
:
:
:
  Show dependency tree
 
Reported: 2009-12-20 16:30 UTC by Javier S. Pedro
Modified: 2010-04-14 13:40 UTC (History)
2 users (show)

See Also:


Attachments
Test case (2.10 KB, text/x-csrc)
2009-12-20 16:31 UTC, Javier S. Pedro
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description Javier S. Pedro (reporter) 2009-12-20 16:30:06 UTC
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.
Comment 1 Javier S. Pedro (reporter) 2009-12-20 16:31:15 UTC
Created an attachment (id=1811) [details]
Test case

Build with "gcc -o play-sound play-sound.c -lcanberra". GPL2 license.
Comment 2 Andre Klapper maemo.org 2009-12-21 19:16:00 UTC
Yes, games are in the "Media / Application volume" Audio category (same
category that Media Player is in).
Comment 3 Venomrush 2010-03-20 00:40:56 UTC
Is this still reproducible in the latest firmware 3.2010.02-8?
Comment 4 Javier S. Pedro (reporter) 2010-03-20 01:03:54 UTC
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).