Commit graph

2379 commits

Author SHA1 Message Date
George Kiagiadakis
59972b6e4f systemd: change the template services to load different profiles instead of conf files 2023-12-21 11:28:50 +02:00
George Kiagiadakis
0037733545 daemon: add cmdline option to load custom profile and report error if not found 2023-12-18 17:58:09 +02:00
George Kiagiadakis
c0b212bb0e scripts: common-utils: do not crash if the defaults table is nil
Fixes #542, #544
2023-12-18 10:56:30 +02:00
George Kiagiadakis
b58c94816a docs: update configuration.rst 2023-12-15 21:14:24 +02:00
George Kiagiadakis
6ace763868 docs: add central doc section about the configuration file 2023-12-15 21:07:02 +02:00
George Kiagiadakis
32b31232d1 docs: document components, profiles, features and settings 2023-12-14 16:49:12 +02:00
George Kiagiadakis
396b88e64b docs: update copyright years 2023-12-14 12:33:42 +02:00
George Kiagiadakis
f63174ad5f docs: lua: document missing Core functions 2023-12-14 12:30:13 +02:00
George Kiagiadakis
c4a0f5317e meson: exclude rst files from being installed with the scripts
and add them nicely to the sphinx_files without referencing '..' paths
2023-12-13 16:31:50 +02:00
George Kiagiadakis
ca3bc3eb6d scripts: tidy up monitor settings and config options
* add a new common-utils method to get configuration sections with
  defaults more efficiently and with less boilerplate
* rework the ALSA reserve-device settings so that the priority is
  configured per device using rules and the application name comes
  from the WpCore instead of the config file
* rename bluetooth to bluez in all options for consistency with other
  monitors that use the backend API name
* rename alsa.midi to alsa-midi for consistency with bluez-midi
2023-12-09 15:52:24 +02:00
George Kiagiadakis
4feebfc3a3 m-lua-scripting: add Core.get_properties() method 2023-12-08 12:28:24 +02:00
George Kiagiadakis
600adf003b scripts: tidy up device-related settings
* rename settings to make more sense
* split out monitor settings into a separate category
* add setting for restoring the default nodes in the node category
2023-12-08 12:06:28 +02:00
Julian Bouzas
78fe6f1ef9 m-si-audio-adapter: make sure format task is finished even if ports were already configured
Currently, if the adapter node already has its ports configured when wireplumber
starts (For example a virtual node), the async _set_ports_format() call is never
completed because the node ports have not changed, stalling the event stack.
This fixes the issue by checking the Props param after configuring the ports,
and completes the task if there is one pending and the node already has ports
available.

Fixes #527
2023-11-28 10:59:15 +00:00
George Kiagiadakis
383b0e605d scripts: tidy-up linking related settings
* prefix all settings with just "linking."
* rename settings to make more sense
* fix the handling of the "follow" setting
* move the "move" handler to the rescan.lua script, as it's just a rescan hook
2023-11-19 18:34:33 +02:00
George Kiagiadakis
33fc476cb3 s-linking: always rescan when the default targets change
The "follow" setting was never really meant to disable reacting to
default target changes. It is also not meant to disable moving normal streams
to follow the default target. It is only meant to control whether streams
with a 'target.object' that matches the default target will move or not
to follow the default target changes (PulseAudio compat thing...)

Even if we leave this code here, disabling the "follow" option may disable
reacting to default target changes, but the streams will be moved anyway
when there is some other change in the graph (i.e. in the next rescan)
2023-11-19 17:52:20 +02:00
George Kiagiadakis
679d660058 settings: tidy up node-related settings
* prefix all settings with "node."
* move settings-stream.lua to settings-node.lua
* move the "audio-no-dsp" setting to the node settings
* add more settings related to node features
* split the default stream volume into 2 settings, one for playback
  streams and one for capture streams
2023-11-15 18:16:52 +02:00
George Kiagiadakis
2f071a67be scripts: rename all foo-config libs to settings-foo
And also use the term 'settings' everywhere instead of 'config' to refer
to the options managed by the WpSettings architecture
2023-11-15 15:44:01 +02:00
George Kiagiadakis
beafcf1ac3 config: install commented-out conf files as examples in /usr/share/doc/wireplumber/examples 2023-11-15 15:44:01 +02:00
George Kiagiadakis
460e714a10 access-default: do not crash if the rules section is not defined in the config 2023-11-15 15:44:01 +02:00
George Kiagiadakis
ab44996ce9 access-default: do not require the configuration file rules to operate 2023-11-15 13:37:33 +02:00
George Kiagiadakis
cb243eea6d common-utils: avoid crashing when a rules section is not defined in the config 2023-11-15 12:57:41 +02:00
George Kiagiadakis
ac0d8ee4a8 monitors/alsa: remove vm.node.defaults and use match rules instead
The vm.node.defaults logic which was inherited from p-m-s is not really
good because it seems like different VM hardware requires different
values for the defaults. Also, passthrough USB hardware should not
inerhit these values, they just cause trouble.

Instead, we can use rules to match the vm.type and specific device
properties to set a more informed period & headroom.

For now, I am also decreasing the default headroom down to 2048, which
works for me and perhaps it's a good default. We can always add more
rules here and fine-tune per vm type and virtual hardware.

