Make a module that creates a route-settings metadata and provides
some helper functions to parse the json fields.
Load the route-settings module in the policy.
Move the Notification settings to the metadata. Listen for metadata
updates and update our state table.
Fixes#51
Similar to the volume and latencyOffset we need parse, save and restore
the configured iec958Codecs on the node.
Pavucontrol will use the device-restore extension to set the configured
iec958Codecs on the Node/Route. This will make the node enumerate
audio/iec958 formats, which can be matched against streams that can
provide this format to configure passthrough.
Fixes#64
If 'disable.dsp' is set to TRUE, the adapter will always be configured in
passthrough mode. Then, if 2 adapters want to be linked with different formats,
the si-standard-link session item will automatically reconfigure one of the
adapters in convert mode so that the format matches.
This copies the logic of media-session's logind module and allows
the bluez monitor to be active in only one user session at a time.
This is especially useful to avoid interference between the gdm
session and the actual user session, which momentarily both have
wireplumber running when logging in/out.
Fixes#54
This destroys the ALSA monitor when the DBus connection is closed, and
re-creates again the monitor when the Dbus connection is connected, so that
device reservation is restarted.
If PipeWire is built without V4L support, then
`monitor = SpaDevice("api.v4l2.enum.udev", config.properties or {})`
will result in a nil monitor. This commit adds a basic sanity check
to avoid further using the nil variable.
Thanks-to: Pascal Flöschel (initial bug report)
Thanks-to: George Kiagiadakis <george.kiagiadakis@collabora.com>
Bug: https://bugs.gentoo.org/813043
If PipeWire is built without Bluetooth support, then
`monitor = SpaDevice("api.bluez5.enum.dbus", monitor_props)`
will result in a nil monitor. This commit adds a basic sanity check
to avoid further using the nil variable.
Thanks-to: Pascal Flöschel (initial bug report)
Thanks-to: George Kiagiadakis <george.kiagiadakis@collabora.com>
Bug: https://bugs.gentoo.org/813043
Removing a link before it finished activating can lead to race conditions. If
the link is not active, we should schedule a pending rescan to make sure the
old link is only removed when active. This should fix the proxy activation
failed warnings.
* Make the flags public and give them nicer names
* Pass down the flags from the caller, so the caller can now explicitly
ask for looking into specific directories
* Rename the methods
* Remove and inline the wp_get_xdg_config_dir() method, since it's only
used internally
* Refactor the lookup dirs ordering to get both WIREPLUMBER_*_DIR env
variables to replace all the other directories. Previously, we were looking
for scripts in WIREPLUMBER_DATA_DIR, but we were also looking in /etc at
the same time (with precedence, even), which could result in unexpected
behaviour. Now, if a WIREPLUMBER environment variable is specified,
we only look in there.
The previous approach to loading config files was to ask WP for the
directory and then search those for the config files. This patch changes the
approach - a caller now asks WP to search for a specific config file or
iterate over a config file directory.
This allows us to implement a directory lookup order, i.e.
"wireplumber.conf" may be in XDG_CONFIG_DIR, /etc/,
/usr/share and the first one found is used.
For configuration directories, the new method iterates over all matching
entries (files + directories) and invokes a callback for each entry.
This enables distributions to ship default files in /usr/share/wireplumber
but have admins and users override them on a local basis. For lua scripts in
particular, overriding a distribution-provided file with an empty file
effectively disables it, adding a file adds it in the right sort order.
Previously we had the config file split in pipewire-fashion: CONFIG_NAME for
the filename and CONFIG_PREFIX for the (absolute) config directory the file
resides in. Since we always resolved CONFIG_PREFIX to be an absolute path we
might as well just pass the fully resolved config file to pipewire instead.
This will eventually allow us to have multiple lookup directories.
And be careful not to handle nodes created by si-audio-endpoint,
by using a specific property for that.
Also, use Audio/{Source,Sink}/Virtual as the media class of null sinks
created by si-audio-endpoint, it sounds more appropriate.
Fixes#34
pipewire's client.conf sets the default log level to 0, which is not
good for wpexec, as lua runtime errors are reported as warnings currently.
Also, let's use fprintf() for local cli errors to make sure they get printed
even if the log level is 0
systemd stops wireplumber with SIGTERM and this should exit gracefully.
if wireplumber is started by other means, it may just stop when pipewire
stops... that's also fine
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