Commit Graph

2605 Commits

Author SHA1 Message Date
James Calligeros
d89293b606 node/software-dsp: implement loading filter graphs from disk
Using the new Conf() constructor, we can load and parse a filter graph
from a file on disk. This is useful when, for example, maintaining a
large database of filter graphs. It also keeps wireplumber.conf.d free
from clutter.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-04-17 18:31:09 +10:00
James Calligeros
d77edf70e9 lua: allow Conf methods to be indexed or called
Given that we are allowing Conf() to instantiate a new WpConf,
the methods on the class need to be callable in reference to Self while
maintaining API compatibility with being indexable from the table as a
static method.

Allow this by checking if the first argument passed in is userdata.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-04-17 18:31:09 +10:00
James Calligeros
f769ea8f30 lua: add constructor and file ops for WpConf
This exposes the ability to load a SPA-JSON representation of a WpConf
object from an arbitrary file on disk to the Lua API

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-04-17 18:31:04 +10:00
James Calligeros
59d29f37ac conf: allow a SPA-JSON container to be loaded as a named WpConf section
A "plain" JSON object may be passed to WpConf constructors. Previously, this
would cause an error as open_and_load_sections expects the first parsed token
to be a string. Use WpProperties to denote that the file being parsed is an
object/container, and specify a section name for it.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-04-09 13:15:50 +00:00
James Calligeros
34040d8e44 conf: allow a WpConf to be loaded without fragments
Use WpProperties to indicate that searching for and loading
conf.d fragments can/should be skipped.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-04-09 13:15:50 +00:00
James Calligeros
42666e2054 conf: Add WpProperties as a member of WpConf
WpProperties may be used to control the behaviour of a WpConf
object. This allows those properties to be referenced at any time
during the lifetime of a WpConf.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-04-09 13:15:50 +00:00
James Calligeros
105d53025e conf: explain behaviour of wp_base_dirs_find_file
The signature of the function is quite misleading. If an absolute
path is passed to it, it will ignore the directory constraint flags
and search outside of the specified directories anyway. Make a note
of this in its caller.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-04-09 13:15:50 +00:00
George Kiagiadakis
8892204f24 wplua/sandbox: support mixing static methods and constructors in class identifiers
Global class identifiers, such as "Node", "SessionItem", "Conf", etc
are so far defined either as methods, which are constructors for
the GObject class, or as tables, which contain "static" methods, i.e.
methods that can be called without an instance.

In some cases, we may want to mix a class being both instantiatable
with a constructor and also have static methods. To support this,
allow the class identifier be declared as a table with the constructor
being defined as the "__new" method. This change allows calling the
table as a method and execute "__new" underneath.

For instance:
```
json = Conf.get_section_as_json("foobar") -- static method
conf = Conf("/foo/bar") -- constructor, equivalent to Conf.__new("/foo/bar")
```

See also !629
2024-04-09 13:15:50 +00:00
Pauli Virtanen
9d7c6b85d0 monitors/bluez: fix BAP device set node naming
It is intended that its name is the actual device node name.
Fix this, as it was broken in some recent changes.
2024-04-06 21:59:16 +03:00
George Kiagiadakis
8ee351838d monitor-utils: clear cam data after creating nodes
The cam_data structure stores a reference to the "parent" WpSpaDevice
and doesn't allow it to be destroyed when the monitor detects that
the device is no longer present. Clear it right after pushing the event
to make sure there's no dangling reference left around

Fixes: #627
2024-04-03 12:31:42 +00:00
George Kiagiadakis
7856124df0 core: set context.modules.allow-empty to silence warning in pw_context
See cddea858d9

Closes: #620
2024-04-03 11:52:18 +03:00
George Kiagiadakis
961450b2ac 0.5.1 2024-03-30 16:50:38 +02:00
George Kiagiadakis
1fddefa072 docs: move the software_dsp document down in the TOC
This is one of the least likely things that a user would want to
discover and use, making it wierd to be the very first "policy"
to present.
2024-03-30 15:52:14 +02:00
George Kiagiadakis
ab18cb1848 docs: improve the wording and formatting of the software_dsp doc 2024-03-30 15:44:38 +02:00
George Kiagiadakis
3b0c0fcd7e state-stream: fix storing/restoring notification volume
We apparently store things in the <media-class>:<key>:<value>
format, while pipewire-pulse expects <media-class>.<key>:<value>
and this detail was missed in the latest refactoring.

