target.object in client(-rt).conf does not differentiate playback stream from capture stream.
I want a different target.object each for a playback stream and a capture stream.
However, I can't configure it through client(-rt).conf.
I was also not able to set a different target.object each for a playback stream and a capture stream through wireplumber.
The reason that I want a different target.object for a different media.class is that I want to present one default sink that routes sound to different device nodes.
- default-sink(null-audio-sink) --> speaker(loopback) --> alsa-device
- default-sink(null-audio-sink) --> headphone(loopback) --> another-alsa-device
default-sink can switch between speaker and headphone. Speaker loopback automatically connects to a DAC. Headphone loopback automatically connects to another DAC. The DACs can disappear if I turn them off or disconnect them. I want loopbacks to stand in for actual ALSA devices.
The default sink for wireplumber is a null sink which automatically discards everything from loopbacks for which the corresponding ALSA devices are not available. The null sink has higher priority.session
than other sinks.
If I want to switch between two ADCs for recording, then I will want the same setup for source as well.
If I write my own object manager in a wireplumber lua script, then I may be able to set a different target.object
for a different media.class
, but I want this to be configurable as below
table.insert(stream_defaults.rules, {
matches = {
{
{ "media.class", "matches", "Stream/Output/Audio" },
{ "target.object", "is-absent" }
}
},
apply_properties = {
["target.object"] = "default-sink"
}
})
table.insert(stream_defaults.rules, {
matches = {
{
{ "media.class", "matches", "Stream/Input/Audio" },
{ "target.object", "is-absent" }
}
},
apply_properties = {
["target.object"] = "default-source"
}
})