Commit graph

998 commits

Author SHA1 Message Date
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
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
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
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
ed224f7c79 scripts: merge metadata.lua and filters-metadata.lua 2023-11-07 22:07:04 +02:00
James Calligeros
3fa87510d1 config: allow passing arguments to pipewire modules
Sometimes, it may be necessary to pass arguments in to a
Pipewire module being loaded. Allow this to be done using
the same format as load_module()/load_optional_module().

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2023-11-07 15:22:29 +00: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
d45c5eb623 s-create-item: add some debug logging 2023-11-07 16:36:49 +02:00
James Calligeros
7394f478d6
conf: update module-rt usage
update the module-rt description and commented-out defaults to
reflect the addition of utilisation clamping to the module.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2023-11-07 22:06:28 +10: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
Julian Bouzas
970050d3b5 linking: handle 'target.dont-fallback' and 'target.dont-move' properties
Two new properties are available to change the behavior of the linking policy:
 - target.dont-fallback: when set to true, the node shouldn't be allowed to
fallback to another available target other than the one specified in the
target.object property or metadata.
 - target.dont-move: when set to true, wireplumber should ignore the
target.object metadata, so that it isn't possible to dynamically move the node
to another target using metadata.

See #524
2023-11-02 16:09:48 +00:00
Julian Bouzas
a6bacde2c8 link-target: set was_handled flag when link was created
fixes 'node.dont-reconnect' property when the node was linked before.
2023-11-02 16:09:48 +00:00
Julian Bouzas
a2469b5b39 find-defined-target: don't stop processing if defined target is not prepared yet
This is an old hack that was needed before the event dispatcher was implemented,
and therefore is not needed anymore.
2023-11-02 16:09:48 +00:00
James Calligeros
7a65d76a57 policy-dsp: add ability to hide parent nodes
some hardware devices are never supposed to be accessed directly by
clients, and are designed under the assumption that they will be
front-loaded by some sort of DSP. add a hide_parent property
to policy-dsp and revoke all permissions to the bound node of a DSP
graph where this is set to prevent hardware misuse or damage by poorly
behaved/configured clients.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2023-10-30 20:11:47 +00:00
Pauli Virtanen
e0b09e7a76 main: try to connect preferably to the manager socket
Try to connect to the default manager remote, before trying the default
remote.

Check libpipewire version is new enough to support setting arrays.
Bump Pipewire version to have pw_check_library_version.
2023-10-30 20:00:57 +00:00
Julian Bouzas
c9dc02d941 rescan: make sure disabled smart filters are unlinked before rescanning
This patch improves the smart filters unlinking logic by only unlinking smart
filters that are disabled, instead of any kind of filters. The patch also
removes redundant filter hooks.
2023-10-26 08:15:09 -04:00
Julian Bouzas
6980f9ff5d filter-utils: always evaluate filters before 'linking/rescan' hook
Fixes smart filters not being linked correctly when starting wireplumber if no
clients are playing/capturing audio.
2023-10-25 10:34:40 -04:00
George Kiagiadakis
eb6f569be8 Merge branch 'master' into next 2023-10-24 11:09:52 +03:00
t123yh
b6c1fdb2e1 scripts: Fix typo in autoswitch-bluetooth-profile.lua 2023-10-23 09:50:38 +00:00
Barnabás Pőcze
6d01627cd0 wpctl: use auto cleanup for the WpCtl object
This is already done for `WpDaemon` and `WpExec`, so let's do it
here as well. This prevents some memory leaks in error paths,
which makes it easier to find real issues in the ASan output.
2023-10-22 23:02:35 +02:00
Julian Bouzas
388acb6ff3 scripts: Fix bluetooth profile autoswitch
This patch updates the deprecated policy-bluetooth.lua script so that it works
with the current version. The script has been moved into the device sub-folder,
and renamed to autoswitch-blueooth-profile.lua. The settings-manager is also
used for the configuration, and the actual configuration has been moved from
linkind.conf to bluetooth.conf.
2023-10-19 11:24:42 -04:00
Pauli Virtanen
c91dcaa046 access: set pipewire.access.effective property on clients
Report the resolved access level in pipewire.access.effective property,
so that the final level is visible in pw-dump.
2023-10-17 21:06:31 +03:00
Pauli Virtanen
199671dfa3 access: handle pipewire.client.access and flatpak status
Handle client-requested and flatpak access on the session manager side.

