Commit graph

2952 commits

Author SHA1 Message Date
Julian Bouzas
5f26e4d01a m-standard-event-source: Add priority for new 'destroy-' local event types
This new event type have the same priority as the 'create-' one.
2026-04-08 16:19:28 -04:00
Julian Bouzas
bf1d2c82b7 global-proxy: Add collection-name property
Helper function to get the collection name of a global proxy easily. This
property can also be used in object interest constrains to select objects of
a particular collection.
2026-04-08 16:19:23 -04:00
Julian Bouzas
e78a28f5b6 permission-manager: Update permissions when a matched object has been collected or dropped
This is needed because the 'collection-name' gobject property changes if the
object has been collected or dropped.
2026-04-08 16:19:18 -04:00
Julian Bouzas
a713270769 m-standard-event-source: Emit '*-collected' and '*-dropped' events
These events are emitted when a global was collected into a collection or
dropped from a collection respectively.
2026-04-08 16:19:13 -04:00
Julian Bouzas
5a2b15c1a0 m-standard-event-source: Emit 'select-collection' event for all added objects
This new event has higher priority than the 'added' event, and it is meant to
be used by hooks that collect objects into collections.
2026-04-08 16:19:07 -04:00
Julian Bouzas
155bbbfc38 m-lua-scripting: Add WpCollection and WpCollectionManager Lua APIs
This allows using the new collections API in Lua scripts.
2026-04-08 16:19:02 -04:00
Julian Bouzas
58ad3a1976 wpctl: Add new 'collections' command
This new command shows information about collections.
2026-04-08 16:18:57 -04:00
Julian Bouzas
1913a4f239 modules: Add new collection-manager module
This module is in charge of creating all the collection metadatas.
2026-04-08 16:18:52 -04:00
Julian Bouzas
a3803de00b lib: Add new WpCollectionManager API
This API allows handling of collections easily. It mainly allows creating them,
destroying them, collect globals into a them and dropping glovals from them.
The manager also automatically destroys a collection of all globals where
dropped from the collection.
2026-04-08 16:18:45 -04:00
Julian Bouzas
82be02e8fa lib: Add new WpCollection API
This API allows grouping globals into collections. A collection is essentially
a metadata object with information about all the globals it collects. Grouping
globals into collections has the advantage of avoiding defining complex set of
properties to match the interested globals, and they are also a more generic way
to represent a set of globals that share something in common.
2026-04-08 16:18:39 -04:00
Julian Bouzas
e1874f8b31 wpctl: Connect to the manager socket if possible
This gives the tool unrestricted access.
2026-04-07 09:38:58 -04:00
Julian Bouzas
478c9402fc module: Call parent's destructor before finalizing
This fixes memleaks when unreferencing the module.
2026-04-01 08:36:39 -04:00
Julian Bouzas
210467c5ce scripts/client: Refactor scripts to use the new PermissionManager API
The refactoring uses a new 'select-access' event to select the access for each
client with a fallback mechanism. The fallback priority is: configuration,
flatpak, snap, portal, and default.

The access JSON configuration has also been improved so that users can create
their custom permission managers and attach them to any client. See the access
configuration example for more information describing how to do this.
2026-03-31 12:15:14 +03:00
Julian Bouzas
dcd59bc31d client: Add _attach_permission_manager () API
This attaches a permission manager to a client so that it can handle permissions
automatically when the interested objects have changed.
2026-03-31 12:15:14 +03:00
Julian Bouzas
c03f4fd4d7 m-lua-scripting: Add Lua API for WpPermissionManager
This allows using the new permission manager API in Lua scripts.
2026-03-31 12:15:14 +03:00
Julian Bouzas
484e1f0fb7 lib: Add new WpPermissionManager API
This allows setting object specific permissions on any client easily.
2026-03-31 12:15:14 +03:00
Julian Bouzas
78bd42cad8 bluez: Don't set bluez5.autoswitch-routes on BT devices
This seems to cause some issues with BT profile autoswitch.

See #932
2026-03-30 07:33:58 -04:00
Jonas Holmberg
529aaa66cb object, registry: Increase prio of idle sources
Raise the priority of all idle sources that need to be dispatched in
order to make the linking/linkable-added-immediate hook run.
2026-03-25 16:30:46 +01:00
Jonas Holmberg
374c48b339 event-dispatcher: Dispatch one event at a time
Return after dispatching one event so that other GSources also can be
dispatched in between events when there are many events in queue.
2026-03-25 16:30:46 +01:00
George Kiagiadakis
07e730b279 0.5.14 2026-03-25 12:49:03 +02:00
Barnabás Pőcze
c2b96ebb39 m-lua-scripting: impl_module_new(): fix property list memory leak
The `properties` argument of `wp_impl_module_load()` is marked
"transfer none", thus the caller's reference remains valid and
must be disposed of.

