Commit graph

1132 commits

Author SHA1 Message Date
George Kiagiadakis
0aefd52593 m-mixer-api: fix getting volume info from nodes that don't have volumeBase & step
and optimize a little bit so that can stop iterating params
as soon as the info is known
2021-04-09 15:52:17 +03:00
George Kiagiadakis
21dccd5edb lua: add a Debug.dump_table() utility function
Prints a table recursively with print()
2021-04-09 15:52:17 +03:00
George Kiagiadakis
4399512891 m-default-nodes-api: load all information before declaring the plugin as "enabled" 2021-04-09 15:52:17 +03:00
George Kiagiadakis
28ff1061f5 lua: add a Core.require_api() utility function
This function loads and enables "api" plugins and makes them
available in the specified callback. This is intended to be used
by interactive scripts in order to get access to "api" plugins
such as the new "default-nodes-api" and "mixer-api"
2021-04-09 15:52:17 +03:00
George Kiagiadakis
523bc7a36d modules: add module-mixer-api
This module provides an API to get/set volume controls on nodes,
using the same logic as pipewire-pulse, which means it will use
the device Route props when a node is associated with a device
that has this capability
2021-04-09 15:52:17 +03:00
Julian Bouzas
380ba4aa39 src: config: do not create endpoints by default 2021-04-08 14:46:13 -04:00
Julian Bouzas
12b1226b37 src: scripts: add policy-endpoint.lua script
Links items with media role set to existing endpoints. The target of the
endpoints is also configured.
2021-04-08 14:45:54 -04:00
Julian Bouzas
7482a05ca2 policy-node.lua: do not handle items with media role if endpoints exist 2021-04-08 14:41:06 -04:00
Julian Bouzas
941da10c28 policy-node.lua: clean up findTarget function 2021-04-08 14:38:31 -04:00
Julian Bouzas
9f77b98b10 src: scripts: add static-endpoints.lua script 2021-04-08 14:07:05 -04:00
Julian Bouzas
b2c9084413 modules: remove unneeded si-audio-convert module 2021-04-08 14:07:05 -04:00
Julian Bouzas
34f5dadad0 src: config: rename session-item support to default-policy 2021-04-08 14:07:05 -04:00
Julian Bouzas
cc51bdb75e create-item.lua: only create items for client and device nodes 2021-04-08 14:07:05 -04:00
Julian Bouzas
f0960a38b2 policy-item.lua: only handle si-audio-adapter and si-nodes links 2021-04-08 14:07:05 -04:00
Julian Bouzas
c5d28031e5 src: scripts: remove unneeded policy-endpoint.lua 2021-04-08 14:07:05 -04:00
Julian Bouzas
317550a7bd m-lua-scripting: add object manager get_n_objects API 2021-04-08 14:07:05 -04:00
Julian Bouzas
cce02fec68 si-audio-endpoint: deactivate node when disabling active feature 2021-04-08 14:07:05 -04:00
Julian Bouzas
d38092a35c m-si-audio-endpoint: fix port configuration and target linking 2021-04-08 14:07:05 -04:00
Julian Bouzas
471f84c735 m-si-audio-endpoint: make target property optional
Allows using the endpoint even if a target is not set.
2021-04-08 14:07:01 -04:00
Julian Bouzas
bce0b79980 tests: si-standard-link: sync core before finishing
Makes sure core has finished any pending task before finishing the test.
2021-04-08 11:04:21 -04:00
Julian Bouzas
2caac5fa87 si-standard-link: call parent class finalize once finalized 2021-04-07 13:21:40 -04:00
Julian Bouzas
552b04ed7d m-si-standard-link: properly set in item port context when configuring 2021-04-06 14:04:34 -04:00
Julian Bouzas
debef67f3f policy-node.lua: fix param name typo when finding target
Fixes unespected issues when finding first available target
2021-04-06 09:48:01 -04:00
George Kiagiadakis
a1923d8152 policy-node: properly remove links between apps and capture devices
the previous logic was flawed and would only work for links between
app node <-> device sink node
2021-04-06 16:07:14 +03:00
George Kiagiadakis
3485befc81 endpoint: remove useless pw_proxy_destroyed handlers 2021-04-05 16:03:55 +03:00
George Kiagiadakis
d264bc460c registry: fix issues with dangling WpGlobal objects causing assertion failures
The main problem observed is when a link that is owned by a WpLink
is removed from the server because one of the linked nodes is gone.
This would cause the APPEARS_ON_REGISTRY flag to go away but the
WpGlobal would still remain in the globals list...

