Commit graph

3289 commits

Author SHA1 Message Date
Wim Taymans
4d684a6384 raop: fix byte array initialization
Initialize the byte array with bytes instead of a string because the 0
byte at the end of the string does not fit in the array and causes a
compiler warning.
2025-07-22 16:09:06 +02:00
Wim Taymans
d23b479aaf client-node: close SyncObj fd as well
We also need to close the SynObj fd we got, just like we close any
DmaBuf or MemFd.

Make sure we get a compiler error when we add more items to the
data type enumeration later.

Fixes #4807
2025-07-22 16:09:06 +02:00
Wim Taymans
f97e131d96 netjack2: fix the large midi events offset
The midi events have their large data offsets relative to the start of
the buffer and the large data is at the end of the buffer. Because we
copied it down, right after the events, but we didn't adjust the
offsets, calculate a correction offset when unpacking the events.
2025-04-14 12:44:10 +02:00
Wim Taymans
d375b374f7 netjack2: set correct max midi buffer size
It depends on the negotiated period size, not the graph quantum.
2025-04-14 12:41:11 +02:00
Wim Taymans
86a492cf98 netjack2: copy large midi events to the end of the buffer
There is no need to keep an extra free byte at the end and it will cause
us to lose a byte when we copy the large midi events down.
2025-04-14 12:40:32 +02:00
Wim Taymans
0e7f39a3d3 rtp-sdp: format ptime in the C locale
Don't place locale dependent strings in the SDP.

Fixes #4615
2025-04-14 12:33:27 +02:00
Wim Taymans
b5a9974795 module-rtp: don't confuse time and samples
Round down the target_buffer size to a psamples multiple. Don't try to
mix time and sample units for this.

Fixes #4327
2025-02-17 15:55:32 +01:00
Wim Taymans
6cffc887c3 rtp-source: avoid bitfield races
The different bits are written to from different threads.
2025-01-23 10:42:15 +01:00
Wim Taymans
09a2b32d1e pulse-server: clear old data when jumping forwards
When we write samples, check if we make a jump in the ringbuffer and
clear the samples we jumped over.

If we don't do this, the reader side might pick up old samples that we
didn't write or clear but that are now available for reading after we
made a jump in the ringbuffer.

This migh not be exactly what pulseaudio does but it is good for now.

Fixes #4464
2025-01-23 10:40:58 +01:00
Wim Taymans
2c3075f430 pulse-server: make a function to silence a buffer 2025-01-23 10:40:49 +01:00
Wim Taymans
fc3fb470f7 network-utils: handle inet_ntop errors 2025-01-23 10:39:00 +01:00
Wim Taymans
b8d89f5a2e pulse-server: increase max rate to 768000
Fixes #4482
2025-01-23 10:37:49 +01:00
Wim Taymans
8d9269374d filter-chain: handle 0 length IR
Make sure we copy the DSP functions in the convolver before leaving the
function because we need them to clear memory.

Don't store the DSP functions in the head and tail convolvers but pass
them from the main convolver because the convolvers might be NULL but we
still need the DSP functions to clear memory.

Fixes #4433
2024-12-03 15:43:56 +01:00
Wim Taymans
8bfdd3c24a pass the right types to the methods
This currently works because we accept void* for these functions but it
will fail when we will use the real types.
2024-11-26 10:00:07 +01:00
Pauli Virtanen
48ad0861e4 pulse-server: ensure positive stream delay in GET_PLAYBACK/RECORD_LATENCY
Pulseaudio protocol requires stream latency is uint64. Clamp the
Pipewire signed latency to the range, better than wrapping around.
2024-11-26 09:59:53 +01:00
Wim Taymans
5a492c2265 module-eq: format floats as JSON floats
Don't use %f to serialize floats to JSON but use the json formatter
because in some locales, the decimal point becomes a , which does not
parse as a float anymore.

Also reformat some lines.

Fixes #4418
2024-11-26 09:40:03 +01:00
Wim Taymans
d2857c2129 module-rtp: allocate receive buffer based on MTU
Use the MTU to allocate the receive buffer instead of using a hardcoded
size.