Fixes: ef29018c55 ("m-lua-scripting: Add WpImplModule bindings")
2026-03-20 20:30:44 +01:00
Torkel Niklasson
1cfeab9a86 linking: Make rescan optional on linkable changes
Split rescan-on-linkable triggering into a separate script file
(linking/rescan-on-linkable.lua) that can be disabled via
wireplumber.profiles by setting hooks.linking.rescan-on-linkable =
disabled.
2026-03-19 20:29:32 +02:00
Julian Bouzas
b453464320 autoswitch-bluetooth-profile: Switch/restore the profile using 'autoswitch-*' event hooks
Since 'autoswitch-*' events have lower priority than 'select-*' events,
this guarantees that the autoswitch hooks will always run after the
'device/apply-profile' hook, avoiding possible race conditions.
2026-03-19 20:25:38 +02:00
Julian Bouzas
7023ad0c2c m-standard-event-source: Add 'autoswitch-*' local event priority
These local events have lower priority than the 'create-*' and 'select-*' ones,
and are meant to be used when wireplumber wants to automatically switch profiles
or other things.
2026-03-19 20:25:38 +02:00
Julian Bouzas
20238072e2 autoswitch-bluetooth-profile: Ensure the saved profile is headset/non-headset before switching/restoring
Otherwise find the highest priority one.
2026-03-19 20:25:38 +02:00
Julian Bouzas
f38f1a2af8 autoswitch-bluetooth-profile: Rename device-profile-changed hook name to be more consistent
This makes all the script hooks more consistent.
2026-03-19 20:25:38 +02:00
Julian Bouzas
9fb963d4e5 autoswitch-bluetooth-profile: Don't evaluate if node state changes from 'idle' to 'suspended'
This is not needed and can improve performance a little bit.
2026-03-19 20:25:38 +02:00
Julian Bouzas
8dcf3ce6ed autoswitch-bluetooth-profile: Check profile names to see if a profile is headset
We cannot only rely on the input routes to check whether a profile is a headset
profile or not because some BT devices can have A2DP source nodes, causing the
autoswitch logic to not work properly.

This patch fixes the problem by also checking if the profile name matches the
'headset-head-unit*' or 'bap-duplex' patterns. If the profile name does not
match those patterns, the profile is not considered headset profile.

See #926
2026-03-19 20:25:38 +02:00
Julian Bouzas
2954e0d5e8 autoswitch-bluetooth-profile: Make sure current profile is valid before switching 2026-03-19 20:25:38 +02:00
Pauli Virtanen
76b26deabf monitors/bluez: Don't set api.bluez5.internal=true on HFP HF streams
Setting api.bluez5.internal=true changes media.class to
Audio/(Stream|Sink)/Internal which makes HFP HF output get wrong media
class.

Don't set this for headset-audio-gateway. Fixes HFP HF stream media
class.
2026-03-18 22:14:14 +02:00
Arun Raghavan
eef9baee61 apply-routes.lua: Add a mechanism for per-device default volumes
This allows us to have per-device configuration for device volumes, via
a `device.routes.default-volume` property. This allows a non-global
override for situations where we want to expose a different out-of-box
volume (say for an internal speaker where we know a better comfortable
default setting, or HDMI where we might want to avoid attenuation by
default).
2026-03-18 18:05:28 +02:00
NorwayFun
46638971c3 po: Update Georgian translation 2026-03-18 17:59:58 +02:00
Barnabás Pőcze
215c9efd02 monitors/libcamera: load node locally
At the moment the libcamera monitor and "Device" objects are loaded in the
wireplumber process, but the "Node" objects are loaded in the pipewire daemon.
Due to that, both processes have their own separate `libcamera::CameraManager`
objects. These operate independently.

As a consequence of the above, there is an inherent race condition: when a
new camera appears and the wireplumber process detects it and instructs the
pipewire process to create a "Node" for it, at that point, the camera might
not exist in the `CameraManager` of the "pipewire" process.

This can happen during the initial enumeration as well as hotplug. So load
the nodes locally in the wireplumber process so that all libcamera objects
use the same `CameraManager`, thus eliminating the race condition.
2026-03-18 17:35:33 +02:00
Robert Mader
f535befda4 systemd: allow mincore system call for Mesa/EGL
This is required in order to allow plugins to use GL as mincore
is used in Mesas `_eglPointerIsDereferenceable()`.

