Commit graph

412 commits

Author SHA1 Message Date
George Kiagiadakis
460e714a10 access-default: do not crash if the rules section is not defined in the config 2023-11-15 15:44:01 +02:00
George Kiagiadakis
ab44996ce9 access-default: do not require the configuration file rules to operate 2023-11-15 13:37:33 +02:00
George Kiagiadakis
cb243eea6d common-utils: avoid crashing when a rules section is not defined in the config 2023-11-15 12:57:41 +02:00
George Kiagiadakis
ac0d8ee4a8 monitors/alsa: remove vm.node.defaults and use match rules instead
The vm.node.defaults logic which was inherited from p-m-s is not really
good because it seems like different VM hardware requires different
values for the defaults. Also, passthrough USB hardware should not
inerhit these values, they just cause trouble.

Instead, we can use rules to match the vm.type and specific device
properties to set a more informed period & headroom.

For now, I am also decreasing the default headroom down to 2048, which
works for me and perhaps it's a good default. We can always add more
rules here and fine-tune per vm type and virtual hardware.

See !394, #316, #348, #507, #162, pipewire#3452
2023-11-14 21:32:18 +02:00
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
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
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
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
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
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
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
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
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
Dmitry Sharshakov
11b3803edc policy-dsp: add a policy for loading filter chains
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
2023-09-25 12:31:18 +03:00
Julian Bouzas
06fa06ca5c scripts: fix minor issues with smart filters policy
The filter's destination target was not being found properly due to iterating
the matching rules table with ipairs instead of pairs... the later is meant to
be used with JSON objects. In addition, the filters were not being re-evaluated
and linked properly when a device node was removed, this is because of a typo in
the find-best-target.lua script.

See #501
2023-09-21 09:04:31 -04:00
Jonas Holmberg
92e53bb7ba policy-device-profile: Use device.profile if set
Don't set best profile if device.profile property has been set with
alsa_monitor.rules.
2023-09-15 17:56:29 +02:00
Julian Bouzas
56017fdbe6 scripts: use filter-utils to implement smart filter policy 2023-09-03 14:33:34 +00:00
Julian Bouzas
1ba3844f2c scripts: add filter-utils.lua
Utilities Lua script for the policy to easily handle filter nodes.
2023-09-03 14:33:34 +00:00
Julian Bouzas
b984af7c87 scripts: add filters_metadata.lua
Creates a filters metadata to configure filters at runtime.
2023-09-03 14:33:34 +00:00
Julian Bouzas
d383762812 device: remove echo-cancel configuration
This will be possible to do with the new filter-utils.lua design.
2023-09-03 14:33:34 +00:00
George Kiagiadakis
67f9f63520 Merge branch '0.4' into next 2023-09-01 19:12:20 +03:00
George Kiagiadakis
02e1393c9f policy-node: destroy node only after sending an error to the client
if the node is destroyed before, pw_stream shuts down and doesn't
relay the error to the application
2023-09-01 16:23:09 +03:00
Julian Bouzas
dcee74fcca scripts: do not store the link in si_flags
Otherwise the link is not destroyed right away when doing silink:remove()
2023-08-15 16:32:19 -04:00