scripts: move filter-forward-format.lua from 'linking' to 'node' subdirectory

This is because 'filter-forward-format.lua' only configures nodes, and therefore
does not have anything to do with the linking logic. The setting has also been
renamed to 'node.filter.forward-format'.
This commit is contained in:
Julian Bouzas 2024-02-01 09:59:55 -05:00
parent 32f86e38ad
commit d01441ca0a
7 changed files with 25 additions and 34 deletions

View file

@ -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

View file

@ -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
}

View file

@ -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

View file

@ -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)

View file

@ -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,
}

View file

@ -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

View file

@ -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)