Commit graph

3333 commits

Author SHA1 Message Date
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
Torkel Niklasson
75566a238f modules: fix flag setup in combine-stream
When combine-stream initiation code was moved around in b46673b4, a
bitwise or of flags was accidentally dropped, and thus flags were
overwritten instead of added to.
2024-10-02 05:31:58 +00:00
Wim Taymans
2a4840b991 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-01 19:04:02 +02:00
Wim Taymans
9e932ec671 pulse-server: set pulse.corked on streams
Set the corked state on streams so that we can use this in sink-input
and source-output info without guessing.

The problem is that when a stream starts un-corked, the state is less
than RUNNING and so before this patch, pulse-server reports a corked
stream, which is not what pulseaudio reports.
2024-09-30 15:02:08 +02:00
Wim Taymans
404817592b 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
2024-09-30 10:44:51 +02:00
Wim Taymans
18e1da54bd 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-26 16:21:32 +02:00
Wim Taymans
fe3dc58c89 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-26 13:10:15 +02:00
George Kiagiadakis
fbbe983a05 rtp-sap: make the receive socket listen only to the configured sap.ip
In line also with da8e207de9,
make sure that the rtp-sap receive socket listens only to the configured
sap.ip in unicast mode, instead of accepting all packets on the port.

This additionally fixes breakage that was inadvertently introduced in
f2f204d604. Because the
`struct sockaddr_storage *sa` argument in `make_recv_socket` points
to `impl->sap_addr`, changing the address to INADDR_ANY in the unicast
code path would also silently cause the sender socket to try to
connect to INADDR_ANY and fail.
2024-09-25 10:55:28 +00:00
George Kiagiadakis
88dff1c021 rtp-sap: announce the source IP as the "connection" address in unicast
The "connection" address ("c=") is meant to be the address that the
RTP receiver will use to filter for incoming packets. In multicast,
it must be the multicast address, which is also the "destination"
address in this context. In unicast, however, it must be the sender's
address, i.e. the "source" in this context. The RTP receiver will
then call connect() on this address, effectively filtering the incoming
packets to the ones coming from that particular source.
2024-09-25 10:55:28 +00:00
Arun Raghavan
daec898251 profiler: Add an option to reduce sampling interval
Allows us to get error counts and occasional samples, which can be handy
if we are CPU-bound. There is room to improve this by having
module-profiler create aggregates, which might be more useful that
periodic instaneous samples. However, this would need more logic to
store node data in between emissions, so we'll punt that to later.
2024-09-25 10:52:36 +00:00
Wim Taymans
ca488a5dcc pulse-server: add quirk to block record and playback streams
Add aquirk to block any record or playback stream.
2024-09-23 10:56:40 +02:00
Gleb Popov
44d92c21e5 Use if_indextoname() instead of less portable ioctl(SIOCGIFNAME) 2024-09-23 08:09:45 +00:00
Gleb Popov
aafe815556 Move the ifr_ifindex FreeBSD definition into a header file to reduce code duplication 2024-09-23 08:09:45 +00:00
Wim Taymans
d36171f7df modules: don't assume network addresses are numeric
There is no reason to disallow hostnames.

Fixes #4292
2024-09-19 09:38:08 +02:00
Barnabás Pőcze
27b76ae686 pulse-server: calculate event mask from facility and type
Make `client_queue_subscribe_event()` take the facility and type
separately, and calculate the mask itself, so that the caller
does not need to be concerned with that.
2024-09-18 19:35:08 +02:00
Wim Taymans
e3a7035e8f spa: make helper to init spa_audio_info_raw from dict
Make a function that can initialize raw audio info from a dict and fill
in the defaults. We can use this in many of the modules when the audio
format is parsed.
2024-09-18 15:48:27 +02:00
Wim Taymans
e2991f6398 json: add helper function to parse channel positions
Use the helper instead of duplicating the same code.

Also add some helpers to parse a json array of uint32_t

Move some functions to convert between type name and id.
2024-09-18 09:54:34 +02:00
Pauli Virtanen
ec5684302c doc: in user-facing config examples, indicate which file it goes into
Add suggestions for config fragments in config file examples, as
applicable.
2024-09-16 15:51:59 +00:00
Wim Taymans
b5cccdb382 json: add and use spa_json_str_object_find()
Parse a string as a json object and copy the value with key as a string.
2024-09-16 13:12:05 +02:00
Wim Taymans
ce390d5b22 spa: add spa_json_object_next
This gets the next key and value from an object. This function is better
because it will skip key/value pairs that don't fit in the array to hold
the key.

The previous code patter would stop parsing the object as soon as a key
larger than the available space was found.
2024-09-16 09:50:36 +02:00
Wim Taymans
cd81b5f39a spa: add spa_json_begin_array/object and relaxed versions
Add spa_json_begin_array/object to replace
spa_json_init+spa_json_begin_array/object

This function is better because it does not waste a useless spa_json
structure as an iterator. The relaxed versions also error out when the
container is mismatched because parsing a mismatched container is not
going to give any results anyway.
2024-09-16 09:50:33 +02:00
Wim Taymans
feccb882b6 spa: add spa_json_begin
That combines spa_json_init() and spa_json_next, a common thing to do.
2024-09-16 09:50:31 +02:00
Wim Taymans
f7110fbc77 module-raop: add ProcessLatency support
Intercept the Output Latency paran and parse it for later.

Use the computed latency as the ProcessLatency and expose this
as the ProcessLatency param and the updated Input latency.

Accept updates to ProcessLatency to modify the latency, which then also
updates the Input Latency param.

See #4270
2024-09-10 17:29:52 +02:00
Wim Taymans
1e5c86e1dc module-loopback: add ProcessLatency support
Improve the Latency reporting, we always report Input and Output latency
pairs.

Keep ProcessLatency on the capture and playback streams. The capture
stream process latency is reported as input latency and the playback
process latency as output latency.

Setting ProcessLatency on the capture stream (Sink), for example, will
propagate the added latency upstream. This would then instruct players
to send the audio earlier to compensate for the delay.

See #4270
2024-09-10 15:32:00 +02:00
Arun Raghavan
d79b995e51 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-09 14:05:45 -04:00
Wim Taymans
0ecac098c7 modules-netjack2-driver: add source.ip and source.port
Instead of binding the socket to 0.0.0.0 with port 0, make some config
options source.ip and source.port to configure this. This makes it
possible to bind to other interfaces or to use a fixed port for the
data messages.

Fixes #4144
2024-08-29 12:44:53 +02:00
Wim Taymans
5fff2c47a6 modules: improve docs some more for snapcast-discover
Fixes #4243
2024-08-29 10:18:36 +02:00