Skip to content

filter-utils: always evaluate filters before 'linking/rescan' hook

This MR fixes a small issue causing smart filters not to be linked correctly when wireplumber starts and no clients are connected yet.

For example, if we create 2 loopback input smart filters in the context.modules section from wireplumber.conf, like this:

  ## Virtual Sink 1
  { name = libpipewire-module-loopback
    args = {
      node.name = virtual-sink-1
      node.description = "Virtual Sink 1"
      capture.props = {
        audio.position = [ FL FR ]
        media.class = Audio/Sink
        filter.smart = true
      }
      playback.props = {
        audio.position = [ FL FR ]
        stream.dont-remix = true
        node.passive = true
      }
    }
  }

  ## Virtual Sink 2
  { name = libpipewire-module-loopback
    args = {
      node.name = virtual-sink-2
      node.description = "Virtual Sink 2"
      capture.props = {
        audio.position = [ FL FR ]
        media.class = Audio/Sink
        filter.smart = true
      }
      playback.props = {
        audio.position = [ FL FR ]
        stream.dont-remix = true
        node.passive = true
      }
    }
  }

And start wireplumber, both filters will be linked with the default device (instead of in a chain). The filters will be linked correctly in a chain when a client triggers again the rescan hook though... but this is not ideal as the filters need to be linked correctly in a chain right when wireplumber starts.

To fix this, the hook that evaluates the filter properties ("lib/filter-utils/rescan") needs to always be processed before the rescan hook ("linking/rescan"), which is what this patch does.

Merge request reports