[PATCH v2 2/5] When switching ports, use the port default volume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2015-04-20 at 11:21 +0200, David Henningsson wrote:
> 
> On 2015-04-17 22:26, Tanu Kaskinen wrote:
> > If two ports have different default volumes, and module-device-restore
> > doesn't have an opinion on the port volume, we should change the
> > sink/source volume to the new port's default volume when switching
> > ports, instead of keeping the volume at whatever it happened to be
> > when the old port was active.
> >
> > This introduces pa_sink/source_port_changed_hook_data, because I
> > wanted to call pa_sink/source_set_volume() only once in
> > pa_sink/source_set_port(), instead of calling it also in
> > module-device-restore's hook callback. The extended hook data allows
> > module-device-restore to communicate to the core that the volume
> > should be set to a non-default value.
> 
> Now that pa_device_port has a default volume, then module-device-restore 
> should just set it for all ports at the card_new + PA_HOOK_EARLY 
> callback. There is no need for module-device-restore to do anything at 
> port_changed anymore; and thus no need to add the 
> pa_*_port_changed_hook_data struct either, unless I'm missing something.

module-device-restore should still restore the saved port volume on port
changes, because the port default volume is a different thing than the
saved port volume.

I could make another patch set after this one that adds volume to ports.
That would make the default_volume field redundant, and as you explain,
the pa_sink_port_changed_hook_data struct would become redundant too.
Port volume restoring should then be moved from module-device-restore to
module-card-restore. module-device-restore would restore volumes only
for sinks without ports. IIRC, we agreed that ports should actually have
per-profile volume, so I should add support for multiple volumes to
ports?

> There's also the point that now volume and mute are handled differently, 
> which I'm not really happy with.

I can add mute and save_mute fields to pa_sink_port_changed_hook_data to
make it symmetric.

-- 
Tanu



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux