Commit graph

3459 commits

Author SHA1 Message Date
Diego Viola
7410755c03 Fix typos
found them with codespell.

Signed-off-by: Diego Viola <diego.viola@gmail.com>
2024-05-22 09:19:34 +02:00
Barnabás Pőcze
b3bd026699 pipewire: remove cleanup.h
Since `spa/utils/cleanup.h` is not a private header anymore, there is
no need for a separate `pipewire/cleanup.h` since the definitions of
the cleanup routines can now be moved into the respective headers.
2024-05-16 17:35:58 +02:00
Wim Taymans
d2ca50399a modules: add options to discover local services as well
This makes it possible to discover a local RAOP, pulse or RTP services
and connect to them.

IPv6 addresses need the interface appended to local addresses to
make the connection work.
2024-05-15 15:39:27 +02:00
Wim Taymans
bd4d61c83c raop: use pw_net utils to parse address 2024-05-15 11:26:12 +02:00
Barnabás Pőcze
46e4a33f27 pulse-server: message: use union to store event data
Store subscription event data in a union instead of
just an array for better readability.
2024-05-15 08:31:40 +00:00
Barnabás Pőcze
d467f6fdc6 pulse-server: client_queue_subscribe_event(): check message allocation 2024-05-15 08:31:40 +00:00
Wim Taymans
78fbe6f750 protocol-simple: add per stream properties and formats
Add capture.props and playback.props to configure the created streams
with arbitrary properties.

Improve format parsing, make it possible to have different formats peer
stream.

Improve some of the property handling.

This can now also be used to upload a stream to a snapcast server, add
an example of this to the docs.
2024-05-14 17:30:05 +02:00
Sanchayan Maity
9d94db6646 parametric-equalizer: Use field widths in sscanf 2024-05-07 15:43:10 +05:30
Sanchayan Maity
6c6f944e53 Fix doc build pipeline failing with parametric-equalizer module 2024-05-07 09:04:15 +00:00
Sanchayan Maity
68ed40570d Add a module for loading Parametric EQ
Websites like squig.link or https://www.autoeq.app/ generate a file for
parametric equalization for a given target, but this is not a format
that can be directly given to filter chain module.

This module translates the file to filter chain module arguments and
then loads the filter chain module with these arguments.
2024-05-07 11:37:48 +05:30
Wim Taymans
a30c27dce0 pulse-server: add pulse.allow-module-loading option
Add an option to disable loading and unloading of modules with the
native protocol.

Document some more options.
2024-05-06 15:28:43 +02:00
Wim Taymans
a3ccbd00b4 pulse-server: implement describe-module with core message
Implement the old pacmd describe-module command with a core message:

pactl send-message /core pipewire-pulse:describe-module
module-echo-cancel
2024-05-06 11:39:52 +02:00
Pauli Virtanen
44d958d397 pulse-server: show warning about snap kernel features only once
Don't spam the warning about kernel missing features required for snap
on every pulseaudio connection, but instead show it only once, as the
situation is not going to improve.
2024-05-01 13:17:31 +03:00
Wim Taymans
7e26fa57e5 impl-node: ensure same data loop inside the node
Make sure the loop used to load the spa plugin matches the loop of the
impl-node and the port mixer loops.
2024-04-30 18:02:59 +02:00
Wim Taymans
3ae2ad59d2 module-rt: fix compiler warning
Fix warning about min/max potentially not being initialized.
2024-04-28 09:59:25 +02:00
Wim Taymans
972ac850b1 filter-chain: fix arguments of calloc 2024-04-28 09:53:08 +02:00
lunks
4706fc8a9b combine-stream tag forward 2024-04-28 07:51:02 +00:00
Wim Taymans
6fdf09e83e impl-node: remove redundant variable 2024-04-25 15:58:34 +02:00
Wim Taymans
9bb5780cc2 meta: add explicit sync metadata and data type
Change the GenericFd data type to SyncObj. It's probably better to
explicitly state the data type than to make something generic. Otherwise
we would need to transfer the specific fd type somewhere else and there
is no room for that in the buffer and the the metadata is not a good idea
either because it can be modified and corrupted at runtime.

