Commit Graph

2604 Commits

Author SHA1 Message Date
George Kiagiadakis
f76f45124e base-dirs: add support for finding modules and remove wp_get_module_dir()
This makes things more consistent and allows us also to add more
search paths in the future if necessary.

Also, stop using g_module_build_path() because it's deprecated and
build the path manually. This obviously is not portable to Windows/Mac
or other exotic platforms, but portability is not important at this
point. PipeWire is also not portable beyond Linux & BSD.
2024-03-04 07:07:56 +00:00
George Kiagiadakis
c8feaad7a9 base-dirs: add XDG_CONFIG/DATA_DIRS and CONFIGURATION & DATA groups
This adds support for the system-wide locations for configuration and
data files, as defined by the XDG Base Directory Specification.

In addition, it adds two flag groups, CONFIGURATION and DATA, to the
base-dirs system, so that we don't have to hard-code the combinations
of flags everywhere.
2024-03-04 07:07:56 +00:00
George Kiagiadakis
a95cbda846 base-dirs: change the function signatures to prefix with wp_base_dirs_*
... and fix the arguments order and the documentation
2024-03-04 07:07:56 +00:00
George Kiagiadakis
6ae8c254a0 base-dirs: move file lookup utils out of wp.{c,h} and into base-dirs.{c,h} 2024-03-04 07:07:56 +00:00
George Kiagiadakis
3dc837c370 WpLookupDirs: remove the flag for looking into G_TEST_SRCDIR
Instead, make it so that WIREPLUMBER_*_DIR environment variables can
contain a list of directories to look into. This is safer and,
as a bonus, allows for more control over the lookup directories.
Using the G_TEST_SRCDIR variable can cause problems for tests of other
projects that use libwireplumber and may also lead to unexpected
behavior by not being obvious that this causes wireplumber to skip
looking in its standard directories...

This also brings back WIREPLUMBER_CONFIG_DIR, which is going to be
needed again for the upcoming WpConf changes.
2024-03-04 07:07:56 +00:00
George Kiagiadakis
770028aad5 wp_new_files_iterator: refactor to behave like pipewire
Previously files would be sorted across all configuration dirs
so their filename was all that mattered, not the priority of the directory.

Ex. you could get:

- /etc/wireplumber/10-foo.conf
- /usr/share/wireplumber/20-bar.conf
- $XDG_CONFIG_HOME/wireplumber/30-baz.conf
- /usr/share/wireplumber/40-zzz.conf

This commit changes that so that it follows the hirerachy of the directories
first and then the order of the filenames, starting from the lowest priority
directory. So now for the same files you get:

- /usr/share/wireplumber/20-bar.conf
- /usr/share/wireplumber/40-zzz.conf
- /etc/wireplumber/10-foo.conf
- $XDG_CONFIG_HOME/wireplumber/30-baz.conf

In addition, the hash table is avoided, making things a bit more efficient
and the files are checked for G_FILE_TEST_IS_REGULAR

