George Kiagiadakis
81af8c2069
lua: sandbox: remove all traces of the minimal_std flag, as it's no longer used
2022-04-23 20:14:59 +03:00
George Kiagiadakis
ecb6100b77
m-lua-scripting: wrap every script in a WpPlugin and expose async activation api
...
This allows scripts to declare when they have finished their loading,
so we can now also know when wireplumber is done loading and ready to
handle clients
Related to !313
2022-04-23 20:14:59 +03:00
George Kiagiadakis
031bc65c20
lua: sandbox: relax the sandbox to allow more functionality in scripts
...
This enables the debug and coroutine libraries and some more functions
that are not really so risky to have around
Related to #121
2022-04-23 20:14:59 +03:00
George Kiagiadakis
9387ce0d95
wplua: implement reference counting of the lua_State
2022-04-23 20:14:59 +03:00
George Kiagiadakis
9c22f6076a
wplua: enable the use of require() to load lua libraries from scripts/lib
2022-04-23 20:14:59 +03:00
George Kiagiadakis
e1d0240bc9
wplua: split the functionality of the load functions into smaller functions
...
The load functions used to do 3 things:
- push the sandbox function on the stack
- load the file and push it as a function on the stack
- call the sandbox (or the file)
Now there are separate functions to do these 3:
- wplua_push_sandbox
- wplua_load_*
- wplua_pcall
2022-04-23 20:14:59 +03:00
Pauli Virtanen
bbe9ac00f3
modules: add m-i18n
...
Add simple gettext i18n module.
Add Lua script API functions I18n.gettext, I18n.ngettext.
2022-04-11 19:20:43 +03:00
George Kiagiadakis
17a257ddbe
wplua: move under modules/module-lua-scripting
...
It's unlikely that wplua will ever be useful outside the context
of module-lua-scripting, so let's move it to keep all the code in one place
2022-03-24 09:47:59 +02:00
Wim Taymans
afbc0ce57a
si-audio-adapter: relax format parsing
...
Some nodes can omit the format/rate/channels to indicate that they can
deal with all possibilities and adapt to what they are linked to.
See pipewire#876
2022-02-25 16:47:09 +00:00
Julian Bouzas
b3446efa16
config: port device-activation module to policy-device.profile.lua
...
Because all wireplumber policies are in Lua.
2022-02-16 13:37:40 -05:00
George Kiagiadakis
ca906362cd
lua-scripting: expose WpImplMetadata on the API
2022-02-03 13:04:55 +02:00
Julian Bouzas
b1b603443f
restore-stream: use the new Json API and remove route-settings-api module
2022-02-02 18:37:39 +00:00
Julian Bouzas
384c5775f8
default-nodes: add option to auto-switch to echo-cancel nodes
...
This option is enabled by default now.
2022-01-27 14:55:21 -05:00
Julian Bouzas
b0ddd6f890
m-lua-scripting: add Json.Raw constructor
2022-01-26 09:53:24 -05:00
Julian Bouzas
46ab414a04
spa-json: fix coverity scan issues
2022-01-25 21:18:16 -05:00
Julian Bouzas
5bef0f240f
default-nodes: use WpSpaJson API
2022-01-25 07:40:59 -05:00
Julian Bouzas
20187e07b5
m-lua-scripting: add WpSpaJson API
2022-01-25 07:20:35 -05:00
Julian Bouzas
95e7c4abe8
m-default-nodes-api: add API to get and set default configured node name
2022-01-25 09:57:33 +00:00
Julian Bouzas
10531e95b5
default-nodes: reevaluate when device params changed
...
Some devices have different nodes for speakers and headphones. In that scenario,
this change notifies the policy to re-link all clients to the new default node
when the user plugs and unplugs the headset.
2022-01-24 16:18:31 -05:00
George Kiagiadakis
93d3051966
Revert "default-nodes: increase priority if node has available routes"
...
This reverts commit ad80faaa8d .
The same issue is fixed by the intermediate commit by Wim. Let's revert
this to keep the logic in-sync with policy-node.lua and media-session.
2022-01-14 17:55:24 +02:00
Wim Taymans
211f1e6b6c
default-nodes: handle nodes without Routes
...
When a node has not part of any EnumRoute, we must assume it is
available.
Fixes selection of Pro Audio nodes as default nodes.
2022-01-14 16:32:04 +01:00
Julian Bouzas
ad80faaa8d
default-nodes: increase priority if node has available routes
...
Fixes #163
2022-01-14 09:15:08 -05:00
Julian Bouzas
8844cfb074
device-activation: show device name in logs
2022-01-12 19:27:17 -05:00
Julian Bouzas
b4245d64c5
default-nodes: add more logs
2022-01-12 19:26:49 -05:00
Julian Bouzas
75281d8681
default-nodes: check if default node has available route
...
Fixes #145
2022-01-12 07:16:08 -05:00
Julian Bouzas
07a0a5b404
default-nodes: check if the ports exist in rescan_om
...
Ports might not be ready in the node's port object manager yet.
Fixes #153 and #150
2022-01-12 09:48:36 +00:00
Julian Bouzas
0d008dce75
m-default-nodes-api: don't return stream node if default node name matches
...
Stream nodes can never be default nodes, so we skip them in case they have the
same name as the actual default node.
Fixes #130
2022-01-06 06:50:32 +00:00
Julian Bouzas
a1423a4b1f
m-device-activation: reset iterator when finding best and default profiles
...
Avoids possible issue when finding best profile when default is not found.
2022-01-05 08:54:12 -05:00
Corentin Noël
b6dd422dd2
si-audio-adapter: Reference WpTransition before passing it as callback data
...
Make sure to always have a valid WpTransition when used in the finish callback.
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
2022-01-05 10:28:33 +01:00
Julian Bouzas
f7dfb90db6
module-default-nodes-api: sync with core before emitting changed signal
...
This makes sure pipewire is not doing anything while emitting changed signal.
2022-01-05 08:57:33 +00:00
Julian Bouzas
8bbbba23ff
m-default-nodes: don't reevaluate nodes if they are not ready
...
This makes sure nodes are ready before finding the default node, avoiding audio
glitch in wrong device if profile was also changed while changing the default
node (can happen with Gnome Sound Settings).
Since nodes are destroyed and recreated again when a device profile changes, the
only way to make sure device nodes are ready is to check the profile classes
structure, which tell us how many total nodes the device has, and then check
that those nodes exist for that device. A rescan is triggered whenever devices,
nodes or ports changed.
This patch also improves the logic when finding default nodes, allowing virtual
sources to be set as default sources.
Fixes #85 and #130
2022-01-05 08:57:33 +00:00
Julian Bouzas
76a61e43a5
m-default-nodes: set effective node metadata to NULL if node is not found
...
There might not be any node at all, so we need to clear the efective node
metadata.
2022-01-05 08:57:33 +00:00
Wim Taymans
4896ad0680
json: improve json parsing
...
spa_json_get_string() will never write more than maxlen.
Use spa_json_parse_stringn() to perform destination length checking.
2022-01-04 16:36:15 +01:00
George Kiagiadakis
f3f063760c
si-std-link: handle node destroy events while linking is in progress
...
This should solve issues with stale objects lying around, printing
warnings and in some cases also crashing things
Related to #128 , #78
2021-12-22 16:12:04 +02:00
Julian Bouzas
f8d60fcecd
m-device-activation: reevaluate current profile if params changed
...
This also uses the same reevaluation logic as pipewire-media-session.
Fixes #98 and #118
2021-12-20 09:54:05 +00:00
Julian Bouzas
4997e2eb19
m-default-profile: only store the default profile if the save flag is present
...
Also refactors module to use params-changed signal.
2021-12-20 09:54:05 +00:00
Julian Bouzas
86d85584b2
m-mixer-api: unset iterator value before breaking or returning from loop
2021-12-20 09:54:05 +00:00
Julian Bouzas
2af63b20df
si-standard-link: return transition error once even if multiple links failed
2021-12-13 08:37:07 -05:00
iczero
a452250b47
scripts: also look in $XDG_CONFIG_HOME/scripts
2021-12-06 14:47:49 +00:00
Julian Bouzas
e3a161273d
m-device-activation: set best profile if default is not available
2021-12-06 12:10:41 +00:00
Julian Bouzas
49f1ead1a7
si-standard-link: always return transition error if activation fails
...
Avoids having the session item in an invalid state.
2021-11-25 16:06:17 +00:00
Julian Bouzas
9ed6af021f
si-audio-adapter: always return task error if set ports format fails
...
Avoids having the session item in an invalid state.
2021-11-25 16:06:17 +00:00
Julian Bouzas
45d567b488
si-audio-adapter: clean up unneeded code when setting ports format
2021-11-25 16:06:17 +00:00
Peter Hutterer
f4546a18e8
m-reserve-device: replace the hash table key on new insert
...
We're using the WpReserveDevice's name as key in the hash table, so we
must update the key as well when we replace an item in the hashtable -
the old device (and its name) will be released.
The side-effect of this is that the *third* device with an identical
name will no longer replace the previous device. This results in the
following sequence:
- dev1 added: name Audio0
- dev1 requests name owner Audio0
- dev2 added: name Audio0
- replace dev1 in the hashtable
- dev1 emits "release" signal
- dev1 unowns the Audio0 name
- dev2 requests name owner Audio0
- dev3 added: name Audio0
- adds to the hashtable because the existing key is now undefined
- dev3 requests name owner Audio0
- error, you cannot request ownership for the same name twice
Fixes #93
2021-11-18 12:00:09 +00:00
Julian Bouzas
72b3be9e83
m-si-audio-endpoint: use an internal audio adapter session item
...
Avoids code duplication with si-audio-adapter.
2021-10-21 14:03:10 -04:00
Julian Bouzas
5c1035bab4
m-si-audio-adapter: add no-format configuration property
...
Makes format finding optional when configuring item.
2021-10-21 13:04:33 -04:00
Julian Bouzas
44a0c55e3d
m-si-audio-endpoint: do not use virtual media class for null sink nodes
...
The PulseAudio layer does not recognize virtual media classes.
2021-10-20 12:50:33 -04:00
Julian Bouzas
6624eaaf3e
m-si-audio-adapter: remove unused audio utilities
2021-10-20 07:41:21 +00:00
George Kiagiadakis
eff97aed6e
file-monitor-api: allow watching files too, not just directories
2021-10-19 17:16:37 +03:00
Julian Bouzas
ea229779a8
si-audio-adapter: make sure formats is valid before iterating
2021-10-18 14:33:01 -04:00