Commit graph

7979 commits

Author SHA1 Message Date
Wim Taymans
7303a55b50 treewide: replace EBADFD with posix EBADF
EBADF was used in some places already, some other places used EBADFD
(with and without an #ifdef). EBADFD is linux specific.
2026-05-27 13:36:39 +02:00
Siva Mahadevan
db8bb8d489 pipewire: use EBADF in pw_load_spa_handle
This is defined in POSIX and is more portable
than the linux-specific EBADFD.
2026-05-26 12:07:33 -04:00
Wim Taymans
f195140702 conf: recurse into arrays before matching
When the value looks like an array, recurse into it and do the matching
on the array items instead of the whole value.
2026-05-26 17:08:35 +02:00
Wim Taymans
784a9dd00f pulse: do all delay calculations when we need it
Just store the values for calculating the delay in the hot path. Then
compute the delay only when we need it.
2026-05-26 14:50:47 +02:00
Wim Taymans
3a9dbc6d99 pulse: add some SPA_LIKELY 2026-05-26 14:50:15 +02:00
Wim Taymans
753ed37ec5 pulse: inline the message check
Inline the resize check and then call the resize function when
necessary.
2026-05-26 14:48:47 +02:00
Torkel Niklasson
1066ec98a8 protocol-native: expose client supplementary GIDs
Retrieve the connecting client's supplementary group list via
SO_PEERGROUPS and store it as the "pipewire.sec.gids" property.
This allows access-control policies in wireplumber to match on
all groups and not just the primary.
2026-05-25 17:08:34 +00:00
Wim Taymans
4bde2415f9 scheduler: make active nodes go to IDLE
When a node is configured and supposed to be IDLE, set it to the IDLE
state, it does not matter if it is active or not.
2026-05-25 18:40:52 +02:00
Wim Taymans
63d824d35e scheduler: don't use & when && is wanted 2026-05-25 18:35:11 +02:00
Wim Taymans
22536600b8 pulse-server: use the new in-follow passive mode
A passive port is not automatically activated anymore by an active peer
node, it now needs the "follow" mode to follow the state of the peer without
activating it.
2026-05-25 18:19:12 +02:00
Wim Taymans
63eb53c1cb pulse-server: always set stream.capture.sink for monitor
Also set the stream.capture.sink when we find the sink by index, not
just by name when it ends with .monitor.
2026-05-25 18:17:51 +02:00
Wim Taymans
e0d7b37826 pulse-server: keep track of dont_inhibit_auto_suspend
Keep the flag dont_inhibit_auto_suspend around and use it do decide when
to send suspend messages to the client.

We don't always want to send suspend messages when the stream state changes
because that could happen because the stream was, for example, relinked.

The intention of the suspend message is mostly for monitor streams that
use the dont-inhibit flag and want to follow the suspend state of the
sink.

See #5273
2026-05-25 18:16:19 +02:00
Wim Taymans
3b3b896b4f impl-port: remove unused count variable 2026-05-25 13:59:00 +02:00
Wim Taymans
12ca6f16d2 impl-node: use port_update_state() in suspend_node
Instead of just setting the port state directly, go through the
port_update_state() function. This will make suspend_node() also
emit the port state change event to the links. This then causes
the link to reset to INIT, which cancels pending complete_ready work
items and prevents them from changing the port to READY without a
valid format.

One possible situation where this could happen is when a suspend
happens while the port was waiting for a set_param(Format) reply from
the client-node.

See #3547
2026-05-25 13:22:38 +02:00
Nils Tonnaett
c732df412c module-avb: add documentation to strings.c 2026-05-25 07:55:01 +00:00
Nils Tonnaett
4831ba60af module-avb: don't encode error as state 2026-05-25 07:55:01 +00:00
Nils Tonnaett
2dd60fdbc6 module-avb: fix types 2026-05-25 07:55:01 +00:00
Nils Tonnaett
3bde62bc1d module-avb: build strings.c 2026-05-25 07:55:01 +00:00
Nils Tonnaett
c9ba3ced91 module-avb: format strings.c 2026-05-25 07:55:01 +00:00
Nils Tonnaett
ef77d995cd module-avb: SET_NAME: check that string is valid utf8 and zero padded 2026-05-25 07:55:01 +00:00
Nils Tonnaett
14b1c4d3dd module-avb: add zero padding check function 2026-05-25 07:55:01 +00:00
Nils Tonnaett
b47c07b9cd module-avb: add UTF-8 validation function 2026-05-25 07:55:01 +00:00
Wim Taymans
fdb08f3c60 pw-cat: send midi as-is by default
Don't try to convert midi and ump by default.
2026-05-21 17:13:42 +02:00
Wim Taymans
2ee3d3e16b midifile: correctly write sysex chunks
In midifile we can write sysex continuation chunks starting with
0xf7 but we should not write the trailing 0xf0 byte, if any.
2026-05-21 16:47:22 +02:00
Wim Taymans
981613075f tools: pass maxsize to the fill function
Pass the max size of the buffer to the fill function.

Use this for writing midi events in the buffer. We can use the total
buffer size for midi events.

The n_frames is to limit the amount of midi events *in time*, not in
bytes.
2026-05-21 16:44:29 +02:00
Wim Taymans
a3bea5d586 impl-port: warn when loading a mixer fails 2026-05-21 16:43:38 +02:00
Wim Taymans
0fcaf1ccb2 conf: set the default mixer path correctly 2026-05-21 16:41:37 +02:00
Wim Taymans
7614a2a5d6 midifile: fix header writes on close
When writing a midifile, update the pos with each write so that the seek
back to 0 when updating the headers actually does something.
2026-05-21 14:04:19 +02:00
Wim Taymans
87a2ae2f15 pw-cat: split SysEx over multiple packets
Use the same method as RTP Midi to split long SysEx messages into chunks
that we can then put into buffers and reassemble again later.
2026-05-21 12:11:59 +02:00
Wim Taymans
4e389940e8 midifile: correctly write SysEx events
We need to place the sysex length in the message as well.
2026-05-21 12:11:59 +02:00
Wim Taymans
753ce79c18 rtp: fix compilation 2026-05-20 09:09:38 +02:00
Wim Taymans
d56d5fa87a raop: implement retransmission
Keep the last relation between the sequence number and the timestamp
(ringbuffer position).

When a retransmission is requested for a given sequence number use the
relation to calculate the corresponding timestamp and retransmit the
packet from the ringbuffer again.

See #5276
2026-05-19 17:40:07 +02:00
Wim Taymans
a6fe6196d5 modules: remove redundant close
The close in the error path will never be called because the fd has been
stolen and will be -1.

Also make sure that when we free the source that we set it to NULL or
else the destroy function will try to free it again.
2026-05-18 16:58:20 +02:00
Wim Taymans
250260e18e modules: avoid double close when loop_add_io fails 2026-05-15 13:38:32 +02:00
Wim Taymans
894e97aaa5 modules: avoid double fd close
Now that loop_add_io, avoid double free on failures. Try to use
spa_autoclose and spa_steal_fd to make the error paths easier.
2026-05-15 13:34:48 +02:00
Wim Taymans
398f74571b module: check packet size for CK messages
Check that the CK packet is large enough before we start reading its
contents.
2026-05-15 10:45:14 +02:00
Wim Taymans
f3fc645496 connection: return error if too many fds in message
Check that the number of fds in the message doesn't exceed our max or
else we might overflow the fd buffer a little later.
2026-05-14 16:32:58 +02:00
Wim Taymans
79b4aba6cc pulse: also handle potential overflow in ROUND_UP 2026-05-14 16:27:20 +02:00
Wim Taymans
af151b088d pw-dump: also dump client permissions 2026-05-14 15:05:08 +02:00
Wim Taymans
98fdedf348 filter-graph: relax LADSPA plugin loading
Make a new library.filter-path for the filter-graph that will filter and
restrict the dlopen filenames (used for the LADSPA plugin only).

By default this is false and so filter-chain can load from absolute
paths without extra checks.

Enable the extra checks for the pulse LADSPA modules and the
audioconvert filter graphs because these allow loading LADSPA plugins
into other processes.

Fixes #5222
2026-05-14 13:23:19 +02:00
Wim Taymans
4f975d0071 treewide: add error checking to spa_json_builder_close
There could have been a write error or allocation error while building
the json file that we can detect in spa_json_builder_close().

Error out instead of silently using a truncated JSON.

Use spa_autofree for the memory to make cleanup easier.
2026-05-13 18:14:44 +02:00
Wim Taymans
6d1c242433 pulse-server: implement more valid_args on modules
If the valid_args is NULL, reject all arguments.
2026-05-13 16:53:40 +02:00
Wim Taymans
5fa87d67a1 protocol-native: unref resource after logging the error 2026-05-13 11:12:17 +02:00
Wim Taymans
b53ec3bceb impl-metadata: check PW_PERM_M permission on subject
To set a metadata on a subject, the subject must be visible (R) and we
must have the M permission on the subject.
2026-05-13 11:08:37 +02:00
Wim Taymans
a74109eef3 settings: clamp the clock rate to avoid 0 division
Setting the rate to 0 could in some cases result in a division by zero,
avoid that by clamping to a min value.
2026-05-13 10:47:52 +02:00
Wim Taymans
e5ff44910e pulse-server: improve module argument checking
Make the module valid_args a structure that includes the argument key,
description and some flags. Use this to enforce mandatory properties
in a more central place.

We should be able to generate the module usage from this as wel later to
have things a bit more structured.
2026-05-13 10:23:47 +02:00
Wim Taymans
b54bac1862 modules: make and use pw_net_is_multicast 2026-05-12 13:02:21 +02:00
Wim Taymans
6d998a9193 modules: use pw_net_get_ip
Make pw_net_get_ip also accept NULL ip to just get the port and ip
version. Make rtsp-client use pw_net_get_ip.

Make sure we initialize the iovec before logging in all cases.
2026-05-12 12:52:03 +02:00
Wim Taymans
8860dc809d pulse-server: use pw_net_get_ip instead of inet_ntop 2026-05-12 12:14:52 +02:00
Wim Taymans
62846acb3f modules: use pw_net_get_ip 2026-05-12 09:29:19 +02:00