Commit graph

2770 commits

Author SHA1 Message Date
Tiago de Paula
ee42211bc6
fix: nil value in haveAvailableRoutes
Cause from partially renamed variables in af3c520d.

Closes #797
2025-05-21 01:00:59 -03:00
George Kiagiadakis
76b9e509d1 0.5.9 2025-05-19 12:32:21 +02:00
Philipp Jungkamp
404a634b92 docs: fix wrong description of software_dsp example 2025-05-18 15:49:59 +03:00
Julian Bouzas
0251d644a8 default-nodes/rescan: Check available routes using linking-utils
The linking-utils module already implements a way to check for available routes,
this patch uses it in default-nodes/rescan.lua to remove redundant code.
2025-05-18 14:11:53 +02:00
George Kiagiadakis
b8506d0d56 linking-utils: fix missing 'end' 2025-05-18 14:11:53 +02:00
George Kiagiadakis
af3c520d3e linking-utils: improve haveAvailableRoutes
Based on nodeHasAvailableRoutes() from default-nodes/rescan.lua
2025-05-18 13:56:14 +02:00
Julian Bouzas
050cd772be settings: cache setting values locally to avoid syncing issues
This patch caches the settings info to make sure their values are always
updated, even if using the settings API multiple times before pipewire
finishes synchronizing the metadata objects.

Fixes #749
2025-05-17 13:39:12 +03:00
Andrew Sayers
2a5606e437
Add TID and SYSLOG_{IDENTIFIER,FACILITY,PID} to log messages
Systemd journal entries have several common entries:
https://www.freedesktop.org/software/systemd/man/latest/systemd.journal-fields.html

Add "SYSLOG_IDENTIFIER" to make it easier to find wireplumber messages.
Add "SYSLOG_FACILITY" to avoid confusing programs that expect both or neither.
Add "TID" and "SYSLOG_PID" to make debugging a little easier.
2025-04-22 11:24:09 +01:00
David Mandelberg
08d7e51efb test-utils: make it possible to specify a device's props
The test I wrote for
https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/778 uses
this, since it needs a target-loudness to make a loudness filter:

```
tu.createDeviceNode (
  "default-device-node",
  "Audio/Sink",
  { ["device.target-loudness"] = -18 }
)
```
2025-04-11 13:55:24 +00:00
Pauli Virtanen
2d48caa74b monitors/alsa: fix nil table indexing
It's possible that managed_node.properties["node.name"] == nil if the
node is gone.

The removeDevice call above has already cleared the node names, so no
need to do it again.
2025-04-11 13:07:43 +00:00
George Kiagiadakis
9f440d0b50 monitors/libcamera: fix deduplicating devices with the same name 2025-04-11 15:53:44 +03:00
Lukas Riezler
e51e1b6080 v4l2/monitor: scripts: fix for deduplicate devices with the same name 2025-04-08 10:06:45 +02:00
David Mandelberg
a2605a2cdf Change node.dont-remix to stream.dont-remix
I'm guessing this was a typo? I ran `git grep dont-remix` in both
wireplumber's and pipewire's repos, and all the other references were to
stream.dont-remix, including the definition of PW_KEY_STREAM_DONT_REMIX.
2025-04-07 17:28:15 +00:00
Robert Mader
0d356f90ed monitor-utils: Support devices without any device ids
Such as libcameras virtual devices.
2025-04-07 17:04:22 +00:00
Andrew Sayers
1eed9669f1
Avoid spurious warnings when dbus.service stops
wireplumber.service generates the following when dbus.service
stops before it (e.g. when the user logs out):

    m-dbus-connection: <WpDBusConnection:0x556b3c561680> DBus connection closed: Underlying GIOStream returned 0 bytes on an async read
    m-dbus-connection: <WpDBusConnection:0x556b3c561680> Trying to reconnect after core sync

