Commit graph

3459 commits

Author SHA1 Message Date
Wim Taymans
ae0dd9195a 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:29:21 +01:00
Robert Mader
2ab11d0f6c filter-chain: Fix build error without FFTW
And some style changes while on it.

Fixes: c67232718 ("filter-chain: move fft mem function to dsp_ops")
2024-11-05 18:25:21 +01:00
Wim Taymans
c672327181 filter-chain: move fft mem function to dsp_ops
So that we can have different versions per FFT.

One possible optimization would be to split the complex number in
separate real and imag arrays. This would speed up the multiply
operations.
2024-11-05 16:12:28 +01:00
Wim Taymans
79baeb8d18 modules: handle stream trigger errors
When we get a process callback from the capture stream but we can't
trigger the playback stream, simply consume the buffers from the capture
stream.

This can happen when the playback stream is not ready yet, for example.
If we don't consume the buffers that are ready, the converter might run
out of buffers and complain.
2024-11-05 15:59:01 +01:00
Niklas Carlsson
08af555e90 filter-chain: use Q value for biquad shelving filters
The current implementation uses the slope variable S to define the
filter slope. Setting S = 1 results in a constant Q value of
sqrt(2)/2, or 0.7071, which is a good default value.

However, calculating alpha from the Q value instead, as done in
RBJ's cookbook [1], the filter shape can be changed which might
be desired for certain applications and provides flexibility.

Since the current implementation always defaulted to using S = 1,
make sure that configurations missing Q uses the same slope value.

[1] = https://www.w3.org/TR/audio-eq-cookbook/
2024-11-04 16:54:55 +00:00
Pauli Virtanen
0d80a13771 modules: support config overrides for access & protocol-native
These modules are loaded in default config, but to configure sockets and
their permissions, the args need to be overridden.
2024-11-04 16:50:30 +00:00
Pauli Virtanen
5e8a7f434b doc: suggest fragment file name in example configs 2024-11-04 16:50:30 +00:00
Niklas Carlsson
18148e7add 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-10-31 13:07:04 +01:00
Pauli Virtanen
8d019c5689 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-10-30 19:55:39 +02:00
Wim Taymans
3f41b93aa5 filter-chain: fix cmuladd
We need to add the result to src and store in dst. Also use the right
len in C fallback.
2024-10-29 11:55:03 +01:00
Wim Taymans
24e1603f81 filter-chain: improve debug
So that it matches the instantiate debug line.
2024-10-24 11:04:15 +02:00
Wim Taymans
42b994204d 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-10-24 10:55:50 +02:00
Wim Taymans
7be69f38d8 filter-chain: keep port data per instance
We can't share the memory between ports of different instances...
2024-10-24 10:47:32 +02:00
Jonas Holmberg
6223715918 module-rtp: Fix rtp timestamps
Because of operator precedence the timestamps where set to 0 if
set_timestamp was 0.
2024-10-23 16:12:55 +02:00
Wim Taymans
9243ed0cbd pulse-server: add condition support in pulse.cmd
So that a config override can disable the execution of the command by
setting the property to false in the pulse.properties config override.

Expose some conf.c method for this purpose.
2024-10-23 09:08:50 +02:00
Wim Taymans
ec972d4fdf modules: support overriding default module arguments
Add support for some modules to use a module.$NAME.args config section
to override the arguments of the module. Update the docs.

Add more conditions to the module loading, use !false to also load the
module when the condition is not set and so that we don't have to
explicitly set each condition to true.

Improve module-profiler example config.
2024-10-22 18:04:42 +02:00
Wim Taymans
4cf4bd210f client-node: don't send mix_info to destroyed ports 2024-10-22 15:55:47 +02:00
Wim Taymans
0dfd6d997f protocol-pulse: implement readiness notification
Write a newline to the fd in the PIPEWIRE_PULSE_NOTIFICATION_FD env
variable when set.

This is to implement readiness notification as suggested in
https://skarnet.org/software/s6/notifywhenup.html

Fixes #4347
2024-10-22 09:50:27 +02:00
Wim Taymans
7af43d87b3 protocol-native: write socket address after adding
Only write the socket address after we managed to add the fd to the main
loop.

Only log a warning when this fails.
2024-10-22 09:33:40 +02:00
Pauli Virtanen
ced57514f4 filter-chain: fix array size for avx
dsp-ops-avx.c:205:18: warning: array subscript 1 is above array bounds of '__m256[1]'
dsp-ops-avx.c:185:37: note: while referencing 't'
2024-10-21 21:11:38 +03:00
Wim Taymans
6a6f455330 filter-chain: include pffft.h when needed 2024-10-21 09:50:57 +02:00
Wim Taymans
dcbdddc07a filter-chain: fix array size 2024-10-19 18:05:50 +02:00
Wim Taymans
7f8ce35709 filter-chain: add support for fftw in the convolver
It's faster than pffft.
2024-10-18 16:26:39 +02:00
Wim Taymans
f810c7c15f filter-chain: add avx mix function 2024-10-18 16:25:14 +02:00
Wim Taymans
8e8b661340 filter-chain: handle more errors in convolver init 2024-10-18 16:23:43 +02:00
Wim Taymans
633e643bfd filter-chain: align the buffer memory to max cpu alignment
So that optimizations can work on aligned memory.
2024-10-18 16:22:40 +02:00
Wim Taymans
fcc2d2f388 filter-chain: avoid a warning for unhandled enum 2024-10-18 09:15:56 +02:00
Wim Taymans
d83bf90a3a filter-chain: support NULL data for the delay filter 2024-10-18 09:15:56 +02:00
Wim Taymans
24d76e73ab filter-chain: add support for time delay in convolver
The convolver will parse integers as a sample delay (as before) but will
now also fall back to parsing it as a float in the time domain.

