You are not logged in.

#1 2024-05-21 19:05:50

G3ro
Member
Registered: 2020-09-24
Posts: 36

[SOLVED] Pulseaudio: dynamic master sink possible?

Hello,

with the following line I load a ladspa-sink in the local default.pa file; everything is working fine.

 load-module module-ladspa-sink sink_name=compressor sink_master="master_name" plugin=sc4_1882 label=sc4 control=1,1.5,401,-30,20,5,24 

But I would like to be able to set the sink_master dynamically, instead of using a "hardcoded" sink_master, because I use different devices sometimes, including bluetooth speakers, headsets etc.

So if Device A is active (either the only thing available or chosen standard device), sink A should be used as sink_master and when Device B is active, sink B should be used.

Is this possible?

Thx in advance.

Last edited by G3ro (2024-05-22 18:39:42)

Offline

#2 2024-05-22 14:39:30

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,387

Re: [SOLVED] Pulseaudio: dynamic master sink possible?

Not sure and quite doubtful whether just automagically by default, but you can (re-)load with the @DEFAULT_SINK@ special token in pactl commands, so you could do 

pactl module-ladspa-sink  sink_name=compressor sink_master="@DEFAULT_SINK@" plugin=sc4_1882 label=sc4 control=1,1.5,401,-30,20,5,24

If you wanted to get more fancy you could make a pseudo daemon/script that uses pactl subscribe to listen to a change of the default sink and then unload and reload the ladspa sink, but I'd have to dig deeper myself on how to do that exactly. Conceptually, run the above command once initially, store away the id you get returned into a variable, listen to the relevant default change event, unload the previous module with the stored id, load a new one with the new DEFAULT_SINK.

Offline

#3 2024-05-22 18:38:03

G3ro
Member
Registered: 2020-09-24
Posts: 36

Re: [SOLVED] Pulseaudio: dynamic master sink possible?

Thank you very much.

sink_master="@DEFAULT_SINK@" is exactly what I was searching for.

Offline

Board footer

Powered by FluxBB