Pipewire daemon doesn't know about the intended permission hierarchy, so
it is better done on the session manager side, where all the rules are.
2023-10-17 21:06:31 +03:00
Pauli Virtanen
7a369b70dc access: support new "default" pipewire.access value
The "default" access is used for normal clients, in the use case where
Pipewire server will not assign permissions itself but leaves it to the
session manager. In this use case only session manager has
"unrestricted".

Make "default" equal to "unrestricted" in the default access
configuration.
2023-10-16 19:54:19 +03:00
Wim Taymans
69ed77042f config: set priority. keys on midi-bridge
So that it can be used as a fallback driver.

See pipewire#3562
2023-10-12 12:01:05 +02:00
Ronan Pigott
b2bfb1b917 wpctl: add zsh completions 2023-10-10 07:07:16 +00:00
Dmitry Sharshakov
5faab4e8c2 policy-device-profile: set default and best by device.profile 2023-10-02 14:52:45 +00:00
Julian Bouzas
4ad263b16c scripts: add new 'filter.smart' property
This allows users to enable/disable smart filter policy per filter. The property
is considered false by default, meaning that smart filter policy is disabled for
all filters by default.
2023-10-02 10:44:46 -04:00
Julian Bouzas
7044226f66 scripts: use 'filter.smart' prefix for smart filter properties 2023-10-02 10:44:46 -04:00
Julian Bouzas
0b44d9cf84 scripts: change filter.enabled property to filter.disabled
Avoids confusion with default value if the property is not defined.
2023-10-02 10:44:38 -04:00
George Kiagiadakis
1e40108d94 linking-utils: rename unwrap_find_target_event -> unwrap_select_target_event 2023-09-30 12:06:40 +03:00
George Kiagiadakis
c7b00599d7 scripts: remove 'active-features' session item constraints
I don't fully remember where this originates from, but it looks like
some sort of hack to workaround a race condition where the event handler
would try to iterate over items that were just created and were not yet
fully ready to be used.
2023-09-30 11:10:30 +03:00
George Kiagiadakis
6af88b283c linking-utils: cleanup duplicate functions 2023-09-30 11:02:02 +03:00
George Kiagiadakis
43aa2d4952 scripts: don't use 'local' for file-wide scoped variables
Since all scripts run in a sandbox with their own global environment,
it means that they don't interfere with each other's global variables.
Therefore, all file-wide variables can be declared global without
any change in behavior. In my understanding, it is better to do so
because this means that any code accessing those variables is going
to access them directly from the global environment table with a simple
lookup rather than having each variable referenced in the local closure
of each function separately.
2023-09-29 23:13:28 +03:00
George Kiagiadakis
2f89c64b7f docs: add documentation on device, default-nodes and linking scripts 2023-09-29 16:14:08 +03:00
Ashok Sidipotu
0dcd28e50f Lua scripts: replace "policy" with "linking" 2023-09-26 10:09:03 +03:00
Ashok Sidipotu
1f92767d4b config: replace "policy" with "linking" 2023-09-26 10:07:57 +03:00
Ashok Sidipotu
70b781ed64 steam.conf: enhance the illustration of the config 2023-09-26 10:06:03 +03:00
Ashok Sidipotu
9aeaf7367e bluetooth.conf: change the syntax for rules from Lua to JSON 2023-09-26 10:03:44 +03:00
Ashok Sidipotu
f4d421988c access.conf: uncomment the rules the way they were before 2023-09-26 10:03:07 +03:00
Dmitry Sharshakov
2970ee2634 policy-dsp: expect policy-device-profile to manage profiles 2023-09-25 12:31:18 +03:00
Dmitry Sharshakov
2dd28c0015 policy-dsp: load filters from file 2023-09-25 12:31:18 +03:00