Specifying the delay in time is better because it does not depend on the
samplerate of the graph or the IR.
2024-10-16 17:14:32 +02:00
Wim Taymans
5e87f1d4f4 filter-chain: optimize delay function 2024-10-16 16:16:03 +02:00
Wim Taymans
d8bd84183d filter-chain: optimize the identity biquad
Store the biquad type in the biquad, remove some unused fields.

Init all the biquads with the identify before loading the channel
specific biquads. We will process the max of all the channel biquads.
Make sure we skip processing for the indentity ones.
2024-10-16 12:33:35 +02:00
Wim Taymans
3c221f49a0 filter-chain: bypass convolver when NULL input/output 2024-10-16 12:32:53 +02:00
Wim Taymans
e281628847 filter-chain: initialize NULL data for each node 2024-10-16 12:31:36 +02:00
Wim Taymans
668055e612 filter-chain: optimize biquads some more
Add 4 channel SSE function.
2024-10-14 18:08:38 +02:00
Wim Taymans
b30ff4eca3 filter-chain: improve output data
When we allocate data on an output port, always set it immediately on
the plugin. We let output nodes allocate data and input ports consume
it.

When we have no data on an output port, use discard data or NULL.

This ensure that the ports only have data when they are used by an input
port and otherwise use discards or NULL data.
2024-10-14 16:41:14 +02:00
Wim Taymans
a589bfc277 ifilter-chain: improve biquad debug 2024-10-14 16:28:41 +02:00
Wim Taymans
4c43ec7cef filter-chain: add multichannel support to param_eq
Add 8 input and output ports and make it possible to configure filters
per channel. We can optimize the SSE code to run 2 filters at the same
time.
2024-10-14 16:00:18 +02:00
Wim Taymans
b3d9b4bb9e filter-chain: fix max biquad check 2024-10-14 09:44:54 +02:00
Wim Taymans
46e58ee2a8 modules: include limits.h to define PATH_MAX
hopefully fixes the build
2024-10-11 17:53:06 +02:00
Wim Taymans
ac21541741 filter-chain: optimize biquads a little
Add sse optimized biquads.

Make a new dsp function to run multiple biquads on multiple channels.
This makes it possible to unroll some operations and run the channels
in parallel later.
2024-10-11 17:49:34 +02:00
Wim Taymans
673352893a modules: port parametric-equalizer to filter-chain
Simply load a filter-chain with the new param_eq node and the
given filename in the config.

This fixes a number of issues such as not copying global properties to the
streams, setting a unique node.name etc...
2024-10-11 11:26:27 +02:00
Wim Taymans
ab20cc5f28 filter-chain: add parametric EQ builtin plugin
add param_eq which can take an EQ file or a config list of biquad
filters. It is potentially more efficient to run this than a chain
of biquads.
2024-10-10 18:58:32 +02:00
Wim Taymans
ddbe135a3b 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.
2024-10-10 11:27:25 +02:00
Lương Việt Hoàng
f65bd482bd parametric-equalizer: wrap EQ file in a code block
In the docs, it looks like a paragraph without line breaks.
2024-10-09 21:38:24 +07:00
Lương Việt Hoàng
c3660d853c parametric-equalizer: add capture.props and playback.props
They first get merged with default values, but are otherwise similar to
those in filter-chain.
2024-10-09 21:38:24 +07:00
dpayne
d6a99db203 Only sending feedback timer with CRYPTO_AUTH_SETUP for airplay 2024-10-09 13:09:55 +00:00
Wim Taymans
fa1ec61cf0 profiler: add followerClock block
Add a new followerClock block in the profiler info. This is only set
when the follower could be a driver and it contains the clock info used
for following the driver, mostly the rate difference and delay.

Dump this info in pw-profiler -J

Make sure we always set the info in the clock, especially also when we
are following.
2024-10-09 11:31:54 +02:00
Wim Taymans
1bb099e8bc filter-chain: fix typo
Spotted by ludolpif ludolpif

Fixes #4340
2024-10-08 10:31:29 +02:00
Wim Taymans
d47f8bf136 spa-node: remove broken setup_props
It's broken because it only iterates one Props property and most nodes
have an adapter, and so two sets of Props.

The node.param.Props = { } property is a better way of doing things
these days.
2024-10-08 10:13:35 +02:00
Wim Taymans
81a2a7087b filter-chain: improve sofa plugin debug 2024-10-02 09:52:13 +02:00