Fixes #4394
2024-11-18 11:11:14 +01:00
Wim Taymans
ba7a8664a1 module-rtp: calculate payload_size based on MTU
The actual payload size depends on the MTU but should not include the
IP/UDP and RTP headers.

Fixes #4396
2024-11-18 11:10:18 +01:00
Wim Taymans
bfbf38d5f7 impl-node: save all previous timestamps on start
When the driver starts, save all previous node timestamps, not just the
previous signal time.

For async nodes, uses the previous timestamps in the profiler messages
so that we get stats with 1 cycle of delay instead of bogus values
because the node is still processing.

Fixes pw-top for async nodes.
2024-11-18 10:56:58 +01:00
Wim Taymans
3a167d4be1 filter-chain: pass dict in plugin load function
So that we can pass some more properties around and remove the
quantum_limit hardcoded value.
2024-11-08 13:10:35 +01:00
George Kiagiadakis
270669be0d filter-chain: move dsp_ops pointers to dynamically allocated memory
Make a plugin structure that is dynamically allocated for each plugin
and pass it around to the descriptor instance structures, so that they
all have access to dsp_ops without sharing a static pointer.

The problem with the static pointer is that the dsp_ops structure is
actually allocated in module-filter-chain's instance structure,
so it always points to the instance of the last filter-chain that was
loaded in the process. When this is unloaded, the other filter-chains
crash.
2024-11-08 13:09:14 +01:00
Wim Taymans
af69f15dc2 modules: add ratelimit to xrun warnings in jack-tunnel
Take the current cycle times early and in all cases. We can use this to
get the current frame time for debugging purposes instead of the more
heavy jack_frame_time().

Rate limit the xrun warnings.
2024-11-06 12:26:40 +01:00
Niklas Carlsson
cbbc9a718e filter-chain: fix unmap indexing for LV2 plugins
The index returned to the LV2 plugin starts from 1, but the array
index starts from 0.
2024-11-06 10:59:14 +01:00
Pauli Virtanen
926d567c4c pulse-server: more specific error message when too many connections
This appears to be encountered often enough so a clearer message is
maybe useful.
2024-11-06 10:58:47 +01:00
Wim Taymans
9697b67802 filter-chain: first create instances and then link port
First make instances of all the plugins and then try to link them up.

Otherwise, depending on the order the plugins are defined in the config,
a link will try to create port data and set it on the instance, which is
still NULL and we crash.
2024-11-06 10:55:46 +01:00
Wim Taymans
b38ef63028 client-node: don't send mix_info to destroyed ports 2024-10-22 15:46:42 +02:00
Wim Taymans
868ac6f9df filter-chain: initialize NULL data for each node 2024-10-21 10:29:38 +02:00
Pauli Virtanen
c63ae35034 doc: in user-facing config examples, indicate which file it goes into
Add suggestions for config fragments in config file examples, as
applicable.

(cherry picked from commit ec5684302c)
2024-10-12 11:36:04 +03:00
Wim Taymans
c95ed37d17 filter-chain: improve sofa plugin debug 2024-10-06 12:43:40 +02:00
Wim Taymans
e82a02bd89 filter-chain: accumulate node param changes
Don't just look at the last set parameter to decide if the node
parameters changed but or all results together.

Fixes #4331
2024-10-06 12:41:37 +02:00
Wim Taymans
05b6ce8e76 module-rt: first join and then free memory
First join the thread and then free the memory or else we might free the
memory while the thread is starting up and we crash.
2024-09-27 09:50:02 +02:00
Wim Taymans
5566e2614b connection: fix fd leaks and confusion
When we receive a message with fds and we are at the end of the
buffer, we will call clear_buffer, which moves the next fds over the
fds of this message before we copy the fds into the message. This
results in the fd being leaked and the message using the fd of the next
message instead.

Avoid this by first copying the fds into the message and then move the
new ones over the old ones.

