diff --git a/src/config/wireplumber.conf b/src/config/wireplumber.conf index a8359958..822b7967 100644 --- a/src/config/wireplumber.conf +++ b/src/config/wireplumber.conf @@ -520,8 +520,8 @@ wireplumber.components = [ provides = hooks.stream.state } { - name = linking/filter-forward-format.lua, type = script/lua - provides = hooks.loopback.forward-format + name = node/filter-forward-format.lua, type = script/lua + provides = hooks.filter.forward-format } { name = node/create-virtual-item.lua, type = script/lua @@ -606,7 +606,7 @@ wireplumber.components = [ support.standard-event-source ] wants = [ hooks.node.suspend hooks.stream.state - hooks.loopback.forward-format ] + hooks.filter.forward-format ] } { type = virtual, provides = policy.role-priority-system diff --git a/src/config/wireplumber.conf.d.examples/linking.conf b/src/config/wireplumber.conf.d.examples/linking.conf index 19669ef8..b9292bfe 100644 --- a/src/config/wireplumber.conf.d.examples/linking.conf +++ b/src/config/wireplumber.conf.d.examples/linking.conf @@ -7,9 +7,4 @@ wireplumber.settings = { ## Moves session items to the default device when it has changed # linking.follow-default-target = true - - ## Whether to forward the ports format of filter stream nodes to their - ## associated filter device nodes. This is needed for application to stream - ## surround audio if echo-cancel is enabled. - # linking.filter-forward-format = false } diff --git a/src/scripts/lib/SETTINGS.rst b/src/scripts/lib/SETTINGS.rst index a877d82a..cd24368e 100644 --- a/src/scripts/lib/SETTINGS.rst +++ b/src/scripts/lib/SETTINGS.rst @@ -81,22 +81,6 @@ :Default value: ``true`` -.. describe:: linking.filter-forward-format - - When a "filter" pair of nodes (such as echo-cancel or filter-chain) is - linked to a device node that has a different channel map than the filter - nodes, this option allows the channel map of the filter nodes to be changed - to match the channel map of the device node. The change is applied to both - ends of the "filter", so that any streams linked to the filter are also - reconfigured to match the target channel map. - - This is useful, for instance, to make sure that an application will be - properly configured to output surround audio to a surround device, even - when going through a filter that was not explicitly configured to have - a surround channel map. - - :Default value: ``false`` - .. describe:: node.features.audio.no-dsp When this option is set to ``true``, audio nodes will not be configured @@ -180,6 +164,22 @@ :Default value: ``1.0`` :Range: ``0.0`` to ``1.0`` +.. describe:: node.filter.forward-format + + When a "filter" pair of nodes (such as echo-cancel or filter-chain) is + linked to a device node that has a different channel map than the filter + nodes, this option allows the channel map of the filter nodes to be changed + to match the channel map of the device node. The change is applied to both + ends of the "filter", so that any streams linked to the filter are also + reconfigured to match the target channel map. + + This is useful, for instance, to make sure that an application will be + properly configured to output surround audio to a surround device, even + when going through a filter that was not explicitly configured to have + a surround channel map. + + :Default value: ``false`` + .. describe:: node.restore-default-targets This setting enables WirePlumber to store and restore the "default" source diff --git a/src/scripts/lib/settings-linking.lua b/src/scripts/lib/settings-linking.lua index 38aa03a2..bef0445d 100644 --- a/src/scripts/lib/settings-linking.lua +++ b/src/scripts/lib/settings-linking.lua @@ -11,7 +11,6 @@ local settings_manager = require ("settings-manager") local defaults = { ["allow-moving-streams"] = true, ["follow-default-target"] = true, - ["filter-forward-format"] = false, } return settings_manager.new ("linking.", defaults) diff --git a/src/scripts/lib/settings-node.lua b/src/scripts/lib/settings-node.lua index 481c841c..fd2ecee2 100644 --- a/src/scripts/lib/settings-node.lua +++ b/src/scripts/lib/settings-node.lua @@ -18,6 +18,8 @@ local defaults = { ["stream.default-playback-volume"] = 1.0, ["stream.default-capture-volume"] = 1.0, + ["filter.forward-format"] = false, + ["restore-default-targets"] = true, } diff --git a/src/scripts/linking/README.rst b/src/scripts/linking/README.rst index 3a74344c..d53f7eaa 100644 --- a/src/scripts/linking/README.rst +++ b/src/scripts/linking/README.rst @@ -49,11 +49,6 @@ processed while targets are being selected. - metadata-changed - schedules rescan-for-linking when node target metadata properties are changed - * - linking/filter-forward-format - - filter-forward-format.lua - - filter stream SI added - - configures filter nodes to have the same port format on both ends - * - linking/rescan-virtual-links - rescan-virtual-links.lua - link SI added, removed or metadata-changed diff --git a/src/scripts/linking/filter-forward-format.lua b/src/scripts/node/filter-forward-format.lua similarity index 95% rename from src/scripts/linking/filter-forward-format.lua rename to src/scripts/node/filter-forward-format.lua index 98c1bc35..1ad33228 100644 --- a/src/scripts/linking/filter-forward-format.lua +++ b/src/scripts/node/filter-forward-format.lua @@ -11,8 +11,8 @@ -- FIXME: this script can be further improved lutils = require ("linking-utils") -settings = require ("settings-linking") -log = Log.open_topic ("s-linking") +settings = require ("settings-node") +log = Log.open_topic ("s-node") function findAssociatedLinkGroupNode (si) local si_props = si.properties @@ -80,7 +80,7 @@ function onLinkGroupPortsStateChanged (si, old_state, new_state) end SimpleEventHook { - name = "linking/filter-forward-format", + name = "node/filter-forward-format", interests = { EventInterest { Constraint { "event.type", "=", "session-item-added" }, @@ -93,7 +93,7 @@ SimpleEventHook { local si = event:get_subject () -- Forward filters ports format to associated virtual devices if enabled - if settings.filter_forward_format then + if settings["filter.forward-format"] then local si_props = si.properties local link_group = si_props ["node.link-group"] local si_flags = lutils:get_flags (si.id)