Commit graph

235 commits

Author SHA1 Message Date
George Kiagiadakis
28a4229681 config: unify config and config-split
After all, we can just load multiple lua config files/directories
from a single .conf file and so have both styles available for the
user to choose at runtime
2021-04-27 19:50:38 +03:00
George Kiagiadakis
14f4337cdb systemd: add templated systemd unit files
These allow running multiple instances of wireplumber with
different config files. The config file is denoted on the service
name, ex: wireplumber@bluetooth loads bluetooth.conf
2021-04-27 19:06:08 +03:00
George Kiagiadakis
4f79bccbe8 policy-endpoint: implement volume ducking 2021-04-26 18:31:19 +03:00
George Kiagiadakis
42e75028d2 access: add a more generic "default" access policy script
Configurable. Replaces the "flatpak" access policy.
2021-04-26 16:56:17 +03:00
George Kiagiadakis
c7ff629f99 config: add an example of split-instance configuration
This configuration allows splitting wireplumber into multiple instances.
The "main" instance takes care of loading and managing devices
The "policy" instance does all the linking and implements endpoints
The "bluetooth" instance runs the bluetooth devices & nodes

Test with (in separate terminals):
./wp-uninstalled.sh -c config-split -- wireplumber -c main.conf
./wp-uninstalled.sh -c config-split -- wireplumber -c policy.conf
./wp-uninstalled.sh -c config-split -- wireplumber -c bluetooth.conf
2021-04-26 10:02:27 +03:00
George Kiagiadakis
c2834ea344 lua: remove the ability to specify spa_libs in the lua config
This is not useful, we can do this on the pipewire-style config files
2021-04-22 17:44:17 +03:00
George Kiagiadakis
af9b9a84f0 daemon: init export core in the daemon and share it with modules
Also, use a context property to control whether to enable this core
or not and enable it only in the daemon
2021-04-22 15:07:47 +03:00
George Kiagiadakis
b46587393c lua: change the "wireplumber.interactive" property to "wireplumber.daemon"
with inverted semantics
2021-04-22 13:48:06 +03:00
George Kiagiadakis
9c8e5b3081 daemon: Use a pipewire-style config file to load initial configuration
This allows configuring:
* the scripting engine, in case we ever add another one
* the app name, so that we can distinguish multiple instances
  of wireplumber
* the log level in the same way as pipewire
* wireplumber components to load. This allows loading components
  even without a scripting engine (for a mimimal daemon) and also
  allows configuring which lua config file(s) to load
* additional pw_context properties that pipewire modules may be using
* the exact pipewire modules to load (instead of relying on client.conf)
2021-04-22 13:28:58 +03:00
George Kiagiadakis
fdac497f0b config: policy: improve the endpoints & roles example config 2021-04-15 18:18:13 +03:00
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
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
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
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
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
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
Julian Bouzas
e86ed8e763 policy-node.lua: support config.move and config.follow 2021-03-31 12:44:49 -04:00
George Kiagiadakis
0ecefcb55d policy-node: use default-nodes-api plugin 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
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
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
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
Julian Bouzas
04992f0d07 modules: remove si-monitor module
It is not needed as si-standard-link can be configured with port contexts
2021-03-26 16:16:02 -04:00
Julian Bouzas
f6ed14f997 src: scripts: add create-item.lua and remove create-endpoint.lua 2021-03-26 16:16:02 -04:00
George Kiagiadakis
95bb22efe2 monitor-alsa: add api.alsa.card.* properties on nodes
Useful for rule matching on nodes where the rules are also matching
properties of the card.
2021-03-26 17:29:25 +02:00
George Kiagiadakis
dd887a7b3e bluez5: autoconnect bluetooth stream nodes 2021-03-25 18:13:47 +02:00
George Kiagiadakis
5c84f58b9e bluez5: use api.bluez5.connection-info
This creates devices earlier, allowing the use of per-device
codec configuration via the standard rules

See pipewire/pipewire!509
2021-03-25 18:12:41 +02:00
Julian Bouzas
d71cace24f m-si-convert: rename to si-audio-convert
Because it is only meant to be used with audio nodes
2021-03-18 15:00:22 -04:00
Julian Bouzas
340213272e m-si-adapter: rename to si-audio-adapter
Because it is only meant to be used with audio nodes
2021-03-18 14:47:22 -04:00