NOC online · 24/7Longview, TX · +1 323 412 0665
KinetikatechServers · Security · Websites
GA

Tá an treoir mhionsonraithe seo ar fáil i mBéarla.

English version

Linux Desktops and User Land Infrastructure

Configuring PipeWire Filter Chains to Inject Real-Time Noise Cancellation into System Audio Inputs

PipeWire's filter-chain module can insert DSP plugins into any audio path, including microphone inputs. By chaining a noise suppression plugin ahead of the application, you get clean voice audio without modifying each app. This guide builds a filter chain for real-time noise cancellation.

Príomhphointí

  • Install a noise suppression plugin. LADSPA or LV2 plugins such as rnnoise provide the suppression algorithm.
  • Define the filter chain. A config file declares nodes, links, and plugin parameters in the PipeWire graph.
  • Route the microphone through the chain. Connect the physical input to the filter, then the filter to the application input.
  • Tune plugin parameters. Adjust aggressiveness and VAD thresholds to balance suppression and voice clarity.
  • Persist across sessions. Place the config in /etc/pipewire/pipewire.conf.d so it loads at startup.
  • Verify with a test recording. Record before and after to confirm suppression without artifacts.
  • Monitor CPU usage. Real-time DSP consumes cycles; keep headroom for the rest of the system.
  • Handle multiple microphones. Each input needs its own chain instance or a shared chain with dynamic routing.

Architecture

The microphone feeds a PipeWire filter node that hosts the DSP plugin. The filter output connects to the virtual input that applications read. The graph is managed by WirePlumber, and the plugin runs in the PipeWire process with real-time priority.

Production configuration

Filter chain configuration ini
# /etc/pipewire/pipewire.conf.d/20-noise-cancel.conf
context.modules = [
  { name = libpipewire-module-filter-chain
    args = {
      node.description = "Noise Cancelled Mic"
      media.name = "Noise Cancelled Mic"
      filter.graph = {
        nodes = [
          { type = ladspa name = rnnoise plugin = "/usr/lib/ladspa/librnnoise_ladspa.so" label = "noise_suppressor" }
        ]
        inputs = [ "rnnoise:in" ]
        outputs = [ "rnnoise:out" ]
      }
      capture.props = { node.target = "alsa_input.usb-mic" }
      playback.props = { media.class = "Audio/Source" }
    }
  }
]
Verify the graph and test bash
pw-cli list-objects | grep -i 'Noise Cancelled'
pw-link -l | grep -i noise
# record a test
cat /dev/zero | head -c 0; arecord -D pipewire -f S16_LE -r 48000 -c 1 -d 5 /tmp/test.wav
aplay /tmp/test.wav
Tune plugin parameters bash
# adjust in the filter.graph node block
control = {
  "VAD Threshold" = 0.5
  "Noise Reduction" = 0.8
}
# reload
systemctl --user restart pipewire wireplumber

Edge cases from production

  • Some plugins introduce latency; measure round-trip delay and compensate in conferencing apps.
  • Aggressive suppression clips consonants; reduce the threshold for speakers with soft voices.
  • USB microphones with built-in DSP conflict with the software chain; disable hardware processing first.
  • Filter chains do not survive a WirePlumber restart unless the config is in the right directory.

Ceisteanna coitianta

Does this work with any microphone?

Yes, as long as PipeWire can capture from it; the chain sits between the device and the application.

Will it add latency to calls?

A few milliseconds, usually imperceptible; measure with a loopback test.

Can I use it for music recording?

No, suppression removes musical content along with noise; use it for voice only.

How do I disable it quickly?

Remove or rename the config file and restart PipeWire.

Does it work on Wayland and X11?

PipeWire is display-server agnostic; the filter chain runs in the audio server.

Conas a chabhraíonn Kinetikatech le linux desktops and user land infrastructure

Ní gá duit a bheith i do shaineolaí ar linux desktops and user land infrastructure: Hardening compositors, sandboxing desktop apps, and tuning the user land that developers and operators actually touch. Is ar an gcúis sin go díreach atá Bainistíocht Freastalaithe agus Cothabháil Suíomh Gréasáin ann: cur i mbun, daingniú, faireachán agus duine ar dualgas de lá is d'oíche.

Labhair le hinnealtóir

Fadhb ar an freastalaí? Suíomh hackáilte? Luchtú mall?

Solúfar fadhbanna criticiúla laistigh de 30 nóiméad — gan stad, 7 lá sa tseachtain.

Iarr tacaíocht éigeandála support@kinetikatech.com