Stop the service before dbus.service exits, to avoid these messages.
2025-04-03 15:38:08 +01:00
Julian Bouzas
ce4f9b08a9 proc-utils: Make sure cgroup length is valid before removing EOF char
This fixes a Coverity Scan defect.
2025-03-05 13:36:04 -05:00
George Kiagiadakis
0f3e005a92 gitlab-ci: update fedora and alpine images 2025-03-05 19:05:12 +02:00
George Kiagiadakis
ff692952c4 docs: software_dsp: fix example config snippet
The wireplumber.profiles section is an object, not an array
2025-03-05 17:50:43 +02:00
Julian Bouzas
0b716118c7 scripts: Add audio-group-utils.lua to group audio streams
This allows grouping audio streams that have a pw-audio-namespace ancestor
process name. The grouping is done by creating a loopback filter for each group
or namespace. Those loopback filters are then linked in between the actual
stream and device nodes. A '--target-object' flag is also supported in the
ancestor process name to define a target for the loopback stream node.
2025-03-05 16:28:34 +02:00
Julian Bouzas
86cdfaccc4 lib: Add new proc-utils API for process utilities 2025-03-05 16:28:34 +02:00
Pauli Virtanen
78f1e34029 autoswitch-bluetooth-profile: use s-device log topic 2025-03-02 15:09:53 +02:00
Hugo
d222b957af Improve documentation for lua scripts
I had a hard time figuring out all the steps relevant for this to work.
Hopefully this brief summary and couple of links will help the next
person writing their own script.

See: #601
2025-02-24 06:48:40 +00:00
Andrew Sayers
eec702e4a1
Use wp_info() on normal termination
The service is normally stopped by SIGTERM.  Using wp_info() here
means users will be more likely to notice abnormal exits.
2025-02-21 13:03:11 +00:00
Andrew Sayers
07e8248928
Use wp_info() for "Loading profile" message
This is an ordinary progress message - nothing for the user to do about it.
2025-02-21 13:03:09 +00:00
Andrew Sayers
d91c366c2f
Change the new "skipping device" warning to debug
The other "skipping device" (a few lines later) uses log:debug,
so it makes sense for these to be the same.
2025-02-21 13:03:03 +00:00
Barnabás Pőcze
5846d12ea1 wpctl: fix types in variadic arguments
`wp_object_manager_add_interest()` passes the format string
and the arguments after that to `g_variant_new()`, which
requires a 32-bit integer for "u". Passing a 64-bit integer
will cause problems on certain ABIs.

Furthermore, remove the metadata related interest declaration
from `set_default_prepare()` since the "set-default" command
does not access metadata directly, it uses the "default-nodes-api"
plugin.

Fixes: 7784cfad92 ("wpctl: support @DEFAULT_{AUDIO,VIDEO}_{SINK,SOURCE}@ as ID ")
Fixes #773
2025-02-19 18:49:07 +01:00
Barnabás Pőcze
f3bc7168ed wpctl: fix default device name leak
The `get-default-configured-node-name` handler returns a copy
of the name of the node, hence it must be freed.
2025-02-19 18:35:42 +01:00
George Kiagiadakis
32d2abdf34 internal-comp-loader: generate a "provides" for components that don't have one
It is valid for components not to have a "provides" field, but it
prevents them from being able to have "before" and "after" dependencies.
With this patch, we generate a hidden "provides" field so that the
dependencies sorting algorithm can work without issues.

Fixes: #771
2025-02-13 16:06:29 +02:00
George Kiagiadakis
ac69acb3c2 0.5.8 2025-02-07 17:42:58 +02:00
George Kiagiadakis
b031d3fcd1 scripts: populate session.services via a script
See pipewire!1409 / wireplumber!441
2025-02-07 11:05:44 +00:00
George Kiagiadakis
b697546476 lua: bind wp_core_update_properties() 2025-02-07 11:05:44 +00:00
George Kiagiadakis
b8f0cf3644 monitors/bluez: make the source loopback node appear as non-virtual
Fixes: #729
2025-02-07 12:54:43 +02:00
George Kiagiadakis
14cbddd007 tests/scripts: fix tests to respect "object.serial" vs "node.id" differences
Fixes: #761
2025-02-07 08:54:05 +02:00
Twlvnn Kraftwerk
48a415bc8f Update Bulgarian translation
Based of on https://l10n.gnome.org/vertimus/WirePlumber/master/po/bg/

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2025-02-05 12:09:53 +01:00
luzpaz
cb770c1d7e docs: fix various codebase typos Found via codespell -q 3 -S "*.po,./po/*,NEWS.rst" -L bootup,gir,inout 2025-01-28 15:45:54 +01:00
Pauli Virtanen
899943bfcf monitors: disable stream-restore for device loopback nodes
stream-restore should not be touching node properties of the Bluetooth
mic / device set / offload / ALSA UCM split loopback nodes. Those are
controlled by Route settings on the device.

