werman / noise-suppression-for-voice

Noise suppression plugin based on Xiph's RNNoise
GNU General Public License v3.0
5.05k stars 234 forks source link

[Pipewire on Arch Linux] Using pipewire normal command works fine but pipewire using the ladspa plugin doesn't #104

Open ThatOneOcto opened 2 years ago

ThatOneOcto commented 2 years ago

Config from the wiki

# Noise canceling source
#
# start with pipewire -c filter-chain/source-rnnoise.conf
#
context.properties = {
    log.level        = 0
}

context.spa-libs = {
    audio.convert.* = audioconvert/libspa-audioconvert
    support.*       = support/libspa-support
}

context.modules = [
    {   name = libpipewire-module-rtkit
        args = {
            #nice.level   = -11
            #rt.prio      = 88
            #rt.time.soft = 200000
            #rt.time.hard = 200000
        }
        flags = [ ifexists nofail ]
    }
    {   name = libpipewire-module-protocol-native }
    {   name = libpipewire-module-client-node }
    {   name = libpipewire-module-adapter }

    {   name = libpipewire-module-filter-chain
        args = {
            node.name =  "rnnoise_source"
            node.description =  "Noise Canceling source"
            media.name =  "Noise Canceling source"
            filter.graph = {
                nodes = [
                    {
                        type = ladspa
                        name = rnnoise
                        plugin = /home/adrian/.config/ladspa_plugin.so
                        label = noise_suppressor_stereo
                        control = {
                            "VAD Threshold (%)" 50.0
                        }
                    }
                ]
            }
            capture.props = {
                node.passive = true
            }
            playback.props = {
                media.class = Audio/Source
            }
        }
    }
]

.xinitrc (modified pipewire commented so pipewire works)

nmcli r wifi on
slstatus &
xfce4-clipman &
dunst &
sxhkd &
#/usr/bin/pipewire/ -c /home/adrian/.config/noisesuppresion.txt
pipewire &
pipewire-pulse &
wireplumber &
xbacklight +100
exec dwm

If you need more information, please ask, I'll provide you with info

werman commented 2 years ago

Maybe the load of config should be after the pipewire is started, since I e.g. have systemd service which depends on pipewire:

[Unit]
Description=PipeWire Custom Filter Chain
After=pipewire.service
BindsTo=pipewire.service