Commit graph

7238 commits

Author SHA1 Message Date
Wim Taymans
5480a1382f modules: always update latency params
Even if the latency didn't change, the current pw-stream
implementation will have wiped all Latency params away and we want
to put them back in all cases.

See #4731
2025-06-11 16:26:03 +02:00
Wim Taymans
82229b3d87 modules: make sure we deactivate the graph safely
Use the loop lock to ensure the loop is not using the graph anymore when
the deactivate or reset it.
2025-06-11 15:21:26 +02:00
Wim Taymans
b0462cb5de filter-chain: do graph reconfigure in playback state change
Because we do the processing of the graph in the playback process
function, only do graph reset and reconfigure from the playback state
change so that we don't have process and state change at the same time
and crash.
2025-06-11 11:43:13 +02:00
Wim Taymans
c08ef84745 modules: initialize the latency params
Otherwise we get nonsense values for the direction.

See #4731
2025-06-11 10:17:32 +02:00
Wim Taymans
190d49d874 loop: add docs about the locking 2025-06-10 18:00:01 +02:00
Wim Taymans
a2f2bded0b modules: update latency handling in example filter 2025-06-10 16:48:49 +02:00
Wim Taymans
b6b61a956f modules: implement Latency according to docs
Make one function to update the Latencies on all streams. We need to do
this because if one of the process or latency params change, it
influences the latency params on all streams.
2025-06-10 16:48:49 +02:00
Martin Geier
c2e539b780 module-combine-stream: flush data in paused state
When stream is paused, internal delay buffers were cleared, but some
data could stay in stream output queue. Without a flush, these data where
played in front of a new data.
Patch was inspired by 64d6ff4184 fixing the
same issue in a filter-chain module.

Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
2025-06-10 16:28:43 +02:00
Martin Geier
ff3bc8818f module-combine-stream: update latency right before playback starts
Combine stream selects the biggest latency from all output streams and sent
the latency upstream. To select the biggest latency, each stream needs to have
the sample rate and the quantum size set.
The combine stream recalculates the latency in the latency changed callback
or during data processing.
Stream sets the sample rate and the quantum size in a copy_position call
which is normally called during processing the output data or when state
changes to streaming.
Before this change, it wasn't guarantee the copy_position was called for
each stream already and latency in the combine stream was selected from
random stream.

Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
2025-06-10 16:28:40 +02:00
Wim Taymans
a78e97a53b filter-chain: document ffmpeg plugin 2025-06-10 10:55:45 +02:00
Jonas Holmberg
930f2f3e2d gst: deviceprovider: take a ref to devices
When _probe() is called, take a ref to the newly created devices instead
if sinking the floating ref, since gst_clear_object() is called when
core is disconnected. Otherwise the devices will be freed before the
caller gets them.

Fixes the following assert in the caller:

g_object_is_floating: assertion 'G_IS_OBJECT (object)' failed

Or sometimes a segfault with the backtrace:

0  g_type_check_instance_is_fundamentally_a (type_instance=type_instance@entry=0x116c1b0, fundamental_type=fundamental_type@entry=80) at /usr/src/debug/glib-2.0/2.84.0/gobject/gtype.c:3918
1  0xb6d40cc6 in g_object_is_floating (_object=0x116c1b0) at /usr/src/debug/glib-2.0/2.84.0/gobject/gobject.c:3843
2  0xb6bc4c74 in gst_device_provider_get_devices (provider=0x109ba00) at /usr/src/debug/gstreamer1.0/1.24.12/gst/gstdeviceprovider.c:426
2025-06-09 16:50:18 +02:00
Wim Taymans
4f3a2d723b filter-graph: add a pipe filter 2025-06-06 13:00:29 +02:00
Christian Glombek
113e22cb72 raop: don't set improper media.format 2025-06-03 19:39:43 +02:00
Christian Glombek
6e64d5da47 raop: set mtu to 1448 by default 2025-06-03 19:39:41 +02:00
Wim Taymans
f65f5cf866 stream: make ticks continuous on DISCONT
A discont of the clock does not mean a discont in the stream, so keep
the ticks continuous.
2025-06-02 12:23:53 +02:00
Wim Taymans
13105a8e64 pulse-server: Implement record PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND
Also implement the flag for record streams, where it is more usually
used, like in pavucontrol to disable starting a network source.
2025-06-02 11:48:01 +02:00
Arun Raghavan
60669920f0 pulse-server: Implement PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND
We do this by setting the node as passive.

Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4255
Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4726
2025-06-02 14:38:22 +05:30
Sam James
2cec77e7df *: unify config.h handling
config.h needs to be consistently included before any standard headers
if we ever want to set feature test macros (like _GNU_SOURCE or whatever)
inside. It can lead to hard-to-debug issues without that.

