Skip to content

About

Route all the nodes like EasyEffects does

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

pwautofxroute

The LV2 plugin in this repo is unusable, probably can be fixed but I don't want to.

You SHOULD build it using default-clang preset. Up to now only clang can build this. gcc fails with some gibberish. After that just run Carla (at Continuous Rack mode) and then run run.sh.

This thing is completely inspired by EasyEffects (and uses some code of it, thx @wwmm).

PWAFR_NAME can be unset or empty, in this case it should be iid0 (see code).

pwautofxroute_standalone does not route from the virtual sink to DSP. You have to do it yourself (as run.sh does it by pw-link).

Tested under clang 22.1.8.

This thing uses @Curve's rohrkabel and coco. They are great works, check out them (and other things Noah created)!

If you want to hack with this, try clice, a next-generation C++ language server for modern C++ which supports modules!

Below are written by LLM without edit. Words below are basically but not completely correct.


pwautofxroute is a PipeWire auto-routing tool written in modern C++ (C++23, using C++ modules). It creates a virtual sink and automatically redirects every application audio output stream into a DSP node (for example Carla) so that you can apply real-time effects to all system audio at once.

It is distributed in two forms:

  • A standalone executable that runs as a background service.
  • An LV2 plugin that performs the same routing from inside any LV2 host (e.g. Carla, Ardour).

How it works

  1. On startup a null-audio-sink virtual sink is created (stereo, FL/FR).
  2. Every Stream/Output/Audio node that appears on the PipeWire registry is inspected. Nodes that are not audio output streams, capture sinks, or that match a built-in blocklist (e.g. Easy Effects, pavucontrol, GNOME Shell) are skipped.
  3. For each routable stream, the tool sets the target.node / target.object metadata so the stream is routed into the virtual sink instead of the default output device.
  4. The virtual sink's output ports are then connected to the DSP node owned by the same process (matched by PID), feeding the audio through your effects chain.

Routing is controlled by route rules (from → to). A rule matches a stream's target.object exactly and redirects it to the chosen sink. The default rule routes everything into the virtual sink.

Explicit filtering

You can fine-tune which streams are routed using PipeWire node properties:

Property Value Effect
pwafr.filter include Always route this node.
pwafr.filter exclude Never route this node.
pwafr.<instance>.filter include / exclude Per-instance override of the above.

Building

Dependencies

  • A C++23 compiler with C++ modules support (tested with Clang).
  • CMake 4.0 or newer.
  • Ninja (build generator).
  • PipeWire development libraries.
  • Qt6 (Core component).
  • LV2 development libraries (only required for the plugin target).

The following libraries are fetched automatically via CPM.cmake:

  • rohrkabel — C++ bindings for PipeWire.
  • coco — C++20 coroutine task library.

Configure & build

# Configure (Clang preset is recommended)
cmake --preset default-clang

# Build everything (standalone + LV2 plugin)
cmake --build --preset default-clang

Other presets are available (default, release). Build artifacts land in the preset's binary directory (e.g. cmake-build-debug-clang/).

Install the LV2 plugin

cmake --install cmake-build-debug-clang --component lv2

This installs pwautofxroute.so together with manifest.ttl and pwautofxroute.ttl into lib/lv2/pwautofxroute, making the plugin discoverable by LV2 hosts.

Usage

Standalone

The standalone binary reads the instance name from the PWAFR_NAME environment variable, creates the virtual sink, and routes all audio output streams into it. The helper script run.sh launches it and links the virtual sink to a Carla DSP instance:

PWAFR_NAME=carla ./cmake-build-debug-clang/standalone/pwautofxroute_standalone

run.sh additionally kills any previous instance (tracked via pwafr.pid), starts the binary, and connects the virtual sink (pwafr-vsink-<name>) to a Carla instance using pw-link.

LV2 plugin

Load pwautofxroute into an LV2 host. The plugin exposes:

Port Type Symbol Range Description
Input Audio input — Audio passthrough input.
Output Audio output — Audio passthrough output.
Gain Control gain 0.0 – 10.0 Output gain (default 1.0).
Enabled Control enabled 0.0 – 1.0 When on (>= 0.5), routing is active.

When the Enabled control is turned on, the plugin creates the virtual sink and auto-routes system audio into it; turning it off removes the route rule. The audio ports pass the signal through unchanged (scaled by gain), so the plugin can sit anywhere in your graph without altering the audio path itself.

Project layout

lib/            Core routing library (C++ module `pwautofxroute`)
standalone/     Standalone executable entry point
lv2plug/        LV2 plugin wrapper, TTL metadata and manifest
cmake/          CPM.cmake and CMake helpers
CMakePresets.json  Build presets (default / release / default-clang)
run.sh          Convenience launcher for the standalone binary

License

GPL-3.0-or-later

About

Route all the nodes like EasyEffects does

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages