Commit graph

2704 commits

Author SHA1 Message Date
Pauli Virtanen
b68a6794cd autoswitch-bluetooth-profile: switch only Bluetooth devices
Handle only devices associated with Bluetooth loopback nodes.

Make sure the node.link-group iteration cannot get stuck if there is a
loop in the link graph.
2024-09-10 07:51:03 +00:00
George Kiagiadakis
141b2d5d3f 0.5.6 2024-09-05 20:59:11 +03:00
George Kiagiadakis
f2013d8cd0 lib: wp_core_connect_fd: add \since marker 2024-09-05 20:19:33 +03:00
George Kiagiadakis
e7dc79859d docs: document multi-instance configuration profiles 2024-09-05 20:12:03 +03:00
Robert Rosengren
ec8975ac6a docs: clarified how to setup debug logs in lua 2024-09-05 10:52:28 +00:00
George Kiagiadakis
40e5dbff3d systemd: load the system instance with the 'main-systemwide' profile by default
This can still be overriden in the configuration file, if needed.

See #608
2024-09-03 11:40:05 +03:00
George Kiagiadakis
43ea3db02c wireplumber.conf: add systemwide, embedded and split-instance profiles
Revamp the profiles section, making use of the inherits feature
and add commonly used profiles for systemwide & embedded use cases,
as well as profiles for a split-instance configuration where the
policy hooks run in a separate instance from the alsa, bluetooth
and camera monitors (which run in 3 separate instances respectively)

Also add an example on how to configure the loaded profile using
a config file instead of the CLI switch.

Fixes: #608
2024-09-03 11:39:10 +03:00
George Kiagiadakis
a061018150 internal-comp-loader: implement profiles inheriting other profiles
This allows to inherit all the profile definitions of another profile
before the current profile's definitions are parsed, allowing for
more complex structures to be present in the default wireplumber.conf
without too much copy-paste
2024-09-02 17:00:53 +03:00
George Kiagiadakis
fae966558c wireplumber.conf: add before/after dependencies where needed
All hooks except the monitor ones should be loaded before the
standard-event-source and all the monitors should be loaded after.
2024-09-02 15:45:29 +03:00
George Kiagiadakis
32be79ee56 wireplumber.conf: improve the v4l2 and libcamera monitors components definitions
This was needlessly complicated and some of the requires did not make sense
2024-09-02 13:55:41 +03:00
George Kiagiadakis
89ab5616c0 tests: component-loader: fix GError memory leak 2024-08-31 20:47:45 +03:00
George Kiagiadakis
a245d5fa46 internal-comp-loader: implement before/after dependencies for components
In some cases, requires/wants dependencies are not enough. As we saw in
!617, the m-standard-event-source module needs to be loaded after all
the hooks, otherwise there may be missed events that the hook was
supposed to "catch", but they were delivered before the hook was actually
loaded. In a similar fashion, we have in purpose put all the "monitor"
components at the every end of the array because if we load them earlier,
they will create devices and nodes before all the hooks are in place to
react.

While in standard configuration we can work this around, in extended
user configurations with custom components, it is impossible to do this
without overriding the entire components array.

To fix this properly, introduce before/after dependencies. They work in
a similar fashion as they work with event hooks. They do not implicitly
"pull" any components to be loaded, but they affect the ordering if the
mentioned components are indeed present.

Note that for backwards compatibility reasons and unlike systemd units,
the "requires"/"wants" targets imply an "after" dependency on them.