Set device.routes and state.restore-props=false as appropriate to avoid
that.
2025-01-26 21:33:22 +02:00
George Kiagiadakis
a1bc3d9285 lua: fix wp_lua_log_topic_copy() to copy the topic name correctly
Fixes: #757
2025-01-08 11:35:57 +02:00
Pauli Virtanen
4d02d0275f monitors/alsa: provide splitting of UCM SplitPCM nodes
Instruct ACP to provide information about UCM SplitPCM channel
splitting instead of doing it with alsa-lib plugins.

Use the provided information to load loopbacks that create virtual sinks
that do the channel remapping from UCM.
2024-12-23 11:42:23 +02:00
Pauli Virtanen
83e93876d5 lib: spa-device: fix POD props iteration + key lifetimes
Fix memory leaks in bad GValue handling.  Unset iterator GValue after
use and strdup keys.  The keys aren't necessarily static strings (for
id-XXXX properties), so have to be dup'd.
2024-12-20 19:44:36 +02:00
Pauli Virtanen
027aba7f3b monitors/bluez: rename api.bluez5.id -> spa.object.id
Use same name as in alsa monitor.
2024-12-19 18:45:16 +02:00
Pauli Virtanen
ada687a4cc monitors/alsa: decouple name deduplication from node objects
Node name deduplication relying on presence of node objects creates race
conditions, as the name cannot be marked unused if the node object was
not created or was destroyed.

Use separate (device_id, node_id) -> name table to track name ownership
separately from the existence of node objects.

Also clear up the reserved names when device is destroyed, by the
monitor or device reservation.  In these cases "object-removed" for
nodes is not called, so this fixes names leaking when e.g. pw-reserve is
used.
2024-12-19 18:41:01 +02:00
Pauli Virtanen
65989e7e38 monitors: use WpSpaDevice:set_managed_pending()
In cases where a Node is created asynchronously and associated with the
Device later, set the id pending so that we don't miss ObjectConfig
events.

The "set Route again" workaround is also not needed, moreover it was not
reliable before either since the Device might issue ObjectConfig only
for changed properties.
2024-12-15 20:51:55 +02:00
Pauli Virtanen
2df5d94697 m-lua-scripting: add WpSpaDevice:set_managed_pending 2024-12-15 20:51:55 +02:00
Pauli Virtanen
22ab3c938f lib: spa-device: add wp_spa_device_set_managed_pending()
Allow marking WpSpaDevice object ids "pending", which means Props from
any ObjectConfig events received for the ids are saved, if there is no
associated object set yet.

When wp_spa_device_store_managed_object() is called, any pending Props
are set on the managed object.

This is useful when nodes cannot be immediately created in the
"create-object" signal handler. For example, in cases where the nodes
are created asynchronously, e.g.  by "module-loopback".  In this case,
although the nodes can be later associated with the WpSpaDevice, any
ObjectConfig events received in the meantime are lost, so for example
restoring saved Routes will race against async node creation.  Using
wp_spa_device_set_managed_pending() solves this race condition.
2024-12-15 20:51:55 +02:00
Quentin
2bfc464444 Update Occitan locale 2024-12-10 17:18:41 +00:00
Pauli Virtanen
4c1a6f5840 monitors/bluez: recreate SCO source when loopback is emitted
If loopback is emitted after the SCO node, e.g. when A2DP profile
connects late, recreate the SCO node.

This ensures the underlying SCO node is hidden when the loopback is
present.
2024-12-09 20:28:53 +02:00
George Kiagiadakis
3e7c87a84c 0.5.7 2024-12-02 16:10:17 +02:00
George Kiagiadakis
4c07fd1da1 device: find-preferred-profile: define device_name variable
Fixes: #751
2024-12-02 12:18:42 +02:00
George Kiagiadakis
e76ebde6d8 conf.d.examples: improve alsa.conf
Completely remove references to auto-profile/auto-port.
It's better if users are not tempted to enable them.
2024-11-28 16:04:55 +02:00
George Kiagiadakis
f79d4b1b3b monitors: alsa: disable api.acp.auto-profile by default
This seems to be an omission from when we transferred the default device
properties from the config file on to the Lua script. Both auto-profile
and auto-port are meant to be disabled, so that we can apply our own
management logic.

Fixes: #734
2024-11-28 16:02:57 +02:00