Add the SyncTimeline metadata. This contains 2 points on two timelines
(SyncObj datas in the buffer). The buffer can be accessed when the
acquire_point is signaled on the timeline and when the buffer
can be released, the release_point on the timeline should be signaled.
2024-04-25 09:55:19 +02:00
Wim Taymans
31de44f679 client-node: simplify some things
We don't need to get the supprt just to get the logger.
2024-04-25 09:25:51 +02:00
Barnabás Pőcze
6a26e6dd3f treewide: fix some format string issues
Use the proper specifier, and cast to a known type where the type
is not guaranteed by any standard.

See #3975
2024-04-25 07:24:10 +00:00
Stefan Ursella
65e8bec8dd module-protocol-simple: handle 'node.name' property 2024-04-23 11:11:30 +00:00
Wim Taymans
0e13d088e7 module-ffado: only start after ports are configured
Don't start yet when the ports are pending configuration.

See #3968
2024-04-22 17:43:04 +02:00
Wim Taymans
c3d4abd7f1 modules: use acquire/release loop
Expose the acquire_loop/release_loop functions and use them in the
modules.

Make sure the nodes created from the module use the same data loop as
the module. We need to ensure this because otherwise, the nodes might
be scheduled on different data loops and the invoke or timer logic will
fail.
2024-04-22 16:19:02 +02:00
Wim Taymans
8dce124720 impl-port: only go through mixer for IO
Since we don't follow updates of the params on the mixer but only on the
port, we might get out of sync and fail to negotiate.

Going through the mixers for everything needs some more work.

Fixes #3971
2024-04-22 10:01:39 +02:00
Pauli Virtanen
ac95f796bf combine-stream: fix latency-compensate with resample.disabled=true
When resample.disabled=true, which is now the default, Format has zero
rate, so latency buffers get zero size. The rate in this case is the
graph rate.

Fix by just using the delay in samples, as all streams must in any case
run at same rate for the combining to work.

Fixes: bff252ce60 ("combine-stream: actually make use of resample.disable")
2024-04-19 18:39:52 +03:00
Wim Taymans
e85bb7194b profiler: remove unused data-loop 2024-04-19 12:16:39 +02:00
Wim Taymans
68916e062b impl-node: implement async scheduling
When node.async is set, make the node async.

Advertize SPA_IO_AsyncBuffers on mixer ports when supported. Set a new
port flag when AsyncBuffer is supported on the port.

When making a link and if one of the nodes is async and the linked ports
support AsyncBuffer, make the link async and set this as a property on
the link. For async nodes we will use SPA_IO_AsyncBuffers on the mixer
ports.

Nodes that are async will not increment the peer required counters. This
ensures that the peer can start immediately before the async node is
ready.

On an async link, writers will write to the (cycle+1 & 1) async buffers
entry and readers will read from (cycle & 1). This makes the readers read
from the previously filled area.

We need to have two very controlled areas with specific rules for who
reads and who writes where because the two nodes will run concurrently
and no special synchronization is possible otherwise.

These async nodes can be paused and blocked without blocking or xrunning
the rest of graph. If the node didn't produce anything when the next
cycle starts, the graph will run with silence.

See #3509
2024-04-18 10:31:29 +02:00
Wim Taymans
84ed9c0fe9 impl-port: query all params through the mixer
Go through the mixers of the port to get the params.

This makes it possible to let the mixer decide on formats, buffers and
io areas.

Currently, the format is the same on all mixer input and output ports
and the buffers are shared on the output port but the idea is to make it
possible to have different formats and buffers per link.
2024-04-17 16:18:04 +02:00
Wim Taymans
271f2d855d impl-port: implement port_enum_param on mixers
Implement the IO areas the default mixers support and proxy all other
queries to the peer port with the new node event.
2024-04-17 16:18:04 +02:00
Jonas Holmberg
09088b376f rtp_stream: Use the log topic of the module
Set log topic to the topic of the module linked with stream instead of
logging with "default" topic.
2024-04-17 07:13:53 +00:00
Wim Taymans
24478b9128 module-loopback: only enable delay with valid rate and channels
Or else we can't calculate the required delay buffer size and we might
even end up with a double free.