It also seems that I forgot to ensure that restoring this metadata
key worked. The hook was there, but not registered.
Remove the hook and directly populate the metadata object when
it is activated, as it seems simpler.

Fixes: #604
2024-03-30 11:53:45 +02:00
James Calligeros
2a45842169 node/software-dsp: do not hide target node when hide-parent is false
The existence of props["hide-parent"] is truthy. Parse the boolean explicitly
to get the correct logic.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-03-30 00:00:57 +10:00
James Calligeros
b45eafa53c docs: Document automatic software DSP handling
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-03-30 00:00:52 +10:00
James Calligeros
692e6e4b5b wireplumber.conf: add node.software-dsp to wireplumber.components
This component provides the automatic filter graph interface to consumers.
We provide the component by default, however it is not activated unless
explicitly requested in wireplumber.profiles by a consumer.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-03-29 23:49:21 +10:00
James Calligeros
82b0ec8c30 node/software-dsp: Port Node ObjectManager to SimpleEventHook
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-03-29 23:48:09 +10:00
James Calligeros
9ab7c024f8 node/software-dsp: get match rules from conf.d
This allows DSP rules to be specified in a wireplumber.conf.d file under
the node.software-dsp.rules section. Properties are specified in the
software-dsp action.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-03-29 23:46:54 +10:00
James Calligeros
d5217fd4b6 node/software-dsp: move and rename scripts/policy-dsp.lua
As this DSP "policy" is intended to run on the creation/deletion
of a node, move it into the node subdir.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-03-29 22:44:53 +10:00
James Calligeros
62dd6effa8 policy-dsp: allow matching on all node properties
Prevously, we were only looking at node["global-properties"] for
properties to match on. Change this to instead run against
node.properties, so that we can use type-specific properties such as alsa.id.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2024-03-26 19:14:05 +10:00
Robert Mader
3ffd0956d4 linking: Use sendClientError in link-error handler
The current code was not updated to use `clients_om`, thus never
found a client, ending up never sending client errors.
Just use the shared helper to avoid such issues in the future.
2024-03-25 14:56:30 +01:00
Robert Mader
94031f8ef9 scripts: add error code argument to sendClientError helper
And update all users accordingly. This will allow the following commit
to use the helper with a different error code.
2024-03-25 14:56:04 +01:00
George Kiagiadakis
f69d25631d m-portal-permissionstore: improve the warnings printed due to remote errors
Demote the NotFound error returned by Lookup(), as it seems common to be
printed if the permission has not been configured.
2024-03-25 13:51:46 +02:00
George Kiagiadakis
053d2ae69c m-lua-scripting: downgrade notice to debug when printing operation errors
These errors are propagated to the caller, so it's the caller's
responsibility to print them appropriately, if necessary. Printing
a notice also here is only confusing.

A debug mesage is still be useful for developers to understand the flow.
2024-03-25 09:55:59 +02:00
George Kiagiadakis
c89316e52c linking: improve link failure & debug messages 2024-03-25 09:55:13 +02:00
George Kiagiadakis
7612068675 main: print warning about old style config files
Closes: #611
2024-03-25 09:07:22 +02:00
George Kiagiadakis
3043d258b3 docs: remove main.rst
This is out-of-date and wrong. I wanted to salvage the virtual-items
configuration docs from in there, but we are going to change that soon
- see https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/610 -
so the entire file can go away.
2024-03-23 17:14:01 +02:00
George Kiagiadakis
04a248f4d1 docs: conf_file: raise more the visibility of the config break 2024-03-23 17:09:09 +02:00
George Kiagiadakis
e6dc547624 docs/daemon: re-arrange some sections in the toctree to make more sense 2024-03-23 17:05:49 +02:00
George Kiagiadakis
ccfc501e82 docs: move well-known settings docs from src/scripts/lib to where they belong
These were documented in src/scripts/lib initially because the settings-manager
scripts used to be also there and it made sense to keep them close together.
2024-03-23 16:49:13 +02:00
George Kiagiadakis
c4d4cd48f6 docs: add a basic "config migration from 0.4" guide 2024-03-23 16:45:32 +02:00
Pauli Virtanen
61d1398f5b autoswitch-bluetooth-profile: never use headset profile without input
Autoswitch should make sure the saved headset profile always has an
input route.  Check this on loading/saving it, otherwise reselect it.

