Commit graph

268 commits

Author SHA1 Message Date
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
George Kiagiadakis
5779375e85 simple-policy: remove all the bluetooth policy stuff
This is complex and it gets in the way of forward-porting
the bluez-alsa integration bits from the 0.1 branch.

simple-policy will be removed anyway and replaced with
the configuration-based logic that is in the works, so
we will not need this code again, even if we switch back
to the native pipewire bluez5 integration
2019-10-07 17:44:35 +03:00
George Kiagiadakis
9e7a5a4c30 softdsp/convert: append the stream name on the new "object.path" key 2019-10-07 16:57:06 +03:00
George Kiagiadakis
7e41d5aa52 monitor: add a flag to activate alsa devices
In current pw master the behavior has been changed to not activate
the "On" profile on alsa devices by default, because of the DeviceReserve
D-Bus API implementation in media-session.

This is a hack here to get the previous behavior. In the future
we should have a way to configure profiles, as well as to pick
a sensible default by autodetection.
2019-10-07 16:47:54 +03:00
George Kiagiadakis
bbca2ca236 monitor: update to reflect API changes in pipewire master 2019-10-07 16:30:04 +03:00
George Kiagiadakis
2e0e144f70 softdsp-endpoint/stream: remove the port proxies when they are removed on the server
When the audioconvert starts, it emits 2 ports, but when we set the PortConfig,
it removes them and re-creates them. Previously, the stream class would not
remove the old port proxies from the list and therefore they existed twice.

It is also necessary here to store the proxies earlier, when they are added,
instead of when they are augmented, so that we can ensure they are removed.
Previously we would hit an issue where:
 - port proxy is added, augmented
 - augment completes but the GTask wants to complete asynchronously:
   it stores a ref on the proxy and adds an idle source
 - server removes the proxy, we delete it from the core's list
 - the GTask now calls the augment callback, which stores the (removed)
   proxy on the stream's port_proxies list...
2019-10-02 21:33:34 +03:00
George Kiagiadakis
f360aed978 sofdsp-endpoint: run audioconvert in merge+split mode and use a new linking algorithm
Running audioconvert in merge+split mode is the only way to make this work with
the adapter, since the adapter does not support passing multiple channels on
a single port right now, and if it does at some point, it will be without a
mixing node on the port, which means we will not be able to mix multiple
audioconvert nodes on the same adapter. In the future we need to consider
writing a lighter volume node with multiple channels support to replace
audioconvert.

The new linking algorithm now takes into account the channel positions and makes
sure to link the correct channels together. Also, it avoids passing the port
proxies inside the GVariants, thus making the algorithm a bit more generic
and easier to unit test.
2019-10-02 21:27:44 +03:00
George Kiagiadakis
9ab1780594 core & proxy: add some more assertions and debug messages for troubleshooting 2019-10-02 21:20:19 +03:00
George Kiagiadakis
48fbabcc3f daemon: do not access the inexistent error-message property from core
This is a remainder from the old WpRemote, which is gone.
I would re-add the property, but it's not worth it, since libpipewire
prints it as well by default
2019-10-02 21:18:44 +03:00
Julian Bouzas
897d94c7dd bluez: create softdsp endpoints for bluetooth nodes 2019-09-25 12:33:47 +02:00
Julian Bouzas
b9ad90f68c softdsp-endpoint: use the same number of channels in the converters as the sink/source node 2019-09-25 12:05:56 +02:00
Julian Bouzas
26fb89cb16 modules: move softdsp-endpoint inside module-pipewire 2019-09-25 10:25:49 +02:00
Julian Bouzas
5737b61c30 modules: remove simple-endpoint 2019-09-25 10:25:37 +02:00
George Kiagiadakis
50e52b9e84 modules: fix reading proxy-node out GVariants
GVariant is instructed to store a 64-bit unsigned integer (mode "t")
but we pass it a pointer to a pointer to read this value out,
which will crash in 32-bit architectures, as the pointer doesn't have
enough bits and g_variant_lookup therefore corrupts the stack.
2019-09-22 18:14:43 +03:00
George Kiagiadakis
9246eba803 monitor: fix usage of wp_properties_setf without a format string 2019-09-22 17:35:47 +03:00
George Kiagiadakis
94b1390d0e proxy: destroy the pw_proxy in dispose()
Because the proxy_event_destroy() handler now takes a ref to the
WpProxy, which is an error to do in finalize()
2019-09-17 19:53:20 +03:00
George Kiagiadakis
375fa8a3dd modules: replace the monitor code from module-pw-{alsa,bluez} with module-monitor 2019-09-17 16:35:14 +03:00
George Kiagiadakis
e3ac60c0c0 modules: implement a new module-monitor
This is a generic WpMonitor loader that sets up the WpMonitor
properties from the module arguments and applies some well-known
properties to the device & node objects
2019-09-17 16:35:14 +03:00
George Kiagiadakis
302e991b28 monitor: add a new WpMonitor class
This class wraps a SPA monitor and creates all
the devices and nodes as they are being discovered
2019-09-17 16:35:14 +03:00
George Kiagiadakis
10b117144a lib: expose and install wpenums.h 2019-09-17 16:35:14 +03:00
George Kiagiadakis
0c6ef834b2 lib: properties: add wp_properties_copy_keys
A method to copy specific keys from one properties set to another
2019-09-17 16:35:14 +03:00
George Kiagiadakis
cc3f01b248 daemon config: add config command to load pipewire modules 2019-09-17 16:35:14 +03:00
George Kiagiadakis
d5acbdd87c daemon config: add the ability to register spa libraries from the config file 2019-09-17 16:35:14 +03:00
George Kiagiadakis
340b52fbee proxy: fix crash that happens when a client exits very quickly after starting
This is very easy to reproduce when the pipewire-alsa integration
is installed and you do 'arecord -l'; the alsa plugin connects and
disconnects again before the proxy is ready.

