target.object / filter.target is ignored (sometimes)
I have some bluetooth headphones. I use a virtual device filter to apply EQ to the incoming signal (convolver filters implementing AutoEQ, you may be familiar with it) and I set the target.object property to point this virtual device to my bluetooth headphones.
When I turn on the headphones, wireplumber magically connects the virtual device to the headphones and it works like a charm. Magic! When I turn off the headphones, the link is destroyed and the virtual device output remains unlinked and the node becomes idle, saving CPU cycles. More magic! If I turn them back on, it links them again and the magic just never ends! Love it!
But here's the problem: If the bluetooth headphones are not connected when pipewire starts, wireplumber (presumedly) attempts to link to the target device, which does not exist, and so it falls back to link the virtual device to the default output sink. Accordingly the convolver is sitting there doing magic and using my CPU for nothing.
Similarly, if I connect the headphones, and they connect to the virtual device as per target.object, then I turn off the headphones, leaving them disconnected, then I change my default sink - it then connects the output of the virtual device to the new default sink.
I thought perhaps node.exclusive = true
might help here, but no such luck.
Now, I can see that in many cases it makes a lot of sense to connect to the default sink if the target sink is not present, so this behaviour does make sense... But here's a good example of where that is not the case (and I can imagine quite a few). Is there a way to make target.object the EXCLUSIVE target of the node, so that it will link to that target object, and ONLY that target object, without falling back to the default sink? Perhaps using node.exclusive
might be a good way to signal this intention, or perhaps a new parameter would be in order.
I do understand that I could re-write the lua script for linking the nodes, with specific exclusions for my devices, or perhaps to utilise node.exclusive
as suggested, but I hope for a less specific (read: not just something that works for me, but something anyone can use) approach.
I could perhaps alter the existing lua scripts to use node.exclusive as a 'flag' to not fall-back, and provide an MR, if you would like that? Anything I can do to help!
Edit: I am using wireplumber's next branch (which is amazing and I love it) but this also happens with the master branch). I thought I should mention it.