[pulseaudio-discuss] Add filter to module-switch-on-connect

Arun Raghavan arun at accosted.net
Mon May 2 14:04:14 UTC 2016


On 1 May 2016 at 07:36,  <mudrunka at spoje.net> wrote:
> Hello,
> i've understood that i can use module-switch-on-connect to automatically
> switch to bluetooth speaker as soon as it gets connected. However i don't
> want this to happen for ethernet sinks. We have like 8 IP sinks in our
> network (randomly connecting and disconnecting - each station in our office
> has public pulseaudio server), so i guess it would be complete mess. But i'd
> still like to use them manually at will, but have it done automatically for
> paired bt devices.
>
> So i'd like module-switch-on-connect to have some optional whitelist of
> devices, so i can load it like eg.:
>
> load-module module-switch-on-connect
> whitelist='bluetooth:*,avahi:192.168.23.0/24,avahi:10.11.23.23'
>
> which would enable automatic switch for bt devices with any MAC, any
> avahi-discovered device in 192.168.23.0/24 subnet and avahi device on
> 10.11.23.23.
>
> What do you think about this concept? is it doable?

You could potentially add some code to filter on the sink flags before
connecting and not switch to sinks with the network flag (this could
be a modarg, with default behaviour being what you suggest).

This, coupled with something like Tanu's preferred port work
(https://patchwork.freedesktop.org/series/4093/) might get you what
you want -- you select your network sink once, and it should get
auto-selected the next time (ignoring the network flag checking
logic).

-- Arun


More information about the pulseaudio-discuss mailing list