Commit graph

1763 commits

Author SHA1 Message Date
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
Julian Bouzas
e9be326954 spa-json: add _new_from_stringn() API 2022-03-24 04:35:12 -04: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
Julian Bouzas
2f186c10e7 main: use WpSpaJson when loading components 2022-03-24 07:21:25 +00:00
Julian Bouzas
a68a7cec0e spa-json: allow parsing unquoted keys when getting object properties
Unquoted strings are used in wireplumber and pipewire configuration files.
2022-03-24 07:21:25 +00:00
Pauli Virtanen
7e6e0e9ba0 src: setlocale in main() for tools and the daemon
Previously, pw_init calls setlocale(), but this will change in future.
Setting the locale should be done by the main application, and is needed
in wireplumber for e.g. for translated UI elements.

Set the locale in main() for wireplumber daemon and tools, to have the
locale set also with the new pw_init behavior.

Set also LC_NUMERIC to C, to match old pw_init behavior.
2022-03-24 07:11:39 +00:00
Ashok Sidipotu
f032ac00cf properties: Add get count API
This API returns the count of the number of properties or items.
2022-03-24 06:59:39 +00:00
George Kiagiadakis
8b97b40c44 release 0.4.9 2022-03-22 13:38:58 +02:00
Wim Taymans
f46a801edb tests: use GNU_SOURCE for compiling tests as well
So that strtod_l is found.
2022-03-21 12:01:00 +01:00
George Kiagiadakis
44a09a1050 tests: spa-json: add a test to verify that we can parse the spa-json format
The spa-json parser allows some interesting things to happen, which
are not valid JSON, but we use them for readability in config files...

- The separator may be = or just a space instead of :
- Strings may be unquoted
- Commas may be omitted
2022-03-16 21:25:07 +02:00