It can also be problematic just for our own HAVE_* that it may define
if it's not consistently made available before our own headers. Just
always include it first, before everything.

We already did this in many files, just not consistently.
2025-05-30 10:24:13 +00:00
Wim Taymans
50fe63ea76 examples: exit early when no longer running
When we are no longer running after the eventfd was signaled, stop
producing samples.
2025-05-30 12:17:41 +02:00
Wim Taymans
fecf1bcba4 thread-loop: remove the event
We don't need the event to wake up and stop the thread loop, we can
simply use _invoke() of the loop implementation, like we do for the
data loop.
2025-05-30 12:12:03 +02:00
Wim Taymans
820e0fccb1 loop: we can't actually use locked to stop the loop
We need to signal the event and wake up the loop to actually make it
stop and joinable.
2025-05-30 12:07:47 +02:00
Wim Taymans
c45d667934 loop: spa_loop_invoke -> spa_loop_locked where possible
When we simply need to change some state for the code executed in the
loop, we can use locked() instead of invoke(). This is more efficient
and avoids some context switches in the normal case.
2025-05-30 11:59:35 +02:00
Sam James
b943c31fd8
*: don't include standard C headers inside of extern "C"
Including C headers inside of `extern "C"` breaks use from C++. Hoist
the includes of standard C headers above the block so we don't try
to mangle the stdlib.

I initially tried to scope this with a targeted change but it's too
hard to do correctly that way. This way, we avoid whack-a-mole.

Firefox is working around this in their e21461b7b8b39cc31ba53c47d4f6f310c673ff2f
commit.

Bug: https://bugzilla.mozilla.org/1953080
2025-05-30 09:48:28 +01:00
Carlos Rafael Giani
e2731914ad pw-cat: Document numeric WMA constants 2025-05-29 22:24:31 +02:00
Carlos Rafael Giani
7341cc401b pw-cat: Add support for AC3, EAC3, TrueHD, DTS, MPEG-H 2025-05-29 22:24:07 +02:00
Wim Taymans
f7fdafc203 loop: add method to run a function with the lock
Convert some _invoke to _locked
2025-05-29 10:17:16 +02:00
Wim Taymans
fb49e0795c loop: move thread-loop to support loop
Add more synchronization primitives to spa loop so that we can replace
the thread-loop with it.
2025-05-29 10:17:16 +02:00
Wim Taymans
cd1d9ceff1 context: make data loop prio-inherit 2025-05-29 10:17:16 +02:00
Carlos Rafael Giani
d258892392 module-rtp: Retry starting stream if this failed with ENODEV errno
ENODEV is not a fatal error, and trying again later to set up the
socket usually succeeds. Do such retries with a timer.
2025-05-28 17:19:57 +02:00
Carlos Rafael Giani
71c0c8e34c module-rtp: Rename timer to standby timer in rtp source
This results in clearer code, and makes it easier to add more timers
to the module in the future.
2025-05-28 17:19:57 +02:00
Carlos Rafael Giani
023525eca2 rtp: aes67: Document sess.ts-direct property and set it to true for AES67 2025-05-28 17:19:57 +02:00
Wim Taymans
96007dc576 pw-cat: mode SYSEX mode out of ffmpeg define 2025-05-26 19:24:23 +02:00
Robert Mader
e81fb77322 gst: src: Change DEFAULT_MIN_BUFFERS back to 1
The change from 1 to 8 was done without justification in the commit
message and possibly for debug purposes. Unfortunately it breaks
negotiation with the libcamera virtual pipeline, which defaults to
4 buffers.

