Commit graph

1772 commits

Author SHA1 Message Date
George Kiagiadakis
2754b9899d link: add link state accessors and change signal 2022-05-30 11:06:46 +03:00
George Kiagiadakis
9ec2757d27 monitors: enable libcamera by default and set priority on all camera nodes
Currently v4l2 nodes will get higher priority than libcamera ones.
The default can be changed, of course, with wpctl.

Things are still not great if a camera is enumerated by both monitors.
The first node to be linked will grab the device and the second one
from the other subsystem will fail to negotiate.
2022-05-26 14:08:16 +03:00
Michael Olbrich
13b85bd4a2 m-lua-scripting: fix object refcounting
7908b8d7be2a2992c57cd549054eda7ce46e4b44 ("m-lua-scripting: allow
converting GValue holding NULL objects to Lua") accidentally added a second
refcount. As a result, the objects are never freeded.

Remove the second refcount to fix this.
2022-05-24 11:40:35 +02:00
Piotr Drąg
06e9285b25 Add po/POTFILES.skip
So false positives don’t show up on https://l10n.gnome.org/module/WirePlumber/
2022-05-22 12:34:44 +02:00
Julian Bouzas
392cce2136 m-default-nodes: don't check if all device nodes are ready when finding default node
This check was originally added to avoid a small audio glitch when changing
default nodes while also changing the device profile (eg Gnome Sound Settings).
The check is removed because it causes issues when disabling alsa nodes. There
are plans to fix the audio glitch issue in the future with the planned
event-dispatcher architecture.

Fixes #279
2022-05-20 13:39:47 +00:00
Julian Bouzas
c00c5a6675 alsa.lua: fix device name deduplication when reservation is enabled
Fixes #241
2022-05-19 07:43:12 -04:00
Julian Bouzas
c2f31bb550 m-lua-scripting: allow converting GValue holding NULL objects to Lua 2022-05-19 07:43:12 -04:00
George Kiagiadakis
1a534f17ed docs: fix WIREPLUMBER_DEBUG examples
See !259
2022-05-19 13:44:32 +03:00
George Kiagiadakis
459e3834da Enable proper syntax highlighting. 2022-05-16 11:01:41 +00:00
jasker5183
6e35daa0d2 Add alsa_monitor.rule example, capitalization, syntax. 2022-05-12 15:36:39 +00:00
George Kiagiadakis
1f04530920 config: fix enabled property to default to "true" when not defined
Fixes backwards compatibility with older config files

Fixes: #254
2022-05-12 12:19:38 +03:00
George Kiagiadakis
b4eba2999e examples: add a lua example showing how to load filter-chain from a script 2022-05-11 13:07:39 +03:00
George Kiagiadakis
3400acd0db release 0.4.10 2022-05-10 17:31:57 +03:00
George Kiagiadakis
dacc586898 properties: improve documentation of _get_count() 2022-05-10 15:27:31 +03:00
George Kiagiadakis
2eed279c9d i18n: remove the module and embed the gettext calls into the lua api
There is no need to have this as an optional module, since libintl
is a hard dependency of both PipeWire and GLib. This way we can keep
things a bit simpler and faster (no string copies and plugin lookups)

Bump meson dependency to 0.59 to benefit of the libintl lookup that
is now built into meson's dependency() function.
2022-05-10 15:16:09 +03:00
George Kiagiadakis
85d0ecfb40 si-interfaces: improve documentation on latest api additions 2022-05-10 15:16:09 +03:00
Sven Bartscher
8dc4c36dd4 Enable automatic bluetooth profile switching for Mumble
For some reason Mumble uses "game" as its media.role, but it is
actually a communication tool where a headset profile is apropriate.
2022-05-10 10:45:03 +02:00
Théo Lebrun
3bdacc414e config: add enabled property on monitors
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2022-05-05 08:22:08 +00:00
Julian Bouzas
7080e9961c policy-node: forward filter stream's format to filter device
Currently, when using filter nodes such as echo-cancel or filer-chain, the
ports format of the virtual stream node might not always match the format of its
associated virtual device node. This can happen if the virtual stream node is
linked with a real device node configured with many channels, such as surround
profile. In that case, the channel configuration is not forwarded to the virtual
device node, making the application not being aware of a surround setup.

This change listens for port format changes in the virtual stream nodes, and
reconfigures the virtual device node ports everytime the virtual stream node's
port format changes.

This behavior is experimental and optional, so it is disabled by default.
2022-05-05 08:09:21 +00:00
Julian Bouzas
07179452e2 m-lua-scripting: add WpSiAdapter APIs 2022-05-05 08:09:21 +00:00
Julian Bouzas
1675b37617 si-adapter: add ports state change signal 2022-05-05 08:09:21 +00:00
Julian Bouzas
5a7dec4385 docs: add placeholder for lua_spa_pod 2022-05-04 16:04:56 -04:00
Julian Bouzas
0bda5ca189 docs: remove deprecated doxygen configuration params 2022-05-04 15:47:08 -04:00
Julian Bouzas
70ae393166 wpctl: support changing volume and mute by PID number
The 'set-volume' and 'set-mute' commands have a new --pid flag to allow changing
the volume or mute for all client nodes that are created by a specific process.
2022-05-03 09:36:57 +00:00
Krisztian Kovacs
8af6f3df1c modules/logind: be more specific when creating the login monitor
We're only interested in notifications for user state changes, so we should
better be more specific about it when creating the systemd login monitor.

This avoids issues with sd_login_monitor_new() returning EINVAL if
systemd-machined is not running (and thus /run/systemd/machines does
not exist).
2022-05-02 08:27:43 +00:00
George Kiagiadakis
7b8e3e8088 m-mixer-api: fix channelVolumes array iteration in set-volume
Fixes: #250
2022-05-02 11:02:40 +03:00
George Kiagiadakis
0f3bb516f8 wpexec: fix script activation to work with per-script plugins 2022-05-02 11:01:34 +03:00
Théo Lebrun
7784cfad92 wpctl: support @DEFAULT_{AUDIO,VIDEO}_{SINK,SOURCE}@ as ID 2022-04-26 13:51:32 +00:00
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
b216594497 docs: fix sandbox documentation to reflect changes 2022-04-23 20:14:59 +03:00
George Kiagiadakis
b29b313e7b tests: wplua: add a test for asynchronous script activation 2022-04-23 20:14:59 +03:00
George Kiagiadakis
0fba80899c object-interest: don't try to pattern-match NULL strings 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
msizanoen1
a2472542a9 scripts: access-portal: Fix incorrect bitmask checking for media roles
In Lua, `0` is a truthy value, which means `not 0` is `false`. Compare
the resulting value from bitwise AND with 0 instead of checking it with
`if not` to ensure correctness.
2022-04-15 13:23:19 +07:00
Pauli Virtanen
018ccb9ce6 po: Add translations from pipewire
The messages currently used in Wireplumber are also found in pipewire,
so merge translations from there.
2022-04-11 19:20:43 +03:00
Pauli Virtanen
6feecab74e scripts: translate user-visible strings in alsa.lua 2022-04-11 19:20:43 +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
Dennis D
f8e7b39c25 Update 10-default-policy.lua
Added "telegram-desktop", which is the name used by later versions of Telegram.
(tested on Telegram version 3.6.1)
2022-04-09 14:31:31 +00:00
Joker 234
f7c01d2475 Add Linphone to "media-role.applications"
Linphone (4.2.5) doesn't set any media.role → linphone should be in this predefined list as well.
2022-04-08 09:49:14 +00:00
Torkel Niklasson
d1f20e22d6 systemd: Allow systemd system services to use module-rt 2022-04-05 06:07:17 +00:00
Frédéric Danis
57769c2071 scripts: Add script to create fallback sink
This script, base on PipeWire module fallback-sink will create a fallback
sink node if there's no other sink available except the endpoints created
by WirePlumber.
2022-04-04 13:18:34 +00:00
George Kiagiadakis
0da29f3818 config: document which options need to be turned off to use wp without D-Bus
and actually implement an option for the logind module

Related to: #237
2022-04-04 14:38:28 +03:00
Pauli Virtanen
da5d25acbe scripts: policy-device-profile: clear tables when devices removed
When device ids are invalidated, clear all local tables about them,
because the id may be reused by different object, or the same object
reappearing.
2022-04-04 09:44:43 +00:00
George Kiagiadakis
8738955723 suspend-node: trigger idle timeout also if a node goes into "error" state
This is what media-session does as well and allows recovering from
errors without having to restart wireplumber
2022-04-04 11:31:37 +03:00
Pauli Virtanen
812fc9b6b1 scripts: policy-node: filter-like streams should not follow default
Filter-like streams (e.g. output stream from filter-chain) should not
start following default sink, as usually the user intends their routing
to remain static, and not change unless explicitly requested.
Pulseaudio has special handling for streams associated with filter
sinks/sources, and does not make such streams follow default.

Use presence of node.link-group to determine which streams are
associated with filter sinks/sources, and don't make them to follow
default.
2022-03-27 15:12:20 +03:00
Julian Bouzas
d173eeab88 main: don't use struct spa_json 2022-03-24 04:37:00 -04:00