[pulseaudio-discuss] Flat volumes and restoring the app volume

Gregory Petrosyan gregory.petrosyan at gmail.com
Mon Jan 31 11:27:44 PST 2011


On Mon, Jan 31, 2011 at 1:45 PM, Colin Guthrie <gmane at colin.guthr.ie> wrote:
> ...

Thanks a lot for the explanation!

>> I am asking these, because I've managed to make an app restore the
>> volume properly using ext-stream-restore.h, but when I turn the flat
>> volume on, behaviour is counter-intuitive to say at least.
>
> Can you elaborate on this a little? When you say "you've manage to make
> an app restore the volume properly using ext-stream-restore.h" what do
> you mean? Do you mean you are making an editor for the stream restore
> database or are you just meaning that you have an audio producing app
> and you are manually using ext-stream-restore.h to get it's saved volume
> and are doing something with it manually to set it's own volume?
>
> If the latter, don't do that, the server handles all that for you
> automatically. If the former then cool.

I have an audio player, and I want it to
a) save/restore the volume on shutdown/startup
b) be able to show the "future" volume and modify it after the
startup, but before the playback

b) is a problem: I either have to have stream open all the time (but I
can't do that since I do not know the sample format before the start
of the playback, so I can't create a stream beforehand), or to
manually read/write the m-s-r database.

It seems that, unfortunately, it is almost impossible to make such a
basic functionality work with PA, if using flat volumes. Because when
using m-s-r database + flat volumes, although the "real volume"
remains the same after the restart, e.g. displayed volume is wrong.

Here's an example:

(app | system)
60% | 100%
[decrease the system volume]
31% | ~50%
[restart the app, do not start the playback]
60% | ~50% (60% is more or less what is in the m-s-r database I assume)
[start the playback]
31% | ~50% (finally, displayed volume is correct)

                Gregory



More information about the pulseaudio-discuss mailing list