Shadowing of files still works the same, so in the above example
if /etc/wireplumber/30-baz.conf also exists, it is not returned
in the list, because it's shadowed by $XDG_CONFIG_HOME/wireplumber/30-baz.conf
2024-03-04 07:07:56 +00:00
George Kiagiadakis
28f9716eff wp_find_file: s/char/gchar/ in suffix argument 2024-03-04 07:07:56 +00:00
Julian Bouzas
db21eb5dec docs: fix documentation for WpMetadataItem 2024-03-04 06:33:04 +00:00
Piotr Drąg
c0f65f6dc3 Update Polish translation 2024-03-03 14:46:29 +01:00
Julian Bouzas
578b85584c settings: fix all coverity scan defects 2024-02-29 07:23:58 -05:00
Julian Bouzas
8935837cda scripts: remove settings-manager and use the Settings API
The settings manager is not needed anymore because the WpSettings Lua API
returns now the default value from the schema if the setting is not found.
2024-02-28 10:20:31 -05:00
Julian Bouzas
f18a8c5a35 wpctl: use WpSettings API instead of metadata in 'settings' sub-command
Also adds -r flag to reset settings to their default value.
2024-02-28 10:20:31 -05:00
Julian Bouzas
f2e7a41175 m-lua-scripting: complete Lua Settings API
This patch adds the new WpSettings API in Lua.
2024-02-28 10:20:26 -05:00
Julian Bouzas
138591c449 m-settings: load all settings in sm-metadata
If a setting is not in the configuration file, use its default value.
2024-02-28 10:20:26 -05:00
Julian Bouzas
424a8e5263 settings: add API to set, reset, save, delete and iterate settings
Also improves and refactor the settings unit test to test all the new API added.
2024-02-28 10:20:20 -05:00
Julian Bouzas
a492d23019 m-settings: add settings schema to metadata
This patch improves module-settings to load the settings schema into a
'schema-sm-settings' metadata for clients to know what values types and range
are accepted for each particular setting. This settings schema is defined in
the wireplumber.conf, under a new section called 'wireplumber.settings.schema'.
2024-02-28 08:15:21 -05:00
Julian Bouzas
a23248847a metadata: remove wp_metadata_iterator_item_extract() API
Similar to WpPropertiesItem, this implements a new WpMetadataItem type that is
returned when iterating metadata
2024-02-28 08:15:17 -05:00
Julian Bouzas
bebfc07d84 wpctl: add settings subcomand to show, delete or change settings 2024-02-14 12:04:41 -05:00
George Kiagiadakis
5826a21456 0.4.82 (0.5.0 pre-release 2) 2024-02-14 18:40:30 +02:00
George Kiagiadakis
4dc7317010 docs: update ALSA documentation 2024-02-14 15:58:19 +02:00
Ashok Sidipotu
89b9218031 device-profile-hooks: add a hook to prioritize the profiles 2024-02-12 13:15:02 +05:30
Ashok Sidipotu
112a45a230 device-profile-hooks: move the selected profile check
move the check to the beginning of the hook.
2024-02-12 13:15:02 +05:30
Ashok Sidipotu
ad8d7aaf75 json-utils: correct typo 2024-02-12 13:15:02 +05:30
George Kiagiadakis
475ec4944d lib/settings: make the WpSettings object a non-singleton
This doesn't need to be a singleton, since we have the core registration
API available publicly nowadays. Makes things more clean for the API,
following the pattern of WpPlugin and WpSiFactory and simplifies the
built-in settings component in the internal component loader :)
2024-02-10 17:48:23 +02:00
George Kiagiadakis
d61bf89969 lib/settings: reorder functions to follow the pattern of other files 2024-02-10 16:42:15 +02:00
George Kiagiadakis
4d33aff107 monitors: improve notice messages about missing SPA plugins 2024-02-10 11:44:19 +02:00
George Kiagiadakis
99ee41c490 README: remove broken badge 2024-02-10 11:44:19 +02:00
Julian Bouzas
b703c01d4c wpctl: show persistent settings and add sub-command to clear them 2024-02-07 11:53:01 -05:00
Julian Bouzas
22f51336aa module-settings: don't remove setting from sm-settings if it was removed from persistent-sm-settings
Similar to 'default.audio.sink', a setting from sm-settings should never be
removed when the associated persistent setting is removed. Only settings from
persistent-sm-settings can be removed, like 'default.configured.audio.sink'.
2024-02-07 11:43:42 -05:00
Julian Bouzas
9bf646aed0 wpctl: show filters in the status output 2024-02-07 11:43:37 -05:00
Stefan Ursella
ac508aef57 linking: handle 'node.linger' property when target node not known
Do not send an error to the client when the target is not defined
and the 'node.linger' property is set.

It is not absolutely necessary that every node has a defined target.

