Commit graph

6997 commits

Author SHA1 Message Date
George Kiagiadakis
1e2618f314 gst: pool: add explicit remove_buffer method
This is for readability and better control.
Make sure we clear out all pointers to anything related to the released
pw_buffer, including all the memories.
2024-05-29 10:39:31 +03:00
George Kiagiadakis
40fd2553ea gst: pipewirepool: remove dead code 2024-05-29 10:39:31 +03:00
Wim Taymans
eaa3d04bcc impl-node: update required state atomically
We might be updating the required state from multiple threads in the
future.
2024-05-28 13:11:15 +02:00
Arun Raghavan
315dc7cdad gst: sink: Fix some object-less debug messages
We have the object, so there's no reason to skip that in the logs.
2024-05-28 13:47:30 +03:00
Arun Raghavan
1e3797512a gst/src: Check for 0 framerate before setting duration
This is possible if the source doesn't provide the framerate (as is the
case for libcamera), or if the framerate is variable (0/1).
2024-05-28 13:47:30 +03:00
Arun Raghavan
169e5ecd4b stream: Fix reference to pw_time.now in pw_stream_get_nsec() docs 2024-05-28 11:47:17 +03:00
Arun Raghavan
3cc5ca5a91 gst/src: Set buffer duration
We compute this from the clock quantum for audio and the negotiated
framerate for video.

Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1438
2024-05-28 08:18:47 +00:00
Wim Taymans
ffb0eff708 impl-node: resume peer targets when unlinking
Atomically change the node status from TRIGGERED to AWAKE. Only trigger
the peer nodes when the node was previously in the AWAKE state.

When we remove a node from the graph or when we destroy a link, we need
to manually resume the peers. We can do this now by atomically setting
the node to FINISHED and checking if it was previously != FINISHED.

This ensures that removing nodes/links never leaves some nodes (and also
the driver) untriggered and cause a xruns.

Fixes #4026
2024-05-27 16:58:39 +02:00
Wim Taymans
9f32b89e5a impl-node: some cleanups 2024-05-27 16:58:39 +02:00
Wim Taymans
219d1e45c4 module-ffado: set next_nsec to something better
Add the duration of the period to the current nsec to get the next_nsec.
2024-05-27 16:58:39 +02:00
Arun Raghavan
f400ff2050 gst: Check for video/ caps before parsing for info
The gst_video_info_from_caps() API isn't really intended to be used as a
check-for-videoness function (it generates an error-level GStreamer
debug message when used this way).

We check the caps for a video/ name for this reason, which is
functionally equivalent.
2024-05-27 16:01:24 +03:00
Wim Taymans
26c1993e8a snapcast-discover: add snapcast discover module
The module detects remote snapcast servers and creates a new sink
with protocol-simple for each server.

It sets up a new stream on the server for the sink with JSON-RPC.
2024-05-23 12:41:53 +02:00
Wim Taymans
59c4e7645f protocol-simple: remove old debug line 2024-05-23 11:51:32 +02:00
Wim Taymans
378b196738 impl-node: don't move unprepared nodes
If a node was unprepared and we're moving it to another driver, don't
try to unprepare and prepare it to the new driver because then we end up
with a prepare node that should not be scheduled.

Fixes #4017
2024-05-22 10:26:54 +02:00
Wim Taymans
ccb9f89347 ffado: add priority.session property
It seems to be required to unselect it as default node in wireplumber.

Fixes #4023
2024-05-22 09:37:39 +02:00
Wim Taymans
7cfbd38cbb protocol-simple: handle IPv6
Handle ipv6 addresses.

Support 0 port, which uses a free port to listen on.

Place the list of addresses we listen on as a property of the module so
that dynamically allocated ports can be retrieved.
2024-05-22 09:23:31 +02:00
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
Jonas Holmberg
d8a32e5272 impl-port: update added flag from rt thread
Avoid trying to remove a port before it has been added.
2024-05-15 09:27:33 +00: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
Arun Raghavan
db365ac855 impl-node: Expose driver id in node.props
Makes it easier for clients to track what the current driver of a node
is.
2024-05-14 20:04:13 +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
Wim Taymans
d7df3811e1 tools: queue the buffer again in all cases 2024-05-09 19:32:37 +02:00
Wim Taymans
b2844201c2 impl-node: update rt flags from rt threads
Update the added and prepared flags from the rt thread.

