When the autoconnect property is not available or false, we must
simply configure the stream in its default channel map and leave it
unconnected.
Fixes pw-cat -p --target=0 ..
There is no real use for groups in our API. Just use the name of
the file as the default group and be done with it...
Storing multiple groups with this API is problematic because it
forces flushing the file to disk multiple times, one for each group,
and it's just more performant if we use a prefix in the keys
to implement some form of logical separation.
This commit also makes the GKeyFile a temporary object. As we
always load the file from the file system in _load()
and we always replace its contents with a new dictionary in _save(),
there is no point in keeping the keyfile's internal data structures
stored in memory.
Save errors are now also propagated to adhere to the programming
practices of GObject
- sanitize printing properties with tostring(), which will properly
convert nil values to the string "nil"
- ensure some properties become empty strings if they are nil
We have ended up not using them, so let's not carry them
in the ABI of 0.4
We can always revert that, but let's first decide how
these objects should be used
Sometimes the default device node might not exist when reevaluating endpoints
for the first time on startup, so the policy would link endpoints to another
device node. Then, the default device node appears and the policy moves the
endpoints to the default device node while the previous link has not finish its
activation yet. This race condition can cause endpoint links to fail when being
activated. Delaying the reevaluation of endpoint links until the first client
link is created avoids this issue.
Allows relinking client nodes to other devices if the current device has been
removed. This allows audio to keep playing in a different device if a bluetooth
device is disconnected.
The policy scripts can handle now client nodes that want to be linked with other
client nodes. This is needed for nodes created by the Pulse Audio Volume Control
to monitor audio comming from other application client nodes.
Plugin() is confusing because it's not a constructor, it just finds
an existing instance of a plugin object. All other camel-case
functions are constructors in the current lua API.
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
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
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
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)
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.
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