See !394, #316, #348, #507, #162, pipewire#3452
2023-11-14 21:32:18 +02:00
George Kiagiadakis
501f119803 monitors/alsa-midi: move default property values in the Lua script 2023-11-14 21:26:34 +02:00
George Kiagiadakis
2f226aca75 monitors/libcamera: s/libcam/libcamera/g 2023-11-14 17:33:59 +02:00
George Kiagiadakis
9cf372b8ab monitors: remove the unused libcamera.lua script 2023-11-14 15:45:35 +02:00
George Kiagiadakis
8ca781c63a wireplumber.conf: refactor optional pipewire modules into components
This allows loading these pw modules only if they are needed.
2023-11-14 15:34:51 +02:00
George Kiagiadakis
6a88d8aa2c comp-loader: add support for loading pipewire modules as components 2023-11-14 15:34:11 +02:00
George Kiagiadakis
4593245fbb comp-loader: add support for wireplumber.components.rules
This is a new rules section that allows defining rules to modify
component definitions. This is useful to add repetitive dependencies,
for example, as in the case of "type = script/lua" that always requires
the "support.lua-scripting" feature. This can also be useful to modify
other component properties, such as the arguments, in overriding
configuration files, without needing to redefine the whole components
section.
2023-11-14 12:42:32 +02:00
George Kiagiadakis
42b64bfc28 spa-json: rename _from_string() to _wrap_string() and add new "from" variants
The previous naming convention was confusing because it did not make
it explicit that the string is not being copied. We had this wrong already
in the Lua bindings and thanks to some miracle it hasn't backfired so far
(it was using the "wrap" behaviour with a string that doesn't stay alive).

In some places we actually need the "copy" behaviour and in some other
places we need the "wrap" behaviour, so let's have both variants available.
2023-11-14 12:36:10 +02:00
George Kiagiadakis
96eae7d523 json-utils: add wp_json_utils_merge_containers(), factored out of conf.c 2023-11-14 12:02:31 +02:00
George Kiagiadakis
585279e13a config: add bluetooth seat-monitoring feature 2023-11-13 17:18:40 +02:00
George Kiagiadakis
5541832416 monitors: test the features that enable optional functionality 2023-11-13 17:18:40 +02:00
George Kiagiadakis
bac54c8f0e monitors/alsa: drop the half-implemented support for the "JACK device"
Users are recommended to use the JACK bridge instead, nowadays:
https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-JACK#jack-bridge
2023-11-13 17:18:40 +02:00
George Kiagiadakis
d30fcf34a4 config: drop some unused settings and replace others with component features 2023-11-13 17:18:40 +02:00
George Kiagiadakis
b1f891e149 lua api: add support for PW_PERM_L 2023-11-13 17:18:40 +02:00
Stefan Ursella
762ebad4c8 scripts: skip profile iteration when device.profile found
Do not continue iteration over all other profiles when
we found the profile set in the 'device.profile' property.
In other case we would overwrite this profile when
we find a best_profile.
2023-11-13 12:13:01 +01:00
George Kiagiadakis
6f3a307e6f spa-pod: don't use assertion macro in code that needs to run always 2023-11-08 20:41:34 +02:00
George Kiagiadakis
9b8987e8c0 spa-pod: fix parser to be able to collect IDs as strings ('K') 2023-11-08 20:40:19 +02:00
George Kiagiadakis
18ea9606d2 tests: fix script-tester to work with the metadata.lua changes 2023-11-08 20:37:13 +02:00
George Kiagiadakis
83e47ab7c2 tree-wide: refactor active feature checks to use _test_active_features()
Similar to 5fc7e68d10, it's wrong to test
multiple flags with a simple & operation. In some cases we had this wrong.
2023-11-08 12:23:00 +02:00
George Kiagiadakis
44a157b506 lib: object: add functions to test active and supported features 2023-11-08 12:08:30 +02:00
George Kiagiadakis
ed224f7c79 scripts: merge metadata.lua and filters-metadata.lua 2023-11-07 22:07:04 +02:00
George Kiagiadakis
a6dd60ff83 conf: remove wp_conf_apply_rules() 2023-11-07 16:36:49 +02:00
George Kiagiadakis
299e671ffa scripts: switch to using JsonUtils.match_rules_apply_properties()
Note: this requires all existing config files to be modified to follow
pipewire's rules syntax, with an "actions" object wrapping the
"update-props" object.
2023-11-07 16:36:49 +02:00
George Kiagiadakis
fbecc50319 lua: api: bind json-utils functions 2023-11-07 16:36:49 +02:00
George Kiagiadakis
89ac416e99 lib: add new json-utils set of functions
The purpose is to wrap some utilities that pipewire provides that use JSON.

Start by wrapping pw_conf_match_rules(), which despite its name, it has nothing
to do with the configuration object. It operates directly on JSON and can be
useful to work with match rules outside the context of configuration files.
2023-11-07 16:36:49 +02:00
George Kiagiadakis
d45c5eb623 s-create-item: add some debug logging 2023-11-07 16:36:49 +02:00
Barnabás Pőcze
5e48a2afc1 meson.build: set WIREPLUMBER_CONFIG_DIR in devenv
This is needed for wireplumber to start up correctly in the meson
devenv when built as a subproject of pipewire. The reason for this
is that the value set for `PIPEWIRE_CONFIG_DIR` in the wireplumber
meson build file will be overriden when the pipewire meson files
set up another devenv with its own `PIPEWIRE_CONFIG_DIR`.
2023-11-03 03:24:23 +01:00
Julian Bouzas
f5a29981aa linking: use si_props for 'target.*' properties
This avoids indexing the Lua table every time the properties are accessed.
2023-11-02 16:09:48 +00:00
Julian Bouzas
8ac96f4a37 linking: handle 'target.linger' property
When set to 'true', the node will remain alive without any error produced if
it cannot be linked to its specified target; in all other cases, an error will
be produced and the node will be destroyed.
2023-11-02 16:09:48 +00:00