We also need to check if the node was prepared before we can schedule
it.
2024-05-08 17:14:32 +02:00
Wim Taymans
fac0d47c23 impl-port: swap io areas instead of doing cycle math
Instead of doing (cycle+1) & 1 for output ports, simply swap the io
areas depending on the port direction (0 = input, 1 = output) and
just to cycle&1 for all ports.
2024-05-08 10:45:53 +02:00
Wim Taymans
03d62dc756 impl-port: input ports read from io cycle & 1
Input ports read from the async buffer cycle & 1 and output ports write
to (cycle + 1) & 1
2024-05-08 10:45:53 +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
Barnabás Pőcze
6d7b0284dd pw-dump: destroy all objects not just those matching the pattern
`registry_event_global()` creates an `object` object for every object,
not just those matching `data::pattern`. However, previously
`registry_event_global_remove()` only destroyed those objects
that matched the given pattern. Fix that by destroying
every object.

Fixes #4001
Fixes 47e1f38f03 ("pw-dump: also dump object removal")
2024-05-05 16:39:42 +02:00
Barnabás Pőcze
0c0d520c32 pw-dump: fix string memory leak on error
`object::type` was not cleared in the error path. Fix that
by calling `object_destroy()`, which takes care of it.
2024-05-05 16:38:40 +02:00
Wim Taymans
056d826c59 core: handle import errors better
Check for NULL when importing a buffer and log a message instead of
trying to deref the NULL pointer and crash.

Add some more logging to mem when importing a bad fd.

See #3998
2024-05-03 15:56:13 +02:00
Tristan Cacqueray
47a71325d6 pw-mon: Add --print-separator option to help streaming parser
When processing the output of pw-mon in real time, it is presently
difficult to know when an event is completed because the last attribute
or property is different for each type of event.

This change corrects that by terminating each event with an empty new line.
2024-05-03 07:10:03 -04:00
Wim Taymans
f73d3e4af9 stream: copy position before going to STREAMING
So that get_time_n will return values as soon as we go to STREAMING.

Fixes #3995
2024-05-03 11:53:15 +02:00
Wim Taymans
88e9f7683c conf: an empty condition should evaluate to true
An empty match rule matches nothing and evaluates to false but an empty
condition should evaluate to true.
2024-05-03 10:57:02 +02:00
Barnabás Pőcze
0b3a27b208 pw-mon: fix type confusion in core event handler
All pw_core event handlers (`on_core_*()`) currently receive a pointer
to `struct data`, not `struct proxy_data`; as can be seen from the
`pw_core_add_listener()` call in `main()`.

Fixes: cacdcc1b62 ("pw-mon: add filter param to hide props and/or params")
Fixes #3997
2024-05-03 07:18:43 +00:00
Barnabás Pőcze
2bc5d0914d gst: fix stream params memory leak
Both the GPtrArray and its contents are leaked in case of success.
`pw_stream_connect()` copies the params as needed, so use `g_autoptr()`
to free the array and with it, its contents.
2024-05-03 07:15:19 +00:00
Wim Taymans
c8efa0fae2 context: use first data-loop class when unset
When a node does not specify a data-loop class, use the class of the
first data loop. This makes the nodes spread out over the first
(default) data-loop class.
2024-05-02 09:33:38 +02:00
Wim Taymans
3e760ea7d7 gst: handle some more errors
The threadloop might fail to create because of missing plugins, so
handle that.

The context might fail to create because of some fatal config error or
missing plugin, handle that too instead of crashing.

See #3994
2024-05-01 20:31:39 +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
Barnabás Pőcze
d80989ab56 treewide: fix errno assignments
Do not set `errno` to a negative value.
2024-05-01 09:28:17 +00: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
8dabf3486e impl-node: optimize invoke usage
When the driver and the node have the same data-loop we can group the
invoke calls together and avoid context switches for the sync
operations.
2024-04-30 16:17:03 +02:00
Wim Taymans
bd14e212c7 remove from driver in driver data-loop 2024-04-30 15:51:00 +02:00
Wim Taymans
ff1f793a63 stream: only overwite node.loop.class when unset 2024-04-30 13:27:42 +02:00