Fixes #3748
2024-04-16 11:16:00 +02:00
Jonas Holmberg
64d75b6b2e module-rtp-sink: Send all remaining packets when stopping
Don't close rtp_fd until all packets have been sent by the timer, if
the timer is running when the stream is stopped.
2024-04-16 07:50:33 +00:00
Barnabás Pőcze
4cea8eb01f pulse-server: use memcpy() to write string into message
The length of the string is already known, so use `memcpy()`
instead of `strcpy()` to copy the string into the message buffer.
2024-04-16 07:37:12 +00:00
Barnabás Pőcze
150211a3f8 pulse-server: message_dump(): fix format_info memory leak 2024-04-16 07:37:12 +00:00
Barnabás Pőcze
3fa92bbd15 pulse-server: ignore unsaveable values when deserializing property list
PulseAudio's property list can store arbitrary data, but
pw_properties can only store null-terminated strings.
So for the time being, ignore those values that don't
have null-terminators or have zero bytes inside.
2024-04-16 07:37:12 +00:00
Barnabás Pőcze
12bddf6521 pulse-server: stricter length checking when deserializing property list
The length of the value for each value in a property list is serialized
twice. Both the reference implementation and pipewire-pulse send
the same length, so be stricter and only accept a property list
if both lengths are the same.
2024-04-16 07:37:12 +00:00
Wim Taymans
232f4f01e4 protocol-native: fail when security context init fails 2024-04-15 16:43:46 +02:00
Pauli Virtanen
bff252ce60 combine-stream: actually make use of resample.disable
resample.disable was made to default to true, but copying it to stream
properties was forgotten so it didn't have any effect. Make sure to copy
it.

This will also prevent different input/output streams from negotiating
to different rates, which would result to broken audio since we are just
passing sample data through.
2024-04-14 18:58:45 +03:00
Pauli Virtanen
e1849a0650 combine-stream: check module arguments for syntax errors
Refuse to create module if the arguments were not properly parsed.
2024-04-14 16:24:16 +03:00
Wim Taymans
18ce166735 protocol-native: cleanup when starting a server fails 2024-04-10 18:12:14 +02:00
Wim Taymans
39ca1bb9ed mem: MAPPABLE -> UNMAPPABLE
Change the flag from MAPPABLE to UNMAPPABLE to ease compatibility.

Older servers with newer client will not set the flag and so memory is
mappable for the client.
Newer server will set the flag but the client will ignore it and act
like before.
2024-04-10 13:11:54 +02:00
Wim Taymans
8115bf3eeb protocol-native: send debug to right topic 2024-04-10 13:11:17 +02:00
Wim Taymans
c534acac46 spa: handle empty values better
Make sure the properties are not empty before trying to access them.
2024-04-10 11:08:40 +02:00
Wim Taymans
51c2b02e9e client-node: pass the right object to functions
These functions are not really used so not currently a problem.
2024-04-10 10:44:03 +02:00
Wim Taymans
060052206f impl-node: add pw_impl_node_set_io()
Implement pw_impl_node_set_io() and do all the things that need to be
done in it, such as taking the clock.id, checking for driver etc.

We can then remove some code that tries to reimplement this, most
notably in the remote-node (where it was missing updates to the
target_rate and target_quantum and maybe related to #3845.
2024-04-05 13:16:46 +02:00
Wim Taymans
5829276dbb client-node: fix array length debug 2024-04-03 13:29:27 +02:00
Wim Taymans
208a343d9f module-ffado: add ffado.rtprio and ffado.realtime
Add two properties to control the realtime ffado thread and its
priority.

See #3558
2024-04-03 09:30:38 +02:00
Wim Taymans
f3fe20bdde buffer: add GenericFd memory type
Add a Generic fd type. These could be eventfd or timerfd, the meaning
can depend on extra metadata.
2024-04-02 12:28:09 +02:00
Wim Taymans
2f8740dee8 mem: add a PW_MEMBLOCK_FLAG_MAPPABLE flag and pass it around
This flags means that the fd can be mmaped without special handling. It
is the equivalent of the SPA_DATA_FLAG_MAPPABLE. Refuse to map memory
that is not mappable.

Make sure we make all allocated MemFd memory MAPPABLE by default. We can
then remove the stream and filter special handling for MemFd types and
just check the more generic MAPPABLE flag.

Make one exception when a client uploads MemFd buffer memory. We must
manually set the MAPPABLE flag for MemFd to make things backwards
compatible.
2024-04-02 12:27:58 +02:00