In this case we have to skip remote-global-added and we also have
to be careful with the references: the global-removed callback is
called earlier, so the core's reference to the proxy is gone and
the GTask is the only thing holding a reference to the proxy.
When we unref the GTask, the proxy is also unrefed, so we have
to keep an additional reference in order to avoid crashing
when accessing the hash table below.
2019-09-17 16:19:13 +03:00
Julian Bouzas
ac53b1165b test: move wireplumber tests into a 'wp' subfolder 2019-09-09 08:52:36 -04:00
George Kiagiadakis
371e4cf9f3 core: allow passing properties to the pw_core and pw_remote constructors 2019-09-07 18:21:17 +03:00
George Kiagiadakis
a63f2bb99b lib/wp: merge both WpRemote & WpRemotePipewire in WpCore
In practice we always create a remote and connect to pipewire.
Any other scenario is invalid, therefore, it is not justified
to be confused with so many classes for such small functionality.
This simplifies a lot the modules code.

Also, this commit exposes the pw_core and pw_remote objects
out of WpCore. This is in practice useful when dealing with low-level
pw and spa factories, which are used in the monitors. Let's not
add API wrappers for everything... Bindings will never use this
functionality anyway, since it depends on low level pipewire C API.
2019-09-07 17:55:46 +03:00
George Kiagiadakis
84b752e304 simple-endpoint: use WpProperties instead of parsing the spa_dict from the info structure 2019-09-07 11:30:08 +03:00
George Kiagiadakis
bf9cecd129 Merge branch 'master' into proxy-refactoring 2019-09-07 11:22:50 +03:00
George Kiagiadakis
95665a3496 mixer: search for "Alsa/Sink" instead of "Audio/Sink" now
Since the alsa endpoints class was renamed...
2019-09-05 15:26:29 +03:00
Julian Bouzas
fd8414aad1 bluez: handle all bluetooth profiles 2019-09-02 09:56:42 -04:00
George Kiagiadakis
72e13919a4 bluez: warn if the SPA bluez plugin is not installed instead of asserting 2019-08-29 21:23:20 +03:00
George Kiagiadakis
3d46253dd6 proxy: hide the bind() API and fix attaching the listener in wrap mode
In case the proxy was created with wp_proxy_new_wrap(), the event
listener was not attached on the pw_proxy
2019-08-29 21:21:51 +03:00
George Kiagiadakis
ac7086d156 modules: port to new WpProxy API 2019-08-29 21:21:33 +03:00
George Kiagiadakis
ff59fc06db lib: properties: add update() and copy_from_dict() API 2019-08-29 19:41:04 +03:00
Julian Bouzas
770fe8c703 simple-policy: handle bluez endpoints 2019-08-28 14:19:22 -04:00
Julian Bouzas
ad8491df44 modules: destroy all alsa/bluez nodes when an alsa/bluez device is removed 2019-08-28 14:19:22 -04:00
Julian Bouzas
c473cecbed bluez: cleaned module and set media class to Bluez/<direction>/<profile> 2019-08-28 14:19:16 -04:00
Julian Bouzas
23cc1edc28 alsa-udev: cleaned module and set media class to Alsa/<direction> 2019-08-28 11:10:11 -04:00
George Kiagiadakis
7608ae37b5 lib: implement WpProxyClient 2019-08-27 18:28:58 +03:00
George Kiagiadakis
789194b5c3 Merge remote-tracking branch 'origin/master' into proxy-refactoring 2019-08-27 18:10:41 +03:00
George Kiagiadakis
a5e867172d tests: proxy: add unit test for WpProxyNode and enum_params in particular 2019-08-27 17:40:28 +03:00