Headset mode profile without mic used to make some sense when it wasn't
using the loopback node (ie.  easy way to disable it), but now with the
loopback node this doesn't make sense any more and it's confusing if it
occurs, so we shouldn't allow it.
2024-03-23 14:02:21 +02:00
Pauli Virtanen
a73c931723 monitors/bluez: fix autoswitch A2DP input profiles
Profile autoswitch should support also A2DP profiles with input route,
so the loopback should not assume the source node is SCO one.

Also fix handling of AG SCO output stream nodes, which should not be
hidden as internal.
2024-03-23 14:02:21 +02:00
George Kiagiadakis
a562b22f60 docs: fix typo in {device,node}.disabled documentation
Fixes: #609
2024-03-23 12:00:55 +02:00
Julian Bouzas
291d3cd9a2 m-settings: remove all persistent settings if key is null
The wp_settings_delete_all() API internally uses wp_metadata_clear() to clear
all the keys in the persistent-sm-settings metadata object. This call emits
the metadata changed signal with both 'key' and 'value' set to NULL. When that
happens, we need to clear all settings from the state file.
2024-03-23 09:39:45 +00:00
Julian Bouzas
b16763f8d4 m-settings: clear schema settings metadata when plugin is disabled 2024-03-23 09:39:45 +00:00
George Kiagiadakis
50497cea03 m-std-event-source: cancel events when the node associated with the si dies
It is possible that a node is destroyed while the select-target
event is ongoing. In that case, the next hook to run will likely crash.
Fix this by cancelling events automatically when their subject
is a session-item associated with a node, as soon as the node is destroyed.

See !619
2024-03-22 15:35:22 +02:00
Pauli Virtanen
428462ddf3 filter-utils: fix handling of targetless smart filters
A smart filter should be considered "targetless" (i.e. interpose on
streams going to default target) only if filter.smart.target is not set.

Currently any smart filter with specified target not found is considered
such, which is wrong.  This causes misbehavior, such as all recording
streams going to the bluetooth dummy source.

Fix this by doing it correctly.
2024-03-21 20:19:26 +02:00
George Kiagiadakis
59d190a2bd 0.5.0 2024-03-18 17:51:32 +02:00
George Kiagiadakis
0508561686 main: set application.version on the core
This allows seeing wireplumber's version in pw-dump and such
2024-03-18 17:13:50 +02:00
George Kiagiadakis
a79d002402 alsa: rename vm.type to cpu.vm.name to be consistent with pipewire master
See 7e9e261fa6
2024-03-18 17:03:44 +02:00
George Kiagiadakis
d0b7dde4e9 log: make the log topic flags an enumeration and publicly documented
Fixes: #591
2024-03-18 16:39:45 +02:00
George Kiagiadakis
8a893bdaf0 docs: add document on how to modify the configuration
Including information about the rules syntax.
Fixes: #595
2024-03-18 13:57:26 +02:00
George Kiagiadakis
59183e938a docs: update access configuration doc 2024-03-18 13:57:26 +02:00
George Kiagiadakis
0649ba9aa6 docs: remove "policy" configuration doc page
This is all part of the well-known settings now
2024-03-18 13:57:26 +02:00
George Kiagiadakis
7b918060c4 docs: improve bluetooth documentation and example config file 2024-03-18 13:57:26 +02:00
Ashok Sidipotu
4683f1fa44 wireplumber.conf: run stream-state.lua before m-standard-event-source
Restore-stream hook is missing some of the node-added events if it is run after
they are reported by the m-standard-event-source

Fixes: #577
2024-03-15 16:58:41 +00:00
Anders Jonsson
6e4dff6960 Update Swedish translation 2024-03-15 14:44:10 +01:00