Commit graph

7165 commits

Author SHA1 Message Date
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
1a8a3044fc remove deprecate Props settings, use node.param.Props 2024-10-08 10:27:36 +02:00
Wim Taymans
fcf366ccc2 conf: update some example node configs
Use node.param.Props for the patternType on videotestsr.

Make the audiotestsrc non-live. Otherwise it will be live but not a
driver and fail to schedule things.

See #4341
2024-10-08 10:19:55 +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
Julian van der Horst
d2df250e61 apply force-s16 quirk also to teams-for-linux 2024-10-07 15:54:30 +00:00
Wim Taymans
ffbcf853e6 stream: improve the flush handling and docs
Flush with drain calls the drained callback for each cycle until paused
or resumed. Setting the stream to active again, clears the drained state
and makes things resume.

Flush without drain does not set the state to PAUSED but simply clears
the queued data. This is mostly useful when pausing or stopping.

At no point should the flush operation result in a PAUSED state change.
2024-10-07 17:15:18 +02:00
Wim Taymans
d1efc9c2c6 tools: improve profiler -J output
Put the newline and comma right after printing the line so that it gets
flushed immediately. Otherwise we only see the last line in the next
cycle. We then need to end the JSON output with an empty object.

Pretty print the node status instead of the value.
2024-10-04 10:42:38 +02:00
Wim Taymans
3efa3483db impl-node: pass the RequestProcess command around as is
Convert the RequestProcess event to a command and send this to the
driver node. This ensures that any future properties on the Event will be
passed to the Command as well, such as timestamps etc.

Save the complete RequestProcess command when we need to send it later
when the node is RUNNING so that we preserver the properties.
2024-10-02 16:18:44 +02:00
Wim Taymans
242e530aeb stream: add pw_stream_emit_event()
Make a function to emit an event from a stream. Use this function
internally to emit the RequestProcess.

Make the RequestProcess event construction a little more efficient.
2024-10-02 16:17:17 +02:00
Wim Taymans
c05f03c7da keys: improve comments and indentation 2024-10-02 12:46:39 +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
9b80855821 impl-node: make exported nodes complete state change sync
Don't queue an async state change completion for exported nodes. The
server sends a ping to check for completion and we want this ping reply
to happen after the state completion.

Consider the case where we have a follower and a driver, the follower is
sent the Start/Ping commands and replies to the ping but is still
processing the state change async. The server can then Start the driver,
which will then try to schedule the (still starting) follower and fail.

We could add the ping to the work queue as well but that creates
complications because modules (clients) and server share the same work
queues right now and block each other completions.

We could also make a method to process the work queue immediately but
that would be dangerous as well because it could contain a BUSY item
from some module that would block things.
2024-10-01 10:44:12 +02:00
Wim Taymans
273a2b65a2 examples: improve the ring2 example
Make a function to make a block of samples that we then push into the
ringbuffer. This should match more with what audio backends need to
handle.
2024-09-30 16:14:37 +02:00
Wim Taymans
63747e2e40 examples: add another ringbuffer example
This one use a thread-loop and uses a blocking push into a ringbuffer.
2024-09-30 15:37:38 +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
Jonas Holmberg
648badb427 properties: Fix memory leak
Do not initialize changes in update_string() if
spa_json_begin_object_relax() fails to avoid having to clear changes
before returning.
2024-09-27 11:59:54 +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
e9c5ca5978 video-src: simplify the tag param construction 2024-09-24 11:11:22 +02:00
Wim Taymans
2ab773ce14 stream: emit the Pause command early
Don't wait for the completion of the Pause command of the node but send
it to the stream immediately. Delaying it might make it come after the
set_param calls are done and confuse the stream.
2024-09-24 10:50:14 +02:00
Wim Taymans
7e436ad499 impl-link: also handle unprepared active links
An ACTIVE link going to < PAUSED is unprepared.
2024-09-24 10:46:21 +02:00
Wim Taymans
b5f9409c12 pw-cli: implement unload_module
Fixes #4276
2024-09-23 15:46:33 +02:00
Wim Taymans
e095a1c4ac examples: improve the ringbuffer example a little
Write the remaining samples in the ringbuffer and fill up the rest with
silence.

Add some more comments.
2024-09-23 11:28:16 +02: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
Wim Taymans
4b9db9492e json-pod: add error checking version of json to pod
Add an error checking version of the json to pod converter and use that
in pw-cli to report about json parsing errors.
2024-09-23 10:12:56 +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
Gleb Popov
3f31935cac Include <pthread_np.h> on FreeBSD to access pthread_setaffinity 2024-09-23 08:09:45 +00:00
Wim Taymans
bdd4d3a8fc examples: free the event source 2024-09-20 17:24:00 +02:00
Wim Taymans
e54cd0ef5c examples: add audio source with ringbuffer
Add an example of a stream that plays data from a ringbuffer that is
filled from some other thread.
2024-09-20 17:20:25 +02:00
Wim Taymans
44a1d93b7d stream: improve the docs 2024-09-20 15:52:26 +02:00
Wim Taymans
c07663b236 impl-node: only process RequestProcess after state change
Wait until we are in the RUNNING state before sending
RequestProcess.
2024-09-19 19:12:54 +02:00
Wim Taymans
cd68819feb stream: update state based on node
Follow the state of the node and update the stream state accordingly.

The most important part is that Start is async and so it's better to
wait for completion from the node before emiting the STREAMING state.
2024-09-19 19:12:31 +02:00
Wim Taymans
2301d3000b impl-link: improve debug, add the node async state 2024-09-19 19:01:43 +02: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