To fix this, forcibly remove the global from the globals list when
it is removed from the registry, even if it is still owned by some
proxy. The proxy at that point is unable to function anyway, because
we make sure to destroy the pw_proxy by removing FEATURE_BOUND when
the global is removed from the registry.

Additionally, ref global->proxy before removing FEATURE_BOUND to
prevent crashing. If the proxy owns the global and the pw-proxy-destroyed
signal causes whoever owns the proxy to drop his reference, _deactivate()
will crash because no-one will be holding a ref to the proxy.
2021-04-05 16:03:55 +03:00
Julian Bouzas
fb1daa0bf2 modules: use dots instead of dashes for session item properties
Keeps consistency with PipeWire
2021-04-02 11:22:22 -04:00
George Kiagiadakis
cdd6fda56c wpctl: status: print nodes, ports, links grouped more nicely 2021-04-01 19:15:34 +03:00
George Kiagiadakis
5f1f96a5da registry: fix odd assertion failures that occured from time to time
The assumption about the global id in wp_registry_prepare_new_global()
was not valid because this function may also be called from the proxy
bound event and this may be before the registry has signalled the
removal of an old global with the same id, for instance

We should instead check this at the point where we expose the global.
If the assertion doesn't hold at that point, we are going to leak an
old WpGlobal, so we must ensure it.
2021-04-01 12:48:57 +03:00
Julian Bouzas
e86ed8e763 policy-node.lua: support config.move and config.follow 2021-03-31 12:44:49 -04:00
Julian Bouzas
12b59a1506 m-si-audio-adapter: abort activation if node feature ports is no longer enabled 2021-03-31 12:44:49 -04:00
Julian Bouzas
75d53dbef3 m-si-standard-link: make sure in/out items are valid before activating 2021-03-31 10:51:20 -04:00
George Kiagiadakis
e7406ad1d7 wpctl: fix setting default nodes 2021-03-31 17:05:55 +03:00
George Kiagiadakis
9a103c5787 m-default-nodes: restore configured values on the metadata at startup 2021-03-31 15:20:06 +03:00
George Kiagiadakis
0ecefcb55d policy-node: use default-nodes-api plugin 2021-03-31 13:10:13 +03:00
George Kiagiadakis
0bc257b6c3 modules: add new module-default-nodes-api
This is to provide easy access to default nodes from the scripts
2021-03-31 13:10:13 +03:00
George Kiagiadakis
8cf8eb6b76 m-default-nodes: move common code to a new header 2021-03-31 13:10:13 +03:00
George Kiagiadakis
0a53ddd4ad m-default-nodes: add properties to control storage method and interval
Do not use WpState at all when use-persistent-storage=FALSE; keep all
the configured default nodes in memory and forget them upon restart
2021-03-31 13:10:13 +03:00
George Kiagiadakis
a0876bb275 modules: rename default-metadata to default-nodes and enable it always in the config 2021-03-31 13:10:13 +03:00
George Kiagiadakis
c524e1e317 m-default-metadata: remove default endpoints, follow upstream logic
* default endpoints no longer make sense
* follow upstream logic of configured vs effective default nodes
* store node names in json inside the metadata, as upstream does
* add default video source
2021-03-31 13:10:13 +03:00
Julian Bouzas
cb3445c077 policy-node.lua: fix type mismatch when comparing session item Ids 2021-03-30 14:52:42 -04:00
George Kiagiadakis
fd2ddffdd7 lua: s/Feature.Object.ALL/Features.ALL/
It looks nicer to have groups of features in 'Features.'
instead of 'Feature.'
2021-03-29 18:35:35 +03:00
George Kiagiadakis
8052ef2792 bluez config: update based on the latest media-session config 2021-03-29 18:32:59 +03:00
Julian Bouzas
ab5a58715c m-default-metadata: add support for default audio nodes 2021-03-26 16:16:02 -04:00
Julian Bouzas
f86a5efcd5 wpctl: list nodes and allow setting default nodes 2021-03-26 16:16:02 -04:00
Julian Bouzas
b7e347d92c modules: remove endpoint impl on si-node, si-audio-convert and si-audio-adapter 2021-03-26 16:16:02 -04:00
Julian Bouzas
59cb837075 tests: si-standard-link: use new si-audio-endpoint 2021-03-26 16:16:02 -04:00
Julian Bouzas
325522ae51 modules: add si-audio-endpoint session item 2021-03-26 16:16:02 -04:00
Julian Bouzas
e3cc3c330d src: scripts: add policy-node.lua to link port info session items 2021-03-26 16:16:02 -04:00
Julian Bouzas
32fea4057c src: config: rename endpoint-support to session-item-support 2021-03-26 16:16:02 -04:00