This fixes some wrong fds being used by clients.
2024-09-27 09:49:56 +02:00
Gleb Popov
bdbf3c563b Use if_indextoname() instead of less portable ioctl(SIOCGIFNAME) 2024-09-25 10:16:16 +02:00
Gleb Popov
49246d44e3 Move the ifr_ifindex FreeBSD definition into a header file to reduce code duplication 2024-09-25 10:16:08 +02:00
Wim Taymans
2113425b8e modules: don't assume network addresses are numeric
There is no reason to disallow hostnames.

Fixes #4292
2024-09-25 10:08:41 +02:00
Arun Raghavan
eb7be3331f module-rtp-sap: Make sure we don't publish a null refclk
If the PTP refclk is not readable, we fallback to the stored ts_refclk,
which might be NULL. Make sure we check for this case.
2024-09-17 11:58:12 +02:00
Wim Taymans
32956efbf7 spa-node: always set clock.quantum-limit property
Set the clock.quantum-limit property on the node also when it was
created without properties.

Fixes clock.quantum-limit on the Midi-Bridge.

See #4005
2024-08-06 17:50:19 +02:00
Wim Taymans
d5298eee2c module-ffado: implement freewheeling
When freewheeling starts, pause the streaming and resume when
freewheeling stops. Also make sure we don't try to do any IO or
timeouts.
2024-08-06 17:49:54 +02:00
Wim Taymans
d6d08997bb module-ffado: separate rt booleans from non-rt 2024-08-06 17:49:47 +02:00
Wim Taymans
dee3fd2037 modules: use the right module name in the docs
Fixes #4172
2024-08-01 12:35:06 +02:00
Wim Taymans
86287760a0 module-ffado: add some docs 2024-08-01 12:34:32 +02:00
Wim Taymans
afc0e6e69d module-ffado: keep the configured rate in sync with params
When we reconfigure rate, make sure we update the EnumFormat and Format
params with the new value.
2024-08-01 12:34:24 +02:00
Wim Taymans
270470987d module-ffado: Improve samplerate and periodsize handling
Only set use the graph rate and duration when the ffado.sample-rate
and ffado.period-size properties are set to 0. Othersize use the
configure values.

Without this patch, it would just ignore the settings and always use the
graph rate.
2024-08-01 12:34:16 +02:00
Wim Taymans
d0d7e87588 modules: fix doc
Fixes #4134
2024-07-29 10:28:36 +02:00
Wim Taymans
77147c9cd7 module-rtp: fix ptime and target_buffer checks
target_buffer is in samples and ptime in msec so we can't really compare
them. Use psamples instead, which is ptime but then as samples.

See #4095
2024-07-29 10:27:02 +02:00
Wim Taymans
ad9dc1ec81 modules: don't unload module on stream error
Unloading the module on stream errors is a bit too much because a
suspend can clear the stream error again (or the error might not be
fatal)

This can happen for example when negotiation fails on some stream ports
(wireplumber tries to link the midi ports to audio ports) and it's
better to not completely fail on that.

Fixes #4121
2024-07-18 14:27:54 +02:00
Daniel Lundqvist
4902646e73 module-jack-tunnel: Properly propagate error from dlopen()
dlopen() does not set errno on failure, rather you're supposed to call
dlerror() to get the latest error. dlerror() return a string so
instead return -ENOENT from weakjack_load_by_path().

Depending on errno weakjack_load() could think it successfully loaded
the library, and later module-jack-tunnel would crash because it call
a NULL function pointer.
2024-07-18 14:27:01 +02:00
Eli Schwartz
3e210e4cf2 meson: fix conflicting use of feature-based dependency lookups
When spa-plugins is enabled, the gio-2.0 global dependency is
overwritten.

When bluez support is enabled, OR when gsettings is enabled, the gio-2.0
dependency is then detected as found. This means that
pipewire-module-protocol-pulse can end up enabling gsettings support
even if it has been forcibly turned off.

Rename the meson variables to ensure they are looked up separately.
2024-07-12 10:28:29 +02:00
Wim Taymans
d55f5ef608 module-raop: remove unused deprecated header 2024-07-12 08:58:43 +02:00
Wim Taymans
beb485799d module-snapcast: don't hardcode the JSON message id
Use a counter to make it increment for each message.
2024-07-12 08:57:43 +02:00