[pulseaudio-discuss] Saving stream volumes per physical output

Tanu Kaskinen tanuk at iki.fi
Tue Jan 5 09:37:36 PST 2010


ti, 2010-01-05 kello 18:02 +0100, Lennart Poettering kirjoitti:
> On Tue, 05.01.10 18:37, Tanu Kaskinen (tanuk at iki.fi) wrote:
> > Consider this scenario:
> > 
> > Headphones' port volume is -10 dB. Speakers' port volume is also -10 dB.
> > 
> > I use headphones, and set the volume to -15 dB, because that is good.
> > Then I switch to the speakers. The volume is now a bit too low, so I
> > turn it up to -10 dB. Then I switch back to the headphones. m-s-r
> > doesn't do anything, because it thinks one stream volume is good for any
> > output. But the end result is that now the music is coming 5 dB louder
> > to my ears than what I want.
> > 
> > Maybe you're going to argue that after switching to the speakers I
> > should have changed the port volume instead of the stream volume. But if
> > I know nothing about the flat volume logic, as would be the case for an
> > ordinary user, it's much more likely that I'm just going to tweak the
> > music player volume, which modifies the stream volume.
> 
> Na. I already agreed that m-d-r needs to be aware of ports and
> save/restore volume based on the port that is actually selected
> (i.e. remember what I wrote about using $SINKNAME@$PORTNAME). All i
> was arguing abvoe was that m-s-r does not to be aware of ports.
> 
> m-d-r would then have to listen to port changes of a sink and
> save/restore volume then. So the entire changes to m-d-r would be:
> 
> 1) always save two entries for each sink/source: $SINKNAME and
> $SINKNAME@$PORTNAME. Always restore $SINKNAME@$PORTNAME if it is
> available, fallback to $SINKNAME.
> 
> 2) also save/restore data when the port is changed for a sink: save
> the settings for the old $SINKNAME@$SINKNAME@$PORTNAME and $SINKNAME,
> then load the settins for the new $SINKNAME@$PORTNAME if that exists,
> finally save it $SINKNAME again to store the new port.
> 
> The changes for that should be fairly easy to implement.

I fail to see how port volumes in m-d-r help in any way in my scenario.
The sink/port reference volumes stay at -10 dB all the time so whatever
m-d-r does, it isn't visible to the outside world. When switching back
to the headphones, it's the job of m-s-r to restore the stream volume
back to the -5 dB relative volume (actually I think that m-s-r should
restore the absolute volume, but let's not go there yet).

-- 
Tanu Kaskinen




More information about the pulseaudio-discuss mailing list