Commit graph

14676 commits

Author SHA1 Message Date
Wim Taymans
f4a6648aa5 filter-graph: emit control change after loading
Always do a control change to the instances when they are created. This
is to make sure the internal state is synced to the control values.

The sofa filter and biquads need this to correctly configure themselves
after a suspend.

Fixes #5152
2026-03-11 12:46:17 +01:00
Wim Taymans
cb9b3861ce audiomixer: only add the input port to mix_list
Adding the output port is not a problem because there is never a buffer
to consume and mix but it wastes cycles.
2026-03-11 12:46:12 +01:00
Barnabás Pőcze
17f423b8f6 spa: libcamera: source: SPA_PARAM_Props is write-only
There are no readable `SPA_PARAM_Props` on the node, so mark it write-only.

(cherry picked from commit 810617997b)
2026-03-10 23:50:37 +01:00
Wim Taymans
55f6c35e78 client-node: avoid using invalid fd or mem in clear_data
Don't close an -1 fd in clear_data.

If we let the client allocate buffer, set our fd and data to invalid
values. If the client decides to renegotiate before we get the buffer
data we might otherwise try to clear the mem_id (default 0) or
close the fd (also default 0).

Fixes #5162
2026-03-10 17:58:07 +01:00
Jonas Ådahl
3a62ea0217 pipewire/capabilities: Update device ID negotation according to API docs
It was was documenting a previous iteration of the protocol which used a
boolean and a base64 encoded list.
2026-03-10 17:54:10 +01:00
Jonas Ådahl
f26eb9501e docs/dma-buf: Document the correct device ID negotation key
The correct key is PW_CAPABILITY_DEVICE_ID_NEGOTIATION which contains a
number.
2026-03-10 17:54:01 +01:00
Ripley Tom
92f8e16f11
meson.build: Add -Werror=discarded-qualifiers
(cherry picked from commit ff04b47942)
2026-03-10 00:03:33 +00:00
Barnabás Pőcze
c3d7373cf9
treewide: fix some -Wdiscarded-qualifiers
Newer glibc versions have made certain `str*()` functions into macros
that ensure that the const-ness of the argument is propagated to the
return type.

(cherry picked from commit e46bfe67b6)
2026-03-10 00:03:14 +00:00
Wim Taymans
4c2692342e impl-link: fix shared mem test
We can only use non-shared memory when both nodes live in the same
process _and_ we can be sure the output port is never going to be linked
to a remote node because it is exclusive.

This fixes the case where a null-sink is loaded inside the process space
of the server and linked to the ALSA sink. This would create a link
without shared mem and then as soon as something else (out of process)
wants to link to the null-sink output, it would get a -22 EINVAL
negotiation error because the memory can't be shared.

Fixes #5159
2026-03-09 16:28:21 +01:00
Wim Taymans
299902bd86 v4l2: use 0x as the prefix for hex values
fixes #5161
2026-03-09 16:28:15 +01:00
qaqland
d99a932b9c alsa-udev: support alsa.ignore-dB
Some sound cards are only adapted for Android/macOS and other
systems, without considering Linux. The hardware-reported dB
volume is incorrect (while the percentage volume is normal).
Add support for the ignore-dB option to simplify compatibility.

For example, the 3206:0798 HP SIMGOT GEW1 Sound Card reports:

numid=4,iface=MIXER,name='PCM Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=100,step=0
  : values=100,100
  | dBminmax-min=0.00dB,max=0.39dB

This dB value does not match actual audio perception, and the
vendor attributed this issue to non-target system compatibility.
2026-03-09 16:26:54 +01:00
Wim Taymans
b7341d0689 1.6.1 2026-03-09 10:17:11 +01:00
Wim Taymans
5f77a7ae2b pw-cat: fix encoded format playback
We keep a mapping between the sndfile formats and the format we would
like to decode them to for encoded formats. Make sure we don't mix up
the sample widths between them.

Make sure we don't send encoded formats as raw.

Debug the uncompressed format name correctly.

Fixes #5155
2026-03-06 17:09:28 +01:00
Wim Taymans
d3946c0b10 node: remove node.link-group from drivers
Sink/Source pairs should not have the same link-group otherwise the
session manager will not be able to autoconnect them with a loopback or
some other internally linked stream.
2026-03-06 11:25:24 +01:00
Wim Taymans
8daf4ba6b6 gst: fix compilation on older GStreamer
These functions are since 1.28, which is a little too new.
2026-03-04 17:57:31 +01:00
Robert Mader
86da3e1183 pipewiresrc: Use clock time difference to update last_buffer time
Setting the current clock time when resending buffers is often wrong.
Especially for pseudo-live sources - the default mode - it discards
the original buffer time, which again is used by the base-class to
adjust the timestamps further, ultimately resulting in very wrong
timestamps.

Instead, try to calculate the delta between when we originally got the
buffer and now.

(cherry picked from commit efd1526423)
2026-03-04 13:31:56 +01:00
Robert Mader
e208a465ea pipewiresrc: Take a copy instead of a reference for last_buffer
Buffer timestamps get adjusted by the base class, GstBaseSrc, even if we
take an additional ref. Arguably the base class should check if buffers
are writable (gst_buffer_make_writable()), which would trigger a buffer
copy. That is currently not the case, though, thus do so on our side.