Fixes: #600
2024-08-31 20:33:42 +03:00
George Kiagiadakis
479523abf9 lib: settings: find the first loaded instance of WpSettings when metadata_name is NULL
This allows changing the metadata name in the configuration file
and get all the Lua scripts looking at this new settings metadata
without requiring any other code changes. It can be useful in
multi-instance setups where we'd like the instances to be isolated
and load their own settings instead of relying on each other for that.
2024-08-29 17:15:50 +03:00
George Kiagiadakis
219711129e main: show the profile name on the app name
Useful in multi-instance configurations
2024-08-29 17:15:50 +03:00
tytan652
895c1c7286 lib: core: merge wp_core_connect implementations 2024-08-26 14:56:03 +00:00
tytan652
41523b68ba lib: core: allow to connect a core with a given socket 2024-08-26 14:56:03 +00:00
George Kiagiadakis
8c25ee2e19 po: add Slovenian (sl) language
Closes: #705
2024-08-26 17:33:36 +03:00
Julian Bouzas
0a86653085 autoswitch-bluetooth-profile: Use event source object managers
This patch removes the manually created object managers in the BT profile
autoswitch logic, and instead uses the object managers from the event source,
simplifying the logic a bit.
2024-07-12 10:18:12 -04:00
George Kiagiadakis
773fee315a docs: add info on how to set the log level via configuration 2024-07-09 08:59:18 +03:00
Julian Bouzas
afcb91f59b rescan: Stop rescan for 2s if BT node is removed
The intention here is to fix a Bluetooth bug where changing between different
profiles momentarily causes streams to be linked to an internal speaker.
Unfortunately, this case is not handled by the event dispatcher because some
signals are emitted using idle callbacks, and therefore we have to rely on
extra logic in rescan.lua to solve the problem.
2024-07-01 08:12:33 -04:00
Julian Bouzas
ff33f38bea rescan: Merge filters metadata changed hook with rescan-trigger 2024-06-28 11:42:11 -04:00
George Kiagiadakis
43e939c0e3 0.5.5 2024-06-28 18:18:02 +03:00
Julian Bouzas
c60475b293 wpctl: Make sure default node Id is updated when printing filters
This will properly show '*' for default sink filters in the status output.
2024-06-28 15:13:34 +00:00
George Kiagiadakis
11f10b4f45 Revert "lib: core: set the export core to be shared to pipewire modules"
This reverts commit 8012fbd5cf.

There seems to be some underlying bug that sometimes causes a crash
when the Bluetooth monitor uses a loopback for autoswitching between
profiles. Reverting temporarily until the cause is fully determined.

