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.
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
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.
* Every client has a priority based on its role
* For playback, we allow only a single client to play at a time
* For capture, we allow all clients to capture simultaneously
* Every time the "selected" device changes (either because devices
are discovered/removed or because the user changed the selection),
the clients are re-linked to the new "selected" device.
* When a playback client quits and there are others waiting unlinked,
the highest priority one is linked automatically.
* This also properly fixes re-linking the correct client(s) to the
correct device(s) when wireplumber exits and restarts.
If we have properties, strtok will return strings from there as tokens
and the error will appear later as we will attempt to parse an incomplete
GVariant. It is better to catch this early so that we can print a more
useful error message.
This is a cleaner way to interface with the remote pipewire daemon.
The WpRemote base class can be subclassed also for interfacing
with other daemons (hardware-specific managers, etc)
This is implemented in a slightly hacky way, we register the GMainLoop
as a global object and use it from the module to quit the daemon.
This is bad design because the module assumes it is loaded inside
our daemon.
In the future, this should change. It looks like we should have an
object that tracks the state of PipeWire and main() should track
state changes of that object and decide what to do.
After discussing things at the AGL May 2019 F2F meeting
and reflecting on the initial design of WirePlumber,
it became clear that it needed a fresh start.
glib log domains are not like the gstreamer ones, where you can enable
many of them with a wildcard, therefore it is not particularly useful
to have different ones per file