<div dir="ltr">Removing the flat volume from pulseaudio and moving it into the mixer would<div>make it hard to impossible to implement the following items:</div><div><br></div><div>1) give some apps flat volumes and others not.</div><div>2) raise the volume of just one stream in the mixer without affecting others. Since the mixer is not running inside pulseaudio, it can't atomically update both the master volume and the volumes of all other streams</div><div><br></div><div>Wim</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 October 2015 at 17:32, Alexander E. Patrakov <span dir="ltr"><<a href="mailto:patrakov@gmail.com" target="_blank">patrakov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">19.10.2015 19:38, Wim Taymans wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
Now that we are talking about flat volumes again (but I don't want to<br>
hijack the other thread), I would like to present another alternative to fix<br>
the problems with flat-volumes.<br>
<br>
The idea is that all apps, by default, operate in non-flat volume mode.<br>
This means all volume control done from the app is relative to the master<br>
volume.<br>
<br>
Privileged apps can see flat-volumes and thus (indirectly) change the<br>
master volume. One such privileged app is the volume control applet but<br>
it could be possible to manually enable trusted apps (maybe with a switch<br>
in the volume control next to the app stream).<br>
<br>
I made a little hack to let you try this, gnome-control-center is a<br>
hardcoded<br>
privileged app but you can see how we can store that in the database later<br>
or how we can hook this into the security framework.<br>
<br>
<a href="http://cgit.freedesktop.org/~wtay/pulseaudio/commit/?h=flat-volume-privilege-hack&id=1b203fe6bcc8bba1db1911fd4dbf225f36a6dbb9" rel="noreferrer" target="_blank">http://cgit.freedesktop.org/~wtay/pulseaudio/commit/?h=flat-volume-privilege-hack&id=1b203fe6bcc8bba1db1911fd4dbf225f36a6dbb9</a><br>
<br>
I like this idea because:<br>
<br>
1) it does not need any new api or changes to apps<br>
2) sets a default that will not cause 100% master volume with misbehaving<br>
apps<br>
3) has the master/app volume separation that people understand and that is<br>
also exposed in apps (volume in totem, master in gnome-shell header).<br>
4) still exposes the flat-volume model if needed, which is IMHO the only way<br>
to sanely increase the volume of just 1 single app (when it needs<br>
adjusting<br>
the master volume).<br>
5) minimal code changes.<br>
<br>
What do you think?<br>
</blockquote>
<br></div></div>
I have looked into this patch idea, and I think that even more minimal changes on pulseaudio side (but not minimal overall) are possible. However, your approach has an advantage of actually having a patch :)<br>
<br>
Please note that, under your proposal, and also without any patch, any application can introspect and set any sink volume directly, but no application except dedicated mixer applications currently does this.<br>
<br>
So here is a strawman counterproposal that should have a similar effect. Feel free to test whether the idea is implementable, and compare.<br>
<br>
1. All apps operate with non-flat volumes. Thus, we don't have to implement any policy in pulseaudio, and can even remove all the flat-volume code.<br>
<br>
2. Alter the logic for presenting sink input volumes to the user in gnome-control-center and all other mixer applications. That is, it should introspect both sink and sink input volumes, and move the slider to the correct position according to the product of them. If a user moves the slider, adjust the sink input volume if possible (i.e. if it is left of the sink volume). If not, adjust both the sink volume and volumes of all sink inputs connected there.<br>
<br>
I.e., move all flat volume logic from pulseaudio into mixer applications, like it is done in Windows 7. Then we would have a very simple rule to enforce if we want to implement privileged/unprivileged app separation: "privileged app" = "has access to sink volumes".<br>
<br>
<br>
Yes, I understand that this proposal looks at odds with my previous "ack" to Arun's idea. That "ack" is still in force.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Alexander E. Patrakov<br>
_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@lists.freedesktop.org" target="_blank">pulseaudio-discuss@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss</a><br>
</font></span></blockquote></div><br></div>