[pulseaudio-discuss] [PATCH v2 2/2] switch-on-port-available: deactivate direction when the no ports are available for that direction

Georg Chini georg at chini.tk
Sat Dec 30 13:27:47 UTC 2017

On 30.12.2017 13:55, Tanu Kaskinen wrote:
> On Sat, 2017-12-30 at 13:09 +0100, Georg Chini wrote:
>> On 29.12.2017 21:28, Georg Chini wrote:
>>> On 29.12.2017 13:49, Tanu Kaskinen wrote:
>>>> There's still the problem that once the HDMI sink is available again,
>>>> streams won't be moved there automatically (unless module-switch-on-
>>>> connect is loaded), but I think that's a lesser problem than keeping
>>>> streams connected to a silent sink.
>> Would not using a hook and let module-rescue-stream handle the
>> suspend/unsuspend solve that problem as well? You would then also
>> have to modify the default sink selection to take the suspend state
>> into account.
> What logic would module-rescue-stream use in the unsuspend case? It's
> not obvious to me how it should determine when to move streams to an
> unsuspended sink and which streams to move.

The same logic that module-switch-on-connect applies with the
difference that the unsuspended sink does not become the default
automatically. So if the "normal" default sink selection determines
that the unsuspended sink should be the default, then move the
streams from the current default to the new one, else do nothing.

> I don't think the default sink selection logic needs any changes. Sinks
> whose active port is unavailable are already avoided, and when the
> active port becomes available again, the default sink selection is re-
> evaluated, so the HDMI sink will likely become the default sink again
> if it was the default sink previously.

Yes, right, I did not take into account that the algorithm checks
the port state as well.

More information about the pulseaudio-discuss mailing list