One example for a client wanting to do so is the in-development
libcamera GPUISP, see https://patchwork.libcamera.org/cover/24183/

(cherry picked from commit pipewire@4796b3fb9524c20ac0f5006143b6a13ee50c01ec)

See pipewire/pipewire!2530
2026-03-18 17:35:33 +02:00
Frédéric Danis
1762d91e75 wp-uninstalled: Allow to pass WIREPLUMBER_CONFIG_DIR 2026-03-18 17:29:42 +02:00
Baurzhan Muftakhidinov
355bb0fb8f Update Kazakh translation 2026-03-02 12:28:25 +02:00
Anders Jonsson
b262ac43be Update Swedish translation 2026-02-25 09:08:25 +02:00
twlvnn
38c07393e5 Updated Bulgarian translation 2026-02-21 13:07:17 +01:00
Julian Bouzas
83d08dfa43 bluez: Remove sink loopback node
Desktop environments like KDE and GNOME seem to have issues with sink loopback
nodes. Let's remove them for now.
2026-02-16 21:54:37 +02:00
Julian Bouzas
48ed27d11b state-stream: fix Lua 5.4 compatibility
The 'elseif' and 'else if' keywords are treated differently in Lua 5.4
2026-02-13 10:17:02 -05:00
George Kiagiadakis
de0bca5902 state-stream: fix crash in case the Format has a Choice for the number of channels
Fixes: #903
2026-02-06 11:28:34 +02:00
Achill Gilgenast
27337ed268
systemd: Allow installation of systemd services without libsystemd
Allows installation of systemd services without libsystemd installed.
Useful for Alpine Linux where systemd services are allowed to be subpackaged
(e.g. for postmarketOS) but hasn't systemd in it's repos.

It has no change in existing behavior, but installs services if the unit
directories are explicitly set.
2026-02-05 17:42:14 +01:00
Julian Bouzas
72b680fc4c bluez: Use 'target.object' instead of smart filters for BT loopback nodes
This allows treating BT loopback nodes as regular nodes.

See #898
2026-02-03 12:49:57 -05:00
Barnabás Pőcze
11af177902 event-hook: fix interest hook event type memory leak
In `wp_interest_event_hook_get_matching_event_types()`, the variable
`res` owns the allocated `GPtrArray`, but there is an early return
in the function. Hitting that will leak the allocation, so use
`g_autoptr` to avoid that.

Fixes: b80a0975c7 ("event-dispatcher: Register hooks for defined events in a hash table")
2026-01-29 12:47:27 +01:00
Barnabás Pőcze
2b78d9c20d meson: update lua wrap to 5.5.0
Update the lua wrap file to the latest lua version, which is 5.5.0.
2026-01-29 11:06:00 +01:00
Julian Bouzas
4cebb63d76 monitors/bluez: Always create loopbacks if Device support A2DP and HSP/HFP profiles
This simplifies a lot the logic as we don't need to destroy and re-create the
internal BT nodes right away if the loopback nodes were create after them.

We also now listen for changes in the BT profile autoswitch setting. If the
setting is disabled, the source loopback is destroyed. If it is enabled, the
source loopack is created. This makes the setting to take effect immediately,
without needing to disconnect and re-connect the BT device for the setting to
take effect.
2026-01-27 09:28:34 +02:00
Pauli Virtanen
d81b170bbf monitors/bluez: fix BAP device set channel prop
As properties are no longer Lua tables, we'll need to make a table copy
for the Json constructor.

Fixes assigning Json.Array to a non-table, and ending up with
"audio.position":"0x7b771267d690" instead of ["FL","FR"] in json output,
which caused BAP device set node to always have mono channels.
2026-01-26 19:56:28 +02:00
George Kiagiadakis
024f88322c wpctl: Allow virtual nodes in set-default command
Use prefix matching instead of exact matching for media.class when
validating nodes in the set-default command. This allows virtual
nodes (e.g. Audio/Source/Virtual) to be set as default devices,
while still excluding internal nodes.

Fixes #896

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:39:17 +02:00
Julian Bouzas
80842cbb96 default-nodes: Never consider Audio/Sink nodes as best for default audio.source node type
Audio/Sink nodes should only be used as default audio source node type if the
user has explicitly selected it. If the user has not explicitly selected it,
we should always ignore it and instead select the highest priority Audio/Source
node.

Fixes #886
2026-01-21 10:49:13 -05:00
Barnabás Pőcze
a5a079ec1d meson: accept lua 5.5 as well
Lua 5.5 was released on 2025-12-22[0], and wireplumber appears
to work fine with it.

[0]: https://lua.org/versions.html#5.5
2026-01-12 14:20:16 +01:00