Replace unwanted chars in the name with _. This makes it compatible
with pulseaudio names and avoids problems with regex.
Replace unwanred chars in the nick with ' '. This ensures JACK
clients don't receive ':' in the device names, which cause it to
fail when parsing the ports.
See #714 and #130
Make methods to load_config and load/save state. For now the config
and state directories are the same but it might not be. Implement
the search path for all config/state files as:
$XDG_CONFIG_HOME/[$prefix]/$name
$HOME/.config/[$prefix]/$name
$PIPEWIRE_CONFIG_DIR/pipewire/[$prefix]/$name
/etc/pipewire/[$prefix]/$name
Make some config files for jack and RT clients. Make pw-cat use the
client-rt config.
Use core state and config management in media-session.
Move all session manager state and config files to the build dir and
set the PIPEWIRE_CONFIG_DIR to this build dir.
Move the daemon config file loading to a new conf.c file used by
the context to load the configuration. This replaces the module
profiles and some hacks to move properties around.
If there is nothing other specified with $PIPEWIRE_CONFIG_NAME or
a property, the client.conf file is loaded as a fallback.
Update the session manager config file to load the modules via the
config now. Rename the session modules section to another name.
Update pipewire-pulse to also load a specific pulse property file.
This then makes it pssible to assign specific RT priorities for the
pipewire-pulse process.
Set initial device profile according to what's connected at startup,
rather than having media-session try to set it to A2DP (and fail, if the
profile was not connected, resulting to startup in null profile).
This avoids making a codec switch at device startup (we'll stay with
what BlueZ autoconnected us to, usually the previously used codec).
Use separate metadata keys for the current effective default nodes
(default.*), and user-configured ones (default.configured.*).
default-nodes saves and restores the configured ones, and policy-node
keeps the effective ones up to date.
For pipewire users, the effective default values should be considered
read-only, as changing them will not have an effect. To avoid
confusion, policy-nodes will reset their values back immediately if they
are changed.
If a flatpak app has the Manager media.category set, assign more
permissions to it for now. We should later check with the
permission store if this is really allowed.
Makes bluez devices as automatic default devices, with priority slightly
larger than alsa devices. The priority.driver is also used by
pulse-server on determining automatic default devices, when no default
has been manually set.
Disable automatic port configuration in acp and move the logic
to the session manager.
Implement initial port selection and restore on profile activation.
Implement route switch when unavailable
Implement port settings save.
Keep track of active profile in default-routes so that we can restore
the prefered routes later.
Keep track of all active routes in an array. There can be more than
one active route per direction.
New routes will get their volume restored. Route changes will be saved.
Follow the active input/output routes. If the route changes, restore
the previously saved settings. If only the properties change, save
them to be restored later.
Fixes#402
The motivation is to have both existing and new streams that have been
created without explicit target node, to be directed to the same devices
at all times. To achieve this:
Consider what find_node returns as the "default node".
Consider streams that auto+reconnect and don't have an explicit target,
as following default. In rescan, if the default node has changed,
relink such streams to the new default.
Remove the old code that explicitly moved streams when the default.*
metadata changed, as it implements a similar thing but in a less robust
way (may fail to do what's intended, because the default device
metadata is commonly unset, or the metadata callback comes before
session_create has seen the new nodes).
Enable this feature based on "policy-node.streams-follow-default"
property. Allow setting the property also by loading the
streams-follow-default module. Enable it by default only for the
with-pulseaudio module group.