[pulseaudio-discuss] module-device-restore: Volume save and restore for all ports?

Lennart Poettering lennart at poettering.net
Mon Jan 4 14:13:25 PST 2010


On Sat, 02.01.10 14:40, Colin Guthrie (gmane at colin.guthr.ie) wrote:

> > I agree, although I don't really see how jack sensing is important here.
> > AFAIK ports are currently only implemented by the alsa modules, and in
> > that case separate ports are created for two different purposes:
> > selecting the physical output or input, and selecting any options that
> > the alsa mixer offers (for example, extra amplification switch).
> > Regardless of jack sensing, volume should be saved and restored
> > independently for each output/input.
> 
> Well the reason I see jack sensing as important here is that the say the
> user is using the "Speaker" port and sets the volume to 99%. This volume
> is saved. Then later, they have headphones plugged in when PA starts and
> the "port" is automatically set to "Headphones". In this case the volume
> could be restored to the 99% that was appropriate for "Speaker" but
> totally incorrect for "Headphones" and turn your brain into a mushy
> goo :p

This could be covered by the suggestion I just made in the other mail
regarding $SINKNAME@$PORT as m-d-r database key I think. The patch
should be easy...

> AFAICT the only change that is needed is to include the port name in the
> key used for the module-device-restore database with a special key for
> storing the currently "active" port. There will have to be some smarts
> added when automatic port selection via jack sensing works so that
> changes triggered when plugging in head phones are not actually saved as
> the "active" port for restoration later when the headphones are not
> plugged in but that should be easy enough to cope with - e.g. API based
> port changes are saved, but automatic (i.e. from alsa) port changes are
> not saved - much like how current stream moves are saved or not.

Yepp, that's mostly what I would suggest too, as mentioned. 

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list