Set the the value to 1 again as successful negotiation - even with an
unusually low number of buffers - is usually more desirable than an
error.

Fixes: 98b7dc7c0 ("gst: don't do set_caps from the pipewire callback")
2025-05-25 04:03:06 +02:00
Wim Taymans
737ca4ee7b tools: add sysex play option in pw-cat
This makes it possible to upload raw midi (sysex) into the graph.
2025-05-23 16:52:22 +02:00
Wim Taymans
564c9b1ba5 Use "8 bit raw midi" for control ports again
There is no need to encode the potential format in the format.dsp of
control ports, this is just for legacy compatibility with JACK apps. The
actual format can be negotiated with the types field.

Fixes midi port visibility with apps compiled against 1.2, such as JACK
apps in flatpaks.
2025-05-23 16:46:13 +02:00
Wim Taymans
5e81ff8ede filter-chain: manage graph from source only
Only react to the capture stream state change and format changes. The
playback and capture streams change state somewhat concurrently and so
the graph state might not be consistent.

Because only the capture stream will trigger the playback stream and
start the processing, we can safely react to capture stream changes
only.
2025-05-21 15:23:00 +02:00
Wim Taymans
ccb7a51c3a filter-graph: add support for lv2 State
If the lv2 plugin supports State restore, use it to load state from the
config section in the lv2 plugin definition.
2025-05-21 15:19:23 +02:00
Wim Taymans
f7eab4172e client-node: let all events go to the node
Just pass all events to the node and only error out when they return an
error value.

Make sure we pass the result values of the command around.
2025-05-20 11:47:10 +02:00
Christian Glombek
5a54ecd8df daemon/pipewire.conf.avail: Add snippet enabling module-raop 2025-05-19 18:28:10 +02:00
Wim Taymans
b9a8bb15a4 impl-link: fix feedback handling
If a link is a feedback link, we just need to swap the input/output
scheduling dependency.

Don't swap input/output nodes (without swapping ports) because then we
will be querying the wrong node/port pair when negotiating and cause
errors.

See #4706
2025-05-19 09:45:05 +02:00
Barnabás Pőcze
6712d9c3db pipewire: module-raop-discover: fix typo in documentation
roap -> raop
2025-05-14 17:59:41 +02:00
Wim Taymans
6b3681938b pw-dump: don't do raw mode when streaming
pw-dump | less -RS is a common thing and raw mode is not helpful.
2025-05-13 14:59:51 +02:00
Wim Taymans
08efc1171c pw-dump: disable indent in raw mode as well 2025-05-13 10:37:00 +02:00
Kirill
1f16f949ec Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Barnabás Pőcze <pobrn@protonmail.com>
2025-05-13 08:27:29 +00:00
dartvader316
d599936925 pw-dump: add raw json elements output option 2025-05-13 08:27:29 +00:00
Taruntej Kanakamalla
882542e001 gst: sink: minor type fix 2025-05-12 21:31:30 +00:00
Wim Taymans
b47d28bad6 profiler: use doubles in profiler.log
Don't truncate the measurements when we convert to usec but keep the
fractional part to get a more accurate graph.
2025-05-12 17:23:35 +02:00
Wim Taymans
4f53136891 netjack2: reverse send/recv roles in driver/manager
The params contain the send/recv streams from the point of view of the
manager (and not the driver as was assumed before). This means we need
to swap send/recv in the driver, not the manager.

This makes things interoperate with JACK/netjack2.

See #4666
2025-05-12 12:57:11 +02:00
Pauli Virtanen
1445843ced modules: get also instance id for flatpak apps
Add "pipewire.access.portal.instance_id" property for distinguishing
Flatpak application instances from each other.
2025-05-12 09:40:32 +00:00
Taruntej Kanakamalla
608bf93f7a gst: sink: minor formatting fixes
follow up of !2337
2025-05-09 07:13:36 +00:00