Commit graph

1154 commits

Author SHA1 Message Date
George Kiagiadakis
d1da39b4f6 policy-endpoint-client: remove handling of move & follow and endpoint priorities
These don't make much sense here. In the endpoint policy we want
the clients to be linked to the endpoint that matches their role
and never move.

Also, endpoint priorities are useless. If no endpoint matches the
role, then just ignore the client.
2021-04-15 18:14:25 +03:00
George Kiagiadakis
214fffd84d meson: bump version to 0.3.70 2021-04-15 17:01:02 +03:00
George Kiagiadakis
8861595d55 m-mixer-api: allow calling the action signals even when the plugin is not enabled 2021-04-15 17:00:15 +03:00
George Kiagiadakis
012363ef55 m-default-nodes-api: remove reduntant call to g_clear_object 2021-04-15 16:59:51 +03:00
George Kiagiadakis
400aaf55ed wplua: store closures only with a weak reference
This allows closures to be properly unrefed when they are no longer
used instead of staying alive until wireplumber exits

Because GClosure has no weak references, we are now sharing the
GPtrArray that holds these references among all the active closures
and each closure is responsible for removing itself from the array
when it is finalized. The lua engine holds a reference to a "store"
object that also has a pointer to the array and when this "store"
is finalized, all closures are invalidated and removed. Even if they
stay alive afterwards, they are only holding a ref to an empty array
2021-04-13 21:14:12 +03:00
George Kiagiadakis
c53608874a examples: add example script to get the default sink's volume 2021-04-13 21:07:32 +03:00
George Kiagiadakis
155ad32212 scripts: add policy for links between clients and endpoints
This script takes links that are created by policy-endpoint-client
and activates only the ones that should be active based on role
priorities
2021-04-13 19:37:06 +03:00
George Kiagiadakis
4d5959ffdb lua: add WpObject get_active/supported_features() bindings 2021-04-13 19:34:07 +03:00
George Kiagiadakis
7c617742a9 lua: add g_get_real/monotonic_time() bindings
Useful to tag objects with their creation time
2021-04-13 19:33:06 +03:00
George Kiagiadakis
6d84295fc5 si-audio-endpoint: give better descriptions to endpoints and their null sinks 2021-04-12 16:05:48 +03:00
George Kiagiadakis
7d65dc2a09 static-endpoints: avoid capturing session item reference in the activate closure 2021-04-12 16:04:34 +03:00
George Kiagiadakis
45e0ad1092 policy: export endpoints, do not export endpoint links
As with endpoint streams, there is not much use for endpoint links
in this updated design. This will be re-evaluated.
2021-04-12 12:48:48 +03:00
George Kiagiadakis
e13b2bc8ad wpctl: handle endpoints nicely and enable volume controls on them
Instead of adding Props on endpoints again and syncing with the associated
node, it is easier to just use the volume controls of the associated node
2021-04-12 12:46:40 +03:00
George Kiagiadakis
1ba99739c2 tools: split wireplumber script execution mode to a separate wpexec tool
This is mainly for security reasons. This way, we can limit the
permissions of wpexec without limiting wireplumber, for instance
with pipewire's default module-access, which limits apps based on
their executable name
2021-04-12 09:53:30 +03:00
George Kiagiadakis
e654f7709f tools: move under the 'src' directory 2021-04-12 09:53:30 +03:00
Julian Bouzas
5c6d484d08 src: scripts: rename policy-endpoint.lua to policy-endpoint-client.lua 2021-04-09 14:21:03 -04:00
Julian Bouzas
5c781db216 m-audio-endpoint: remove target property
Links between endpoints and device nodes are done externally in LUA
2021-04-09 14:19:25 -04:00
Julian Bouzas
b93f84897a static-endpoints.lua: don't export endpoints, only activate them 2021-04-09 14:18:05 -04:00
George Kiagiadakis
c7e32a638a m-mixer-api: add configurable support for the cubic volume scale
This is also what pulseaudio uses, so now the volumes in wpctl match what
pulseaudio tools report and they make a lot more sense from the user's POV
2021-04-09 15:52:17 +03:00
George Kiagiadakis
1547bc9c5c wpctl: use mixer & default-nodes API modules
* Fixes set-volume & set-mute
* Re-enables volume & mute status printout for audio nodes
2021-04-09 15:52:17 +03:00
George Kiagiadakis
010cd308da m-mixer-api: also add channel-independent volume for ease of use 2021-04-09 15:52:17 +03:00
George Kiagiadakis
64db5d0d6e wpctl: remove obsolete default node/endpoint key macros 2021-04-09 15:52:17 +03:00
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