Commit graph

309 commits

Author SHA1 Message Date
George Kiagiadakis
9fa9f1fe44 tools: initial implementation of a wireplumber-cli tool
Currently all it does is that it prints the properties
of all device nodes (Audio/Source & Audio/Sink), which
is useful for editing the configuration files
2019-12-05 13:29:28 +02:00
George Kiagiadakis
7a214e8fab wp_properties_match: use wildcard pattern matching instad of strict string comparison 2019-12-05 12:41:45 +02:00
George Kiagiadakis
a11cd3b651 parser-endpoint-link: make 'properties' subtables of 'match-endpoint' and 'target-endpoint' 2019-12-05 12:21:24 +02:00
George Kiagiadakis
92107e8342 object-manager: keep a reference to self while doing a core sync
Otherwise, if the object manager is destroyed while a sync is in progress,
we get an invalid 'self' pointer on the callback later, which is being
called regardless

There is a bit more work that should be done in the core to avoid leaking
this ref in case pipewire disconnects before the sync is completed
2019-12-05 12:05:34 +02:00
Julian Bouzas
d5c3f7ee87 tests: add config-policy unit test 2019-12-04 16:38:35 -05:00
Julian Bouzas
664db8a200 modules: add config policy module 2019-12-04 16:38:35 -05:00
Julian Bouzas
c8417f8826 endpoint: add get_role API 2019-12-04 16:38:35 -05:00
Julian Bouzas
d6ed17472a modules: always use the node name when creating endpoints 2019-12-04 16:38:35 -05:00
Julian Bouzas
cd3a414e2f softdsp-endpoint: remove persistent hack 2019-12-04 16:38:35 -05:00
Julian Bouzas
7bd9f84e6f endpoint: add keep property 2019-12-04 16:38:35 -05:00
Julian Bouzas
d49ffbef1d endpoint: add get_properties API 2019-12-04 16:38:35 -05:00
Julian Bouzas
b2c4162c2f policy: remove unneeded handle_endpoint callback 2019-12-04 16:38:35 -05:00
Julian Bouzas
ea3b58c2cd properties: add wp_properties_matches API 2019-12-04 16:38:35 -05:00
Julian Bouzas
58f321f815 object-manager: sync object-changed with pipewire's core 2019-12-04 16:38:35 -05:00
Julian Bouzas
61227c9da2 core: add sync API 2019-12-04 16:38:35 -05:00
Julian Bouzas
3cb74e0611 modules: remove simple policy
This will be replaced by a new policy based on configuration files
2019-12-04 16:38:35 -05:00
Julian Bouzas
2578ec4286 src: set the default configuration path when wireplumber starts 2019-12-04 16:38:35 -05:00
Julian Bouzas
77ec4c548c lib: introduce WpConfiguration
The purpose of this change is to have a generic API that allows modules to read
configuration data from files under a specific directory. Since we can have many
types of configuration files, this new class maps file extensions with generic
parsers defined in the modules, giving modules full freedom to parse any kind of
data.
2019-12-04 16:38:35 -05:00
Julian Bouzas
9a9d773b06 wptoml: add new library to parse TOML files 2019-12-04 16:38:35 -05:00
George Kiagiadakis
6e4752a736 tests: add unit test for WpSession (proxy + exported) 2019-12-04 18:50:43 +02:00
George Kiagiadakis
a4d8e85a96 proxy: construct WpProxySession for session proxies 2019-12-04 18:49:47 +02:00
George Kiagiadakis
82fe7831b1 lib: implement WpSession (proxy + exported for pw_session) 2019-12-04 18:49:47 +02:00
George Kiagiadakis
ce3883c1a2 lib: add WpSpaProps, a helper to deal with SPA_PARAM_Props & SPA_PARAM_PropInfo 2019-12-04 18:49:14 +02:00
George Kiagiadakis
44e498ca01 lib: add WpExported, a base class for all exported objects 2019-12-03 18:05:34 +02:00
George Kiagiadakis
d4b7e98748 proxy: add type associations for the new session-manager extension types 2019-12-03 18:05:34 +02:00
Julian Bouzas
7f8fb72849 object-manager: sync on the core 2019-11-27 13:44:32 -05:00
Julian Bouzas
936a9f4d8b core: add wp_core_idle_add API 2019-11-27 13:16:43 -05:00
George Kiagiadakis
59ab08ff0c ci: use the same os image as pipewire and build pw with minimal features
Stick to an OS that we know it works for the pipewire CI and
avoid building too much as we don't need them (and might trigger
failures that are not of any relevance for wireplumber)
2019-11-18 12:28:49 +02:00
George Kiagiadakis
6f358e9a3a adapter: select a reasonable device format instead of letting pipewire choose its own 2019-11-18 11:02:03 +02:00
George Kiagiadakis
23b66a8f43 proxy: debug in dispose() so that we can print the pw_proxy pointer
in finalize() the pw_proxy is already gone and we always print null
2019-11-16 17:24:18 +02:00
George Kiagiadakis
4ad4974f27 endpoint-link: ensure we call finalize of the parent class
This was causing a memory corruption and crash because the
simple-endpoint-link was not calling finalize of the endpoint-link
and the GWeakRefs pointing to the endpoints were not uninitialized,
causing g_object_unref later to try to write to them (on free'ed memory)
2019-11-16 11:40:02 +02:00
George Kiagiadakis
73978f76aa object-manager: actually add the object-manager.* files in git 2019-11-13 16:07:36 +02:00
George Kiagiadakis
e7e5c66853 lib: introduce WpObjectManager
* rework how global objects are stored in the core
* rework how users get notified about global objects
  and proxies of remote global objects

The purpose of this change is to have a class that can manage
objects that are registered in the core or signalled through the
registry. This object can declare interest on certain types
of global objects and only keep & signal those objects that it is
interested in. Additionally, it can prepare proxy features and
asynchronously deliver an 'objects-changed' signal, which is
basically telling us that the list of objects has changed.

This is useful to simplify port proxies management in WpAudioStream.
Now the stream object can declare that it is interested in ports
that have "node.id" == X and the object manager will only maintain
a list of those. Additionally, it will emit the 'objects-changed'
signal when the list of ports is complete, so there is no reason to
do complex operations and core syncs in the WpAudioStream class
in order to figure out when the list of ports is ready.

As a side effect, this also reduces resource management. Now we
don't construct a WpProxy for every global that pipewire reports;
we only construct proxies when there is interest in them!

Another interesting side effect is that we can now register an
object manager at any point in time and get immediately notified
about remote globals that already exist. i.e. when you register
an object manager that is interested in nodes, it will be immediately
notified about all the existing nodes in the graph. This is useful
to avoid race conditions between connecting the signal and objects
beting created in pipewire
2019-11-13 15:49:39 +02:00
George Kiagiadakis
a93cbdf8f0 fixup: include private.h in monitor.c 2019-11-11 17:45:39 +02:00
George Kiagiadakis
f252f4be5b proxy: allow multiple augment tasks to run in parallel
This lifts the limitation of having a single entity externally
that augments the proxy and allows us to implement better
management of the proxies with the upcoming WpObjectManager
2019-11-11 17:41:06 +02:00
George Kiagiadakis
d39307ee70 lib/wp: move internal functions and declarations to a private.h header 2019-11-07 20:44:55 +02:00
Julian Bouzas
857217bc3f modules: remove the mixer
This is no longer used and it is the wrong approach anyway.
A mixer GUI needs to list all endpoints and figure out the controls
from the streams on its own, using the new endpoints API.
2019-11-06 16:41:54 +02:00
Bastien Nocera
e53eed4dc2 ci: Add CI 2019-11-06 16:18:30 +02:00
Bastien Nocera
e8fadbcbda build: Fix build after recent PipeWire header changes
PipeWire headers were recently cleaned up to reduce the number of
included headers. This leads to a number of functions and types not
being included when needed in wireplumber.
2019-11-06 16:18:30 +02:00
Julian Bouzas
b94cc897ac stream: get the node id from the info struct when preparing link 2019-11-06 12:18:17 +02:00
Julian Bouzas
b2e1e76460 simple-policy: select the newest client endpoint when the role priority is equal 2019-11-06 12:15:11 +02:00
Julian Bouzas
44bb78fcb7 endpoint: add creation-time property 2019-11-06 12:15:11 +02:00
George Kiagiadakis
06e100a38e README.md: add instructions on building and running 2019-11-03 15:26:05 +01:00
George Kiagiadakis
75d2aef0c1 policy: do not assert if the endpoint link errors out 2019-10-15 00:31:40 +03:00
George Kiagiadakis
5a57bf5f93 policy: correctly figure out if a stream is a capture stream 2019-10-15 00:31:09 +03:00
George Kiagiadakis
5de6364ae7 monitor & softdsp: fix alsa property names and api string
The alsa.pcm devices currently use "device.api" = "alsa:pcm"
but then the node overrides this later to just "alsa", which
is confusing. For now, let's match "alsa:pcm" in the monitor,
even though this does not appear on the node later.

This commit fixes device preferences in wireplumber.conf,
which were broken because the alsa endpoint names were empty
of info about the alsa device
2019-10-15 00:12:17 +03:00
George Kiagiadakis
5a70ed31a8 tests: proxy: fix failure due to property key change in pipewire 2019-10-10 12:30:45 +03:00
George Kiagiadakis
69f1cac79c meson: bump version to 0.1.90
next version is going to be 0.2 from this branch
2019-10-07 18:36:25 +03:00
George Kiagiadakis
d707ec3f20 policy: add a hack that allows some clients to be linked always
This allows the bluealsa gstreamer helper to link to the speakers
constantly, with both A2DP and HFP streams. If this is not enabled,
only one of those will manage to connect, randomly.

This is definitely something to be superseeded by proper policy
management implemented with configuration files
2019-10-07 17:55:46 +03:00
George Kiagiadakis
07835488a0 modules: remove module-pw-bluez
This is not used by AGL anymore and it will go away *anyway*
when we switch to the configuration-based logic for
creating endpoints
2019-10-07 17:44:35 +03:00