See #682
2024-06-28 18:01:56 +03:00
George Kiagiadakis
01a7339625 linking: explicitly mark targets that should be managed by the role-based policy
The previous assumption that any target with "device.intended-roles"
should be managed by the role-based policy is wrong, as for example
Bluetooth SCO nodes always have "device.intended-roles = Communication"
and some ALSA devices managed by ACP also do. This is meant to be used
as a hint for the desktop policy (it's been there in PulseAudio as well)
and does not necessarily mean that a role-priority-based policy should
be applied on all links to those devices.

Instead, use a new property to explicitly mark all the targets that
are meant to be managed by the role-based policy and respect that in
all places where we check for a potential role-based policy link.

Fixes: #682
2024-06-28 10:21:02 +03:00
George Kiagiadakis
abc299c1d3 linking: redefine script dependencies
This way of definining dependencies ensures that if we remove one
of the find-* hooks from the config, the rest of them will continue
to work in the expected order. Previously, removing one of them
would break the entire chain.
2024-06-28 10:21:02 +03:00
Julian Bouzas
96dc045382 l/find-best-target: Allow regular filters to be best targets
Similar to 4868b3c3 and fa671216, we always want to treat regular filters as
normal stream/device nodes.
2024-06-27 15:36:42 +00:00
George Kiagiadakis
fe42d931da linking-utils: fallback to role priority 0 if none is defined
See #682
2024-06-27 17:10:04 +03:00
George Kiagiadakis
dc6694fb84 0.5.4 2024-06-26 17:39:04 +03:00
George Kiagiadakis
d31615c58f smart-equalizer.conf: fix filter.smart.target usage example 2024-06-26 17:32:33 +03:00
George Kiagiadakis
317b5e8013 config: rename the duck-level option to have "role-based" in its name
Also, move the example from linking.conf to media-role-nodes.conf,
as it's more relevant there, and make sure the setting is constantly
read back in the Lua script, so that runtime changes can work.
2024-06-26 17:23:09 +03:00
George Kiagiadakis
52590ac850 docs: linking: update existing hooks documentation 2024-06-26 16:34:39 +03:00
George Kiagiadakis
d8fbf887b8 scripts: remove deprecated and outdated intended-roles.lua
This is now provided by find-media-role-target.lua
2024-06-26 16:30:45 +03:00
George Kiagiadakis
54d0f6fc7b l/rescan: use parseBool() to interpret boolean property
The previous check was also working, but this is safer
2024-06-26 16:19:32 +03:00
George Kiagiadakis
9436dc7afe s/link-target: mark links as role-based only if the role links rescan hook is enabled
Otherwise we would be left with broken links that are never activated
2024-06-26 16:11:00 +03:00
George Kiagiadakis
248b489b1b script-tester: load find-media-role-target.lua to fix test failure 2024-06-26 15:50:20 +03:00
George Kiagiadakis
39a1ce4eee config: add example that shows how to setup a smart equalizer filter 2024-06-26 15:50:20 +03:00
George Kiagiadakis
ebe158d8cb s/link-target: do not treat links to monitoring streams as role links
There are 2 cases captured here:

1. The stream has "stream.monitor = true", which is used
by pavucontrol for the vu meters and should probably not be managed
by the role policy, no matter if the target is a Source or a Sink

2. The stream is an Input (capture) stream and is targeting a Sink,
which may be used to target the sink's monitor ports. Even if we
want, we can't manage these links because they have opposite direction
than the one expected. Let's leave them alone...
2024-06-26 15:50:20 +03:00
George Kiagiadakis
fd4607b4f5 s/link-target: avoid holding a reference to the si in the link-error callback 2024-06-26 15:50:20 +03:00
George Kiagiadakis
fea6b11ad1 s/create-item: add setting to enforce a media.role on streams that don't have one 2024-06-26 15:50:20 +03:00
George Kiagiadakis
42727fcbc6 linking: move find-media-role-target hook to run later in the chain
A defined target should have priority over a role-based target
2024-06-26 15:50:20 +03:00
George Kiagiadakis
8012fbd5cf lib: core: set the export core to be shared to pipewire modules
pw_context allows sharing a core between modules and this is useful
to avoid having all the role loopbacks connect to pipewire on their own
2024-06-26 15:50:20 +03:00
George Kiagiadakis
b029e5a5b5 config: add example media-role-nodes.conf 2024-06-26 15:50:20 +03:00
George Kiagiadakis
0d995c56a8 wireplumber.conf: improve standard policy definition
First, add the find-media-role-target to the standard policy.
It does not affect anything and it doubles as the replacement
for intended-roles.lua, as it merely prioritizes linking nodes
that have "media.role" set to targets that have "device.intended-roles"
set to the corresponding role.

Second, make the rescan-media-role-links.lua also load as part
of the standard policy. The idea is to embrace this functionality
by default and make it available on desktops. It does not break
anything as well, but it will apply its own rules to links that
are created between nodes that have a
"media.role" <-> "device.indended-roles" match.
2024-06-26 15:48:07 +03:00
Ashok Sidipotu
5948539551 remove "virtual items" scripts, m-si-audio-virtual and related tests 2024-06-26 15:48:07 +03:00
Ashok Sidipotu
f6b77c7456 linking: role based priority system: hook to apply policy 2024-06-26 15:48:07 +03:00
Ashok Sidipotu
fcaece85e9 linking-utils: add routines to keep track of the priority media role link 2024-06-26 15:48:07 +03:00
Ashok Sidipotu
375094151d linking: get-filter-from-target.lua: bypass for media role targets 2024-06-26 10:16:10 +03:00
Ashok Sidipotu
4dd831424a linking: add a new hook to find media role targets 2024-06-26 10:16:10 +03:00
Julian Bouzas
4868b3c336 get-filter-from-target: Don't bypass the hook if the session item is a regular filter
Regular filters should be treated as regular stream / device nodes. Note that
the filter utils API is meant to be used using the direction of the main smart
filter nodes. This is why we use the target direction instead of the actual
stream direction to check if the stream session item is smart or not.
2024-06-25 14:15:46 -04:00