Notes:
1. Usually a buffer copy doesn't copy the underlying memory, i.e.
copying is cheap.
2. The copy holds a reference to the copied buffer, preventing the
buffer from getting recycled as before.

(cherry picked from commit 49300d8ee0)
2026-03-04 13:31:49 +01:00
Wim Taymans
0d14f44f47 jack: never return NULL from jack_port_by_id()
JACK will never return NULL from jack_port_by_id() because the id
and the port_t are the same for JACK.

In PipeWire however we use the serial number as the id and so it can
be removed and become invalid. In this case, return a dummy port
from the client that can be used for some of the basic operations
you can do on a port_t, like get the name etc.

Also make sure that port_name() doesn't return NULL in case we use the
dummy port (which has the client set to NULL).

Fixes #3512
2026-03-03 09:44:39 +01:00
Jonas Holmberg
5cd734e8c0 module-protocol-native: Fix socket activation
Fix path comparison in is_socket_unix() and don't unset LISTEN_FDS since
the function that uses it is called more than once and it was not unset
when sd_listen_fds() was used.

Fixes #5140
2026-03-03 09:44:14 +01:00
Barnabás Pőcze
87d1206fb8 spa: libcamera: source: fix stop sequence
Currently it is possible for the request completion handler (`impl::requestComplete`)
to observe `impl::source.fd` while it is being modified in `impl::stop()`.

Fix that by closing the eventfd after the camera has been stopped.

Fixes: 3e28f3e859 ("spa: libcamera: source: rework startup sequence")
(cherry picked from commit 848ac24490)
2026-02-27 11:39:28 +01:00
Wim Taymans
700cea78db 1.6.0 2026-02-19 09:59:34 +01:00
Misha Baranov
b9922d8ed5 module-roc: forward roc-toolkit logs to pipewire logs
Roc-toolkit log records are captured via a callback and
written to PipeWire log with corresponding verbosity level.
The log.level config parameter limits record verbosity at
the roc-toolkit level.
2026-02-19 08:42:29 +00:00
Damien Espitallier
88cbe24201 alsa-udev: Allow ACTION_REMOVE on ignored cards
Move the card->ignored check to only apply to ACTION_CHANGE, not ACTION_REMOVE. This ensures that ignored cards can still be properly removed when they are unplugged.
2026-02-17 19:19:52 +01:00
Wim Taymans
7956d7ceaf snapcast: support IPv4 link-local addresses 2026-02-17 13:08:56 +01:00
Wim Taymans
0e80287625 RAOP: also support link-local addresses for IPv4
Patch by Lairton Lelis da Fonseca Junior (@lairton)

Remove the hard skip for IPv4 link-local addresses and add an interface
binding (matching the existing IPv6 link-local behavior).

The host needs a link-local address on the interface (ip addr add
169.254.x.x/16 dev wlan0 or via NetworkManager +ipv4.addresses).

Fixes #4830
2026-02-17 13:02:03 +01:00
Wim Taymans
ab70dae0a8 modules: add PRIORITY_SESSION
For driver nodes, priority.session is needed to be able to change the
default device.

Fixes #5125
2026-02-16 10:38:05 +01:00
filmsi
de778e6235 Replace sl.po 2026-02-16 09:01:57 +00:00
Yedaya Katsman
fc723d7b15 pw-mon: Fix help message for --hide-params 2026-02-15 10:18:34 +00:00
Pauli Virtanen
7dd2c60b12 bluez5: synchronize transport state after acquire of an acquired transport
With keepalive enabled, we need to emit state change event on acquire
similarly as we do if refcount was already positive.

Co-authored-by: Martin Geier <martin.geier@streamunlimited.com>
2026-02-14 12:03:07 +02:00
Alexander Sarmanow
63129dd3dc fixup 2026-02-13 17:16:18 +00:00
Alexander Sarmanow
5c9b3ee05a bluez5: bap: use BD address for per-adapter BIG config
HCI indexed names are not stable. The adapters BD address is here a
better approach to map the configuration.
2026-02-13 17:16:18 +00:00
Alexander Sarmanow
5f12dd99a3 bluez5: add adapter reference to remote_endpoint
This should make adapter members easier accessible via remote endpoints.
2026-02-13 17:16:18 +00:00
lumingzh
b0b6f6ca37 update Chinese translation 2026-02-13 09:40:40 +08:00
Jonas Holmberg
ca4fa88598 context: set time in position for drivers
Set time in position for drivers to make sure an old time isn't copied
by followers before the driver is started.
2026-02-12 17:15:33 +01:00
Wim Taymans
7f08c0d404 doc: fix a typo 2026-02-12 13:46:04 +01:00
Wim Taymans
11d5e071ec stream: return -EIO when doing get_time in != STREAMING
The stream should be streaming before the get_time call is meaningful.

