From 94b7e38c4dfb91070e08fd55a55a95d99c382362 Mon Sep 17 00:00:00 2001 From: hesam-init Date: Sat, 2 Nov 2024 20:09:41 +0330 Subject: [PATCH] fix: pipewire plugin launch fails --- .../hypr/configs/rules/workspaces.conf | 2 +- .../pipewire/pipewire.conf.d/1-pipewire.conf | 37 ++++++ .../pipewire.conf.d/99-deepfilter-stereo.conf | 124 +++++++++--------- .../pipewire.conf.d/99-input-denoising.conf | 69 +++++----- 4 files changed, 136 insertions(+), 96 deletions(-) create mode 100644 hypr-configs/dotfiles/pipewire/pipewire.conf.d/1-pipewire.conf diff --git a/hypr-configs/dotfiles/hypr/configs/rules/workspaces.conf b/hypr-configs/dotfiles/hypr/configs/rules/workspaces.conf index 4cf006a..c88bc0b 100644 --- a/hypr-configs/dotfiles/hypr/configs/rules/workspaces.conf +++ b/hypr-configs/dotfiles/hypr/configs/rules/workspaces.conf @@ -4,7 +4,7 @@ windowrulev2 = workspace 1,class:^(Thorium-browser|chrome|google-chrome|Chrome|Firefox|firefox|FreeTube)$ windowrulev2 = workspace 2,class:^(code-url-handler|code|Code|Code - OSS|.*jetbrains.*)$ -windowrulev2 = workspace 3,class:^(nekoray|Nekoray|hiddify)$ +# windowrulev2 = workspace 3,class:^(nekoray|Nekoray|hiddify)$ windowrulev2 = workspace 4,class:^(org.telegram.desktop|telegramdesktop|discord|vesktop)$ windowrulev2 = workspace 5,class:^(Spotify)$ # windowrulev2 = workspace 6,title:^(.*PCSX2.*)$ diff --git a/hypr-configs/dotfiles/pipewire/pipewire.conf.d/1-pipewire.conf b/hypr-configs/dotfiles/pipewire/pipewire.conf.d/1-pipewire.conf new file mode 100644 index 0000000..8acd25c --- /dev/null +++ b/hypr-configs/dotfiles/pipewire/pipewire.conf.d/1-pipewire.conf @@ -0,0 +1,37 @@ + +context.properties = { + ## Properties for the DSP configuration. + default.clock.rate = 192000 + default.clock.allowed-rates = [ 44100 48000 88200 96000 192000 352800 384000] + default.clock.quantum = 32 + default.clock.min-quantum = 16 + default.clock.max-quantum = 768 +} + +context.modules = [ + #{ name = + # ( args = { = ... } ) + # ( flags = [ ( ifexists ) ( nofail ) ] ) + # ( condition = [ { = ... } ... ] ) + #} + # + # Loads a module with the given parameters. + # If ifexists is given, the module is ignored when it is not found. + # If nofail is given, module initialization failures are ignored. + # If condition is given, the module is loaded only when the context + # properties all match the match rules. + # + + # Uses realtime scheduling to boost the audio thread priorities. This uses + # RTKit if the user doesn't have permission to use regular realtime + # scheduling. + { name = libpipewire-module-rt + args = { + nice.level = -12 + rt.prio = 89 + rt.time.soft = 200000 + rt.time.hard = 200000 + } + flags = [ ifexists nofail ] + } +] \ No newline at end of file diff --git a/hypr-configs/dotfiles/pipewire/pipewire.conf.d/99-deepfilter-stereo.conf b/hypr-configs/dotfiles/pipewire/pipewire.conf.d/99-deepfilter-stereo.conf index 43460ac..1164ae4 100644 --- a/hypr-configs/dotfiles/pipewire/pipewire.conf.d/99-deepfilter-stereo.conf +++ b/hypr-configs/dotfiles/pipewire/pipewire.conf.d/99-deepfilter-stereo.conf @@ -1,61 +1,63 @@ -context.modules = [ - { - name = libpipewire-module-filter-chain - args = { - node.description = "DeepFilter Noise Canceling Source" - media.name = "DeepFilter Noise Canceling Source" - filter.graph = { - nodes = [ - { - type = ladspa - name = "DeepFilter Mono" - plugin = /home/hesam/Pipewire/libdeep_filter_ladspa-0.5.6-x86_64-unknown-linux-gnu.so - label = deep_filter_mono - control = { - "Attenuation Limit (dB)" 100 - } - } - ] - } - audio.rate = 48000 - audio.position = [MONO] - capture.props = { - node.passive = true - } - playback.props = { - media.class = Audio/Source - } - } - }, - # { - # name = libpipewire-module-filter-chain - # args = { - # node.description = "DeepFilter Noise Canceling Sink" - # media.name = "DeepFilter Noise Canceling Sink" - # filter.graph = { - # nodes = [ - # { - # type = ladspa - # name = "DeepFilter Stereo" - # plugin = /home/hesam/Pipewire/libdeep_filter_ladspa-0.5.6-x86_64-unknown-linux-gnu.so - # label = deep_filter_stereo - # control = { - # "Attenuation Limit (dB)" 100 - # } - # } - # ] - # } - # audio.rate = 48000 - # audio.channels = 2 - # audio.position = [FL FR] - # capture.props = { - # node.name = "deep_filter_stereo_input" - # media.class = Audio/Sink - # } - # playback.props = { - # node.name = "deep_filter_stereo_output" - # node.passive = true - # } - # } - # } -] \ No newline at end of file +# context.modules = [ +# { +# name = libpipewire-module-filter-chain +# flags = [ ifexists nofail ] +# args = { +# node.description = "DeepFilter Noise Canceling Source" +# media.name = "DeepFilter Noise Canceling Source" +# filter.graph = { +# nodes = [ +# { +# type = ladspa +# name = "DeepFilter Mono" +# plugin = /home/hesam/Pipewire/libdeep_filter_ladspa-0.5.6-x86_64-unknown-linux-gnu.so +# label = deep_filter_mono +# control = { +# "Attenuation Limit (dB)" 100 +# } +# } +# ] +# } +# audio.rate = 48000 +# audio.position = [MONO] +# capture.props = { +# node.passive = true +# } +# playback.props = { +# media.class = Audio/Source +# } +# } +# }, +# { +# name = libpipewire-module-filter-chain +# flags = [ ifexists nofail ] +# args = { +# node.description = "DeepFilter Noise Canceling Sink" +# media.name = "DeepFilter Noise Canceling Sink" +# filter.graph = { +# nodes = [ +# { +# type = ladspa +# name = "DeepFilter Stereo" +# plugin = /home/hesam/Pipewire/libdeep_filter_ladspa-0.5.6-x86_64-unknown-linux-gnu.so +# label = deep_filter_stereo +# control = { +# "Attenuation Limit (dB)" 100 +# } +# } +# ] +# } +# audio.rate = 48000 +# audio.channels = 2 +# audio.position = [FL FR] +# capture.props = { +# node.name = "deep_filter_stereo_input" +# media.class = Audio/Sink +# } +# playback.props = { +# node.name = "deep_filter_stereo_output" +# node.passive = true +# } +# } +# } +# ] diff --git a/hypr-configs/dotfiles/pipewire/pipewire.conf.d/99-input-denoising.conf b/hypr-configs/dotfiles/pipewire/pipewire.conf.d/99-input-denoising.conf index b2a1ab6..449dc56 100644 --- a/hypr-configs/dotfiles/pipewire/pipewire.conf.d/99-input-denoising.conf +++ b/hypr-configs/dotfiles/pipewire/pipewire.conf.d/99-input-denoising.conf @@ -1,34 +1,35 @@ -# context.modules = [ -# { -# name = libpipewire-module-filter-chain -# args = { -# node.description = "Noise Canceling source" -# media.name = "Noise Canceling source" -# filter.graph = { -# nodes = [ -# { -# type = ladspa -# name = rnnoise -# plugin = /home/hesam/Pipewire/linux-rnnoise/ladspa/librnnoise_ladspa.so -# label = noise_suppressor_mono -# control = { -# "VAD Threshold (%)" = 50.0 -# "VAD Grace Period (ms)" = 200 -# "Retroactive VAD Grace (ms)" = 0 -# } -# } -# ] -# } -# capture.props = { -# node.name = "capture.rnnoise_source" -# node.passive = true -# audio.rate = 48000 -# } -# playback.props = { -# node.name = "rnnoise_source" -# media.class = Audio/Source -# audio.rate = 48000 -# } -# } -# } -# ] +context.modules = [ + { + name = libpipewire-module-filter-chain + flags = [ ifexists nofail ] + args = { + node.description = "Noise Canceling source" + media.name = "Noise Canceling source" + filter.graph = { + nodes = [ + { + type = ladspa + name = rnnoise + plugin = /home/hesam/Pipewire/linux-rnnoise/ladspa/librnnoise_ladspa.so + label = noise_suppressor_mono + control = { + "VAD Threshold (%)" = 50.0 + "VAD Grace Period (ms)" = 200 + "Retroactive VAD Grace (ms)" = 0 + } + } + ] + } + capture.props = { + node.name = "capture.rnnoise_source" + node.passive = true + audio.rate = 48000 + } + playback.props = { + node.name = "rnnoise_source" + media.class = Audio/Source + audio.rate = 48000 + } + } + } +]