Ashok Sidipotu
e7c992e97d
default-nodes-tests: use the changed variable in test utils
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
5c17747112
policy-utils.lua: remove object managers
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
80554fe1c7
common-utils.lua: remove metadata object managers
2023-04-17 07:48:18 -04:00
Torge Matthies
ab6a3393e6
lib/wp: Fix lookup_dirs with WP_LOOKUP_DIR_ENV_DATA or WP_LOOKUP_DIR_ENV_TEST_SRCDIR
...
Fixes: aa2f7e9f308f ("lib/wp: add a new search folder to locate the Lua Test scripts")
2023-04-17 07:48:18 -04:00
Julian Bouzas
c61d1e4245
component-loader: make wp_core_load_component() API asynchronous
...
This change completely refactors the way components are loaded in wireplumber:
- The module_init() function must return a GObject now. This object is either
a WpPlugin or a WpSiFactory in the current modules.
- When the component loader initializes a module, it automatically registers
the WpPlugin or WpSiFactory with their respective methods. There is no need
to register the WpPlugin or WpSiFactory in the module now.
- The wp_core_load_component() API has been refactored to be asynchronows. This
allows the component loader to automatically activate WpPlugin objects, and
therefore allows the application to directly get the WpPlugin without having
to find it. This simplifies a lot of things.
- The 'ifexists' and 'nofail' component flags now work even if the respective
WpPlugin could not be activated.
- The code that loads components in main.c has also been simplified a lot,
and the option to load dangling components has also been removed.
2023-04-17 07:48:18 -04:00
Julian Bouzas
ad940b6efc
component-loader: remove handling of 'pw_module' components
2023-04-17 07:48:18 -04:00
Julian Bouzas
6259a3a0fa
m-lua-scripting: remove handling of 'config/lua' files
...
Not needed anymore as the configuration is written in JSON now.
2023-04-17 07:48:18 -04:00
George Kiagiadakis
7c2e713c9d
m-metadata: remove module-metadata and replace it with a simple lua script
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
de3214d21b
default-node: rename select-default-nodes.lua
...
Consistent across linking and default node scripts.
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
50377f2a70
default-nodes: make the default-config* keys trigger common
...
This trigger will be available all the time irrespective of whether persistant
option is enable or not.
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
03bdf7d283
find-selected-default-node.lua: add a new default node hook
...
Hook accords higher priority to the currently selected device over and on top of
the previously selected devices.
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
9a0f8647ac
test-utils: align style
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
c7c06351f7
test-utils: add a restartPlugin API
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
c88a569835
default node tests: add initial test
...
tests the initial metadata setup.
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
0b29286f4f
script-tester: add a restart-plugin action signal
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
d4d4e23e9c
script-tester: pass the fixture pointer to plugin
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
c9e55e6565
script-tester: run default-node scripts ahead of m-metadata
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
85db1e371e
state-default-nodes: initialize the metadata variable
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
0d73c34c68
common-utils: add a null check for default-nodes query
...
common-utils is a singleton common resource, it cannot depend on the order in
which the components are loaded.
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
137cbf3f22
wireplumber.conf: hike the priority of default-node scripts
...
default-node scripts need to run before metadata module as default nodes need to
act when the default metadata is created.
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
000a869035
apply-default-node.lua: re-instate the "set default node" debug log msg
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
82c8269381
prepare-link.lua: fix unassigned variables
2023-04-17 07:48:18 -04:00
Julian Bouzas
d2123827f7
scripts: use the event stack to handle virtual session items
...
This removes both the policy-virtual-client.lua and policy-virtual-device.lua
scripts, and creates a new linking/find-virtual-target.lua script to link
clients with virtual session items if one of them can be found. In addition to
this, this patch also ports the policy-virtual-client-links.lua into a new
scripts/rescan-virtual-links.lua to use the event stack. The idea is for the
scripts/link-target.lua to create all links but only activate non virtual links,
and for the scripts/rescan-virtual-links.lua to activate/deactivate virtual
links based on role priorities.
2023-04-17 07:48:18 -04:00
Julian Bouzas
9ee0f096ec
tests: remove audiotestsrc-play example
2023-04-17 07:48:18 -04:00
Julian Bouzas
fb855b00cf
Rename endpoint concept to virtual session item
2023-04-17 07:48:18 -04:00
Julian Bouzas
9004362cda
lib: remove WpEndpoint and WpSiEndpoint APIs
2023-04-17 07:48:18 -04:00
Julian Bouzas
d43b55d01e
tests: use WpConf for the settings unit tests
...
Also moves the settings.conf file into settings/wireplumber.conf
2023-04-17 07:48:18 -04:00
Julian Bouzas
360e0b3eaf
scripts: use WpConf API to get configuration values
...
This patch also moves nested configuration objects that are not considered
settings from the wireplumber.settings section to its own configuration
section (eg the rules array, the spa plugin properties, etc...). This allows
those objects to be merged with other same sections defined in other files.
2023-04-17 07:48:18 -04:00
Julian Bouzas
6c6d5eccf9
main: use WpConf to get wireplumber component dependencies
2023-04-17 07:48:18 -04:00
Julian Bouzas
fdcd280120
m-settings: use WpConf to get the wireplumber settings
2023-04-17 07:48:18 -04:00
Julian Bouzas
a7a7e614db
m-lua-scripting: add WpConf Lua API
2023-04-17 07:48:18 -04:00
Julian Bouzas
cb80cb750b
conf: add support to override sections and nested objects/arrays
2023-04-17 07:48:18 -04:00
Julian Bouzas
8f66b16673
lib: add WpConf API
2023-04-17 07:48:18 -04:00
George Kiagiadakis
fe3d0b55ac
docs: initial design documentation
2023-04-17 07:48:18 -04:00
George Kiagiadakis
3779a92fcc
lua: AsyncEventHook: allow hooks to handle transition errors
...
When in error, attempt to execute a step called "error", if it exists.
This is rarely needed, but it might be useful in some cases to cleanup
some state, rolling back changes, when something fails.
2023-04-17 07:48:18 -04:00
George Kiagiadakis
18377fbf82
transition: don't allow _return_error() to be called recursively
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
6495eb6d21
linking tests: create stream node after device nodes are ready
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
8a6e28f496
test-utils.lua: create stream node with script tester plugin
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
cd7e9b190b
script-tester: create a new script tester plugin
...
script tester plugin with a action signal to create the stream node.
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
de394f7d02
linking tests: add defined tests
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
0099ef2932
test-utils.lua: add support for defined test cases
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
669b91678d
linking tests: add default device test cases
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
db4ace420c
test-lib.lua: add support of default device selection
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
de24f7a432
linking tests: add non default device tests
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
0d0230177a
test-utils.lua: support non-default device tests
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
e13a3a0a89
script-tester.c: use the latest list of components
...
use the latest list of components needed to launch linking tests.
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
4b153ec553
link-target.lua: change into a async hook
...
link setup is a asynchronous action, async hook serves the purpose well
here.
The code dependent on links will be less error prone with this design.
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
a8aeb1010e
policy tests: facilitate Lua src tests in script-tester.c
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
a1e79cc84b
script tests: add test utils
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
1b09061b9d
tests: settings: run all the tests with default metadata
...
There is no need to use an exclusive metadata just for tests, remove it to
simplify the code.
2023-04-17 07:48:18 -04:00