I'm doing some more refactoring here to make component loading easier to understand and use, as well as customize.
- First, each component can now provide a "feature", which is basically a string that describes what it does. I've tried to make the feature names uniform and I plan to document the nomenclature.
- Second, features can be marked as
disabled. When a feature is associated with a component (by the use of the
providesfield), this marking extends to the component.
requiredcomponents must be loaded, otherwise the operation will fail and make wireplumber quit.
optionalcomponents don't need to be loaded, unless they are marked as
requireddependencies (see below) of other
disabledcomponents won't be loaded at all, and in case they are marked as
requireddependencies of something else, then the operation will fail.
- Each component can now list required dependencies that it has (
requiredfield) as well as optional dependencies (
wantsfield). This allows pulling dependencies. When the load operation starts, only
requiredcomponents are considered for loading. Then, any additional
optionalcomponents are pulled based on these fields.
- It's obviously fine to disable
optionalcomponents that are optionally wanted by other components. This way we can customize behaviour. For instance,
support.dbusis optional and it's optionally wanted by other optional modules (
portal-permissionstore). If you set
support.dbus = disabledin the config, none of these modules will be loaded without any complaints. And by default, since they are all
optional, if d-bus is not available, none of these modules will be loaded without failure (just a notice in the log). This is a better approach to !503 (closed) (CC @pvir)
- By default all features are
optional, which makes all components optional as well. However, if a component is not associated with a feature, then it is considered to be
required. This allows backwards compatibility to the older style of just listing all the components that must be loaded. It will allow users to load custom scripts by extending this json array, without having to explicitly define features and dependencies.