We can have a 'Stream/Output/*' node which can be linked to
multiple 'Stream/Input/*' nodes and only the 'Stream/Input/*'
nodes have a defined target.
2024-02-04 17:33:46 +01:00
Julian Bouzas
1d2fe9b62d module-settings: remove 'settings.persistent' option
This patch removes the 'settings.persistent' option from the configuration as it
only allowed making settings persistent globally instead of individually. This
issue has been addressed in a simpler way by creating a 'persistent-sm-settings'
metadata. If a user wants to make a setting persistent, he can change the
'persistent-sm-settings' metadata object, if the user does not want to make a
persistent change, he can use the 'sm-settings' metadata object. Any changes in
the 'persistent-sm-settings' metadata will be also reflected in the 'sm-settings'
metadata object.
2024-02-02 14:02:49 -05:00
Julian Bouzas
b3a71e3f1c linking: rename props to 'node.dont-fallback', 'node.dont-move' and 'node.linger'
This makes those properties more consistent with 'node.dont-reconnect'.
2024-02-02 11:15:31 +00:00
Julian Bouzas
1c46115433 docs: add linking documentation 2024-02-02 11:15:31 +00:00
George Kiagiadakis
7a13189ce4 tests/wp/events.c: replace g_assert() with g_assert_true()
Fixes: #565
2024-02-01 17:45:44 +02:00
Julian Bouzas
d01441ca0a scripts: move filter-forward-format.lua from 'linking' to 'node' subdirectory
This is because 'filter-forward-format.lua' only configures nodes, and therefore
does not have anything to do with the linking logic. The setting has also been
renamed to 'node.filter.forward-format'.
2024-02-01 10:00:22 -05:00
George Kiagiadakis
32f86e38ad docs: improve smart filters documentation 2024-01-31 16:12:17 +02:00
Pauli Virtanen
6d9205cfe0 filter-utils: fix indexing nil value
Check target is not nil, which sometimes occurs, before trying to access
its .id property.

Fixes lua errors in logs.
2024-01-31 09:04:54 +00:00
George Kiagiadakis
c6e3dbf887 scripts/linking/rescan.lua: fix log access
The log object should be used with : in order to make sure that the
log handler has the correct topic in context.
2024-01-31 11:00:37 +02:00
Julian Bouzas
5581a9c2b7 scripts: only log session item Id when unhandling it
This is because the associated node does not exist anymore. This change also
logs the session item Id when handling it, so that it is easy to know if the
unhandled session item was handled or not.
2024-01-30 11:51:17 -05:00
George Kiagiadakis
2fcd24b2d3 docs: move smart filters documentation to the policies section 2024-01-30 12:13:16 +02:00
George Kiagiadakis
052ca9b4a7 docs: add policies section 2024-01-30 12:07:25 +02:00
Julian Bouzas
9cdb8f3110 bluez.lua: always hide sco-source nodes from applications
Since the loopback bluetooth source node is meant to be always used by
applications, this change hides the actual bluez sco-source node by marking
them as internal. This avoids showing 2 input devices in pavucontrol per BT
device if HSP/HFP profile is enabled.
2024-01-29 12:11:45 -05:00
George Kiagiadakis
cc4549134a script-tester: load the new settings-instance component 2024-01-29 12:57:35 +02:00
George Kiagiadakis
74bfe4baa3 script-tester: simplify the load_component() function 2024-01-29 12:56:46 +02:00
George Kiagiadakis
58b58b4b48 docs: reorder menu items under "Configuration" section
Also remove "main.rst", which is to be removed entirely as a file
(but only after its contents are all moved to other files).
2024-01-29 11:55:18 +02:00
George Kiagiadakis
ef24f35ff8 docs: rename settings section and add link back to the config option types 2024-01-29 11:55:18 +02:00
George Kiagiadakis
e19839dfce docs: add link from the well-known features section back to components & profiles 2024-01-29 11:55:18 +02:00
George Kiagiadakis
d5926b08e0 docs: add info about the different configuration option types 2024-01-29 11:55:18 +02:00
George Kiagiadakis
8b4885d21d conf: split out unneeded example sections to log.conf and settings.conf fragments 2024-01-29 11:55:18 +02:00