Various places in the code already check this an fall back to a default
value, we just need to return an error here.
2026-02-12 12:26:33 +01:00
Pauli Virtanen
12fb9ab831 bluez5: use correct A2DP profile in codec switch
We can only switch within currently connected A2DP profiles, as
generally remote endpoints are available only for the connected ones.
2026-02-11 18:53:32 +02:00
Wim Taymans
47de1e15a4 channelmix: handle more than 64 channels
When setting up the mix matrix, don't just iterate over the first 64
(CHANNEL_BITS) positions because then we will never be able to configure
more than 64 channels in the matrix.

Instead iterate until we have filled all src and dst entries in the
matrix. For the first 64 positions we might need to check the channel
mask to get the right positions in our source matrix.

Fixes the channel mixer for >64 channels where the positions above 64
where 0 in the matrix and muted.

Fixes #5118
2026-02-10 13:34:44 +01:00
Wim Taymans
494d727108 channelmix: improve debug
Instead of printing lines and lines of numbers, format everything as
a matrix. Only do the work when debug is enabled.
2026-02-10 13:18:01 +01:00
Wim Taymans
a2df282086 pw-cat: add a container option and some --list options
Add a container option to override the extension check and force a
container when saving.

Add some more formats that are supported by libsndfile.

Add some options to list all supported formats, extensions/containers,
layouts and channel names.

Fixes #5117
2026-02-09 13:55:52 +01:00
Frédéric Danis
0470f96887 bluez: bap: Select correct settings for select_config()
Depending on the codec kind, select appropriate settings to pass
to select_config().

This allows to pass the bluez5.bap.force-target-latency property,
and so to select the same configuration.
2026-02-09 09:27:10 +00:00
Frédéric Danis
c499255098 bluez5: bap: Add device property to force target latency
Some PTS tests (e.g. BAP/UCL/SCC/BV-046-C or BAP/UCL/SCC/BV-077-C)
requests to select QoS from low-latency or high-reliabilty.

The bluez5.bap.force-target-latency device property allows to force it.
For other values than low-latency or high-reliabilty the QoS selection
will use both tables to find the more appropriate configuration.
2026-02-09 09:27:10 +00:00
Barnabás Pőcze
2770143f50 gst: pool: fix buffer release race condition
A call to `release_buffer()` may happen in a gstreamer thread concurrently
with the pipewire stream emitting the `remove_buffer` event in the thread
loop, which, in pipewiresink calls `gst_pipewire_pool_remove_buffer()`, which
in turn modifies the `GstPipeWirePoolData` object. Thus a data race occurs
when accessing its members, which can lead to `pw_stream_return_buffer()`
being called with a null pointer.

Fix that by locking the thread loop before checking the conditions.

Fixes: c0a6a7ea32 ("gst: handle flush event in pipewiresink")
2026-02-09 09:25:36 +00:00
Stanislav Ruzani
64e0a9cbd9 alsa-pcm: set rate_match rate to 1.0 when not matching
Only set rate_match rate to DLL correction when matching is active.
When ALSA is driver and not matching, set rate to 1.0 to indicate no rate adjustment needed.
DLL still runs for buffer level management but rate_match should not expose correction
when matching is inactive to avoid confusion during debugging.

Signed-off-by: Stanislav Ruzani <stanislav.ruzani@streamunlimited.com>
2026-02-05 10:45:11 +01:00
Carlos Rafael Giani
bac776f8b4 doc: spa: Explain the nsec and next_nsec values in the driver docs better 2026-02-05 10:34:32 +01:00
Pauli Virtanen
84bfbd92a1 bluez5: bap: prefer high-reliability qos for 44.1/48 kHz
On some device combinations (MT7925 / Sony LinkBuds S) the low-latency
48 kHz QoS crackle.

It's probably better to default to high-reliability for those, until we
have proper quality vs. latency configuration in place.
2026-02-03 19:10:25 +02:00
Hugo Osvaldo Barrera
57efceeb02 Implement socket activation without libsystemd
Socket activation uses sd_listen_fds from libsystemd, and can only be
compiled on systems with systemd.

This is an issue for Alpine / postmarketOS, where upstream has no
systemd package, but downstream depends on upstream's pipewire package
and wants to rely on socket activation. This also prevents using
socket-activation on other non-systemd distributions, including
non-Linux.

Implement equivalent functionality without a dependency on libsystemd.
2026-02-03 13:17:59 +01:00
Wim Taymans
2c0988ab4c bluez-dbus: fix adapter memcpy length
sizeof(adapter) is larger than the big_entry->adapter and so the code
would copy too much. Instead only copy the strlen of the parsed
adapter, which we checked above to be smaller than the available size.

This doesn't copy the 0 byte because the memory is assumed to be 0
filled already by the calloc.

If the address is exactly the HCI_DEV_NAME_LEN, it will result in a non-0
terminated string, which may or may not be a problem...
2026-02-03 10:16:22 +01:00
Wim Taymans
ac7728097f snapcast: support newer snapcast service type
Newer snapcast servers publish the service as _snapcast-ctrl._tcp so
listen for that as well.

Fixes #5104
2026-02-03 10:01:38 +01:00
Carlos Rafael Giani
642504f5f9 module-rtp: Compensate for stream resampler effects in RTP sink node 2026-02-03 09:07:48 +01:00