diff --git a/wireplumber/.config/wireplumber/bluetooth.lua.d/51-bluez-config.lua b/wireplumber/.config/wireplumber/bluetooth.lua.d/51-bluez-config.lua deleted file mode 100644 index 4832896..0000000 --- a/wireplumber/.config/wireplumber/bluetooth.lua.d/51-bluez-config.lua +++ /dev/null @@ -1,5 +0,0 @@ -bluez_monitor.properties = { - ["bluez5.enable-sbc-xq"] = true, - ["bluez5.enable-msbc"] = true, - ["bluez5.codecs"] = "[ldac aac aptx_hd sbc_xq aptx sbc]", -} diff --git a/wireplumber/.config/wireplumber/main.lua.d/51-alsa-disable.lua b/wireplumber/.config/wireplumber/main.lua.d/51-alsa-disable.lua deleted file mode 100644 index 020693c..0000000 --- a/wireplumber/.config/wireplumber/main.lua.d/51-alsa-disable.lua +++ /dev/null @@ -1,22 +0,0 @@ -disable_C920_mic_rule = { - matches = { - { - { "node.nick", "equals", "HD Pro Webcam C920" }, - { "media.class", "equals", "Audio/Source" }, - }, - }, - apply_properties = { ["node.disabled"] = true, }, -} - -disable_hdmi_audio_rule = { - matches = { - { - { "node.nick" , "equals", "LG HDR 4K" }, - { "media.class", "equals", "Audio/Sink" }, - }, - }, - apply_properties = { ["node.disabled"] = true, }, -} - -table.insert(alsa_monitor.rules, disable_C920_mic_rule) -table.insert(alsa_monitor.rules, disable_hdmi_audio_rule) diff --git a/wireplumber/.config/wireplumber/main.lua.d/60-mic-volume-default.lua b/wireplumber/.config/wireplumber/main.lua.d/60-mic-volume-default.lua deleted file mode 100644 index e79da7e..0000000 --- a/wireplumber/.config/wireplumber/main.lua.d/60-mic-volume-default.lua +++ /dev/null @@ -1,34 +0,0 @@ -stream_defaults = {} -stream_defaults.enabled = true - -stream_defaults.properties = { - ["restore-props"] = true, - ["restore-target"] = true, - ["default-channel-volume"] = 0.9, -} - -stream_defaults.rules = { - { - matches = { - { - { "node.nick", "matches", "USB PnP Audio Device" }, - }, - }, - apply_properties = { - ["state.restore-props"] = false, - ["state.restore-target"] = false, - ["state.default-channel-volume"] = 0.9, - }, - }, -} - -function stream_defaults.enable() - if stream_defaults.enabled == false then - return - end - - load_script("restore-stream.lua", { - properties = stream_defaults.properties, - rules = stream_defaults.rules, - }) -end diff --git a/wireplumber/.config/wireplumber/policy.lua.d/11-bluetooth-policy.lua b/wireplumber/.config/wireplumber/policy.lua.d/11-bluetooth-policy.lua deleted file mode 100644 index eab8f92..0000000 --- a/wireplumber/.config/wireplumber/policy.lua.d/11-bluetooth-policy.lua +++ /dev/null @@ -1 +0,0 @@ -bluetooth_policy.policy["media-role.use-headset-profile"] = false diff --git a/wireplumber/.config/wireplumber/wireplumber.conf.d/51-alsa.conf b/wireplumber/.config/wireplumber/wireplumber.conf.d/51-alsa.conf new file mode 100644 index 0000000..5cfda8d --- /dev/null +++ b/wireplumber/.config/wireplumber/wireplumber.conf.d/51-alsa.conf @@ -0,0 +1,42 @@ +monitor.alsa.rules = [ + { + matches = [ + { + node.nick = "iFi (by AMR) HD USB Audio" + media.class = "Audio/Sink" + } + ] + actions = { + update-props = { + audio.rate = 192000 + audio.allowed-rates = "48000,88200,96000,176400,192000,352800,384000" + } + } + } + { + matches = [ + { + node.nick = "HD Pro Webcam C920" + media.class = "Audio/Source" + } + ] + actions = { + update-props = { + node.disabled = true + } + } + } + { + matches = [ + { + node.nick = "LG HDR 4K" + media.class = "Audio/Sink" + } + ] + actions = { + update-props = { + node.disabled = true + } + } + } +] diff --git a/wireplumber/.config/wireplumber/wireplumber.conf.d/81-bluez-properties.conf b/wireplumber/.config/wireplumber/wireplumber.conf.d/81-bluez-properties.conf new file mode 100644 index 0000000..fb9b0e5 --- /dev/null +++ b/wireplumber/.config/wireplumber/wireplumber.conf.d/81-bluez-properties.conf @@ -0,0 +1,5 @@ +monitor.bluez.properties = { + bluez5.codecs = [ sbc_xq sbc ] + bluez5.enable-sbc-xq = true + bluez5.enable-msbc = true +} diff --git a/wireplumber/.config/wireplumber/wireplumber.conf.d/custom.conf b/wireplumber/.config/wireplumber/wireplumber.conf.d/custom.conf new file mode 100644 index 0000000..87e29bd --- /dev/null +++ b/wireplumber/.config/wireplumber/wireplumber.conf.d/custom.conf @@ -0,0 +1,21 @@ +wireplumber.components = [ + { + name = equalizer/dt770.lua, type = script/lua + provides = equalizer.dt770 + } + { + name = equalizer/input-denoise.lua, type = script/lua + provides = equalizer.input-denoise + } +] + +wireplumber.profiles = { + main = { + equalizer.dt770 = required + equalizer.input-denoise = required + } +} + +wireplumber.settings = { + bluetooth.autoswitch-to-headset-profile = false +} diff --git a/wireplumber/.local/share/wireplumber/scripts/equalizer/dt770.lua b/wireplumber/.local/share/wireplumber/scripts/equalizer/dt770.lua new file mode 100644 index 0000000..7264755 --- /dev/null +++ b/wireplumber/.local/share/wireplumber/scripts/equalizer/dt770.lua @@ -0,0 +1,104 @@ +-- Generated by EQ'ing DT-770 frequency response to the Harman Linear Bass +-- curve on squig.link. +-- luacheck: ignore 111 113 +local args = { + ["node.description"] = "DT770 Equalizer Sink", + ["media.name"] = "DT770 Equalizer Sink", + ["audio.position"] = Json.Array { "FL", "FR" }, + ["audio.channels"] = 2, +} + +args["filter.graph"] = Json.Object { + nodes = Json.Array { + Json.Object { + type = "builtin", + name = "eq_band_1", + label = "bq_highshelf", + control = Json.Object { Freq = 0, Gain = -4.7, Q = 1.0 }, + }, + Json.Object { + type = "builtin", + name = "eq_band_2", + label = "bq_peaking", + control = Json.Object { Freq = 45, Gain = -5.6, Q = 0.9 }, + }, + Json.Object { + type = "builtin", + name = "eq_band_3", + label = "bq_peaking", + control = Json.Object { Freq = 85, Gain = 2.6, Q = 2.0 }, + }, + Json.Object { + type = "builtin", + name = "eq_band_4", + label = "bq_lowshelf", + control = Json.Object { Freq = 120, Gain = -2.1, Q = 2.0 }, + }, + Json.Object { + type = "builtin", + name = "eq_band_5", + label = "bq_peaking", + control = Json.Object { Freq = 200, Gain = 5.3, Q = 2.0 }, + }, + Json.Object { + type = "builtin", + name = "eq_band_6", + label = "bq_peaking", + control = Json.Object { Freq = 1800, Gain = 1.4, Q = 2.0 }, + }, + Json.Object { + type = "builtin", + name = "eq_band_7", + label = "bq_peaking", + control = Json.Object { Freq = 2700, Gain = -4.1, Q = 1.7 }, + }, + Json.Object { + type = "builtin", + name = "eq_band_8", + label = "bq_peaking", + control = Json.Object { Freq = 3700, Gain = 10.6, Q = 2.0 }, + }, + Json.Object { + type = "builtin", + name = "eq_band_9", + label = "bq_peaking", + control = Json.Object { Freq = 4300, Gain = -3.8, Q = 2.0 }, + }, + Json.Object { + type = "builtin", + name = "eq_band_10", + label = "bq_peaking", + control = Json.Object { Freq = 5300, Gain = -3.7, Q = 1.2 }, + }, + }, + links = Json.Array { + Json.Object { output = "eq_band_1:Out" , input = "eq_band_2:In" }, + Json.Object { output = "eq_band_2:Out" , input = "eq_band_3:In" }, + Json.Object { output = "eq_band_3:Out" , input = "eq_band_4:In" }, + Json.Object { output = "eq_band_4:Out" , input = "eq_band_5:In" }, + Json.Object { output = "eq_band_5:Out" , input = "eq_band_6:In" }, + Json.Object { output = "eq_band_6:Out" , input = "eq_band_7:In" }, + Json.Object { output = "eq_band_7:Out" , input = "eq_band_8:In" }, + Json.Object { output = "eq_band_8:Out" , input = "eq_band_9:In" }, + Json.Object { output = "eq_band_9:Out" , input = "eq_band_10:In" }, + }, +} + +args["capture.props"] = Json.Object { + ["node.name"] = "dt770_effect_input.eq10", + ["media.class"] = "Audio/Sink", +} + +args["playback.props"] = Json.Object { + ["node.name"] = "dt770_effect_output.eq10", + ["node.passive"] = true, +} + +local args_json = Json.Object(args) +local args_string = args_json:get_data() +local properties = {} + +print("Loading DT770 Equalizer Sink with arguments = ") +print(args_string) + +filter_chain = LocalModule("libpipewire-module-filter-chain", args_string, properties) diff --git a/wireplumber/.local/share/wireplumber/scripts/equalizer/input-denoise.lua b/wireplumber/.local/share/wireplumber/scripts/equalizer/input-denoise.lua new file mode 100644 index 0000000..11c3a24 --- /dev/null +++ b/wireplumber/.local/share/wireplumber/scripts/equalizer/input-denoise.lua @@ -0,0 +1,42 @@ +-- luacheck: ignore 111 113 +local args = { + ["node.description"] = "Noise Canceling Source", + ["media.name"] = "Noise Canceling Source", +} + +args["filter.graph"] = Json.Object { + nodes = Json.Array { + Json.Object { + type = "ladspa", + name = "rnnoise", + plugin = "/usr/lib/ladspa/librnnoise_ladspa.so", + label = "noise_suppressor_mono", + control = Json.Object { + ["VAD Threshold (%)"] = 50.0, + ["VAD Grace Period (ms)"] = 200.0, + ["Retroactive VAD Grace (ms)"] = 0.0 + }, + }, + }, +} + +args["capture.props"] = Json.Object { + ["node.name"] = "capture.rnnoise_source", + ["node.passive"] = "true", + ["audio.rate"] = 48000, +} + +args["playback.props"] = Json.Object { + ["node.name"] = "rnnoise_source", + ["media.class"] = "Audio/Source", + ["audio.rate"] = 48000, +} + +local args_json = Json.Object(args) +local args_string = args_json:get_data() +local properties = {} + +print("Loading Noise Canceling Source with arguments = ") +print(args_string) + +filter_chain = LocalModule("libpipewire-module-filter-chain", args_string, properties)