Commit graph

13266 commits

Author SHA1 Message Date
Barnabás Pőcze
fc91f93af3 pipewire-jack: examples: video-dsp-play: add missing includes
`strerror()` needs `string.h`, and `lrintf()` needs `math.h`.
2025-02-02 14:25:08 +01:00
Wim Taymans
5e6b77cf1e spa-resample: improve output format selection
Setting a format does not automatically mean making a wav file.

Instead, check for the extension on the output file name and when we
can't find any good containet, use the same as the input file.

This makes more sense than doing `spa-resample test.flac -r 44100 test.wav`
and ending up with a FLAC file named test.wav. Or
`spa-resample test.flac -r 44100 -f s16 test2.flac` and ending up with a
wav file named test2.flac.
2025-01-31 09:24:08 +01:00
Olle Axelsson
1cc00923db gst: Ensure possible_caps exists before comparing caps
During negotiation, ensure that possible_caps exists before calling
gst_caps_intersect_full(). Sometimes possible_caps seem to be NULL which
cause the GST_IS_CAPS assert to fail.

The reason for the occasional NULL possible_caps during initial
negotiation is unknown, but this is also possible during renegotiation.
The handle_format_change() may be triggered before the next create(),
win which case we have not yet discovered in the streaming thread that
we are in the NOT_NEGOTIATED state. We should guard against this
possibility as well.
2025-01-30 13:38:55 -05:00
Wim Taymans
dea6fa7f4c systemd: add systemwide pipewire-pulse files
We can and it works, so why not.
2025-01-30 12:50:49 +01:00
Arun Raghavan
9ca9579978 rtp: Initialise source receiving state to true be default
Because we don't know the stream state at the start of streaming, if
clients are deciding to connect on the basis of this flag, they will
never connect if we default to true. So let's be optimistic by default
and we'll find out on timeout if there actually isn't data to receive.
2025-01-29 14:21:48 +00:00
Wim Taymans
516f86c329 protocol: improve manager socket handling
Some of the tools would like to connect to the manager socket first
because they are manager style apps. They however completely ignore any
of the configured sockets in the config and assume everything is the
default.

Fix this by adding a remote.intention = "manager" to those apps. This
instructs the protocol to first try to connect to a socket with the
-manager extension before attempting the regular configured socket.

This makes things work when you have sockets configured in /tmp
and have remote.name = /tmp/pipewire-0 in the config.
2025-01-29 12:59:45 +01:00
Wim Taymans
546de65c67 pulse: sanitize the remote name
We use the remote name as a suffix for the default server address and so
it should not contain any slashes. Take everything after the last slash
if there is one.
2025-01-29 12:09:36 +01:00
Wim Taymans
70ca546c6a protocol-native: don't overwrite the intention with remote.name 2025-01-29 12:08:20 +01:00
Wim Taymans
864438e8e9 stream: don't emit drain when in progress
We keep on calling the drain event for as long as we are drained. The
application is supposed to inactivate the stream or provide more data
at some point.

Because we do this from the data thread, we use a non-blocking invoke.
If for some reason the event callback takes a long time we might place a
lot of these invoke calls into the invoke queue, which will then be
dispatched one after another (and cause more blocking or a burst of
useless invoke calls).

Avoid this by only placing one drain invoke call into the queue at a
time.

Fixes #4529
2025-01-28 16:51:10 +01:00
Wim Taymans
b341668fda stream: fix id and status swap 2025-01-28 13:22:20 +01:00
Michael Tretter
0829f32114 stream: clear buffer from io when clearing buffers
If a provider uses the stream API and pushes a buffer to the stream
after the stream is set to paused, the buffer_id of the last buffer
remains in the io.

If a consumer starts streaming in this state, the buffer_id of the old
buffer is still in the io. The consumer receives a stale buffer_id and
may discard the buffer. Now the buffer is lost, since it is still marked
as busy on the producer.

This can be reproduced by starting Weston with the PipeWire backend and
repeatedly restarting a GStreamer pipeline that connects to the Weston
output. Eventually Weston won't be able to dequeue buffers since the
lost buffer is still busy.

Clear the buffers in the io when the buffers are cleared to avoid
sending an old buffer_id to the consumer.
2025-01-28 12:50:37 +01:00
Wim Taymans
110d8572c0 audioadapter: fix EnumPortConfig without converter
If we don't have a converter, we always work in passthrough mode and
EnumPortConfig can use the same code as PortConfig in all cases.

See !2265
2025-01-28 12:39:31 +01:00
Michael Tretter
0814bafef1 videoadapter: fix EnumPortConfig for adapter without converter
The videoadapter always exposes the EnumPortConfig parameter. If no
converter is loaded, the EnumPortConfig parameter doesn't return a
parameter.

In this case, the client-node in the PipeWire server returns -ENOENT for
the EnumPortConfig, which in turn causes WirePlumber to fail the object
activation and it won't be able to create a link for the object.

This happens since Commit b57375ba85 ("stream: enable videoadapter in
all cases"), since now the videoadapter is always added. Before that,
the EnumPortConfig parameter was just not exposed and linking worked.

Running another client that ignores the error codes for missing
parameters (e.g., pw-dump) hides the issue, as the EnumPortConfig result
is cached as successful with 0 parameters and accessing the cache
doesn't return an error code.

Return the same PortConfig for EnumPortConfig as for PortConfig to fix
this.
2025-01-28 11:38:08 +00:00
Wim Taymans
5765ac61ab doc: move modules around to add to docs 2025-01-28 12:33:47 +01:00
Wim Taymans
636c5373c7 doc: add SPA modules 2025-01-28 11:48:58 +01:00
Wim Taymans
8b761ccb78 doc: try to add SPA modules 2025-01-28 11:13:05 +01:00
Wim Taymans
f60fe6d6e4 docs: add more docs for the SPA modules 2025-01-28 10:33:05 +01:00
Wim Taymans
73e7f61d8c modules: add more docs 2025-01-28 10:13:59 +01:00
Wim Taymans
4e3d5e2ac5 modules: add some more docs 2025-01-28 09:59:37 +01:00
Wim Taymans
4d5ed3f292 modules: document metadata module 2025-01-27 16:13:14 +01:00
Wim Taymans
e210925c24 modules: document the metadata factory a little 2025-01-27 15:52:48 +01:00
Wim Taymans
aecb406a96 modules: document link-factory context.objects 2025-01-27 15:24:42 +01:00
Sanchayan Maity
ab5f81b9a4 bluez5: g722: Make sequence number handling consistent with other codecs 2025-01-27 18:43:24 +05:30
Wim Taymans
1a737a9fed jack: use a new JackPortIsMIDI2 flag
The JACK2 maintainer would prefer to use a new port flag to mark the
MIDI2 capability of the port and keep the port type as MIDI. Add the
proposed flags to the API.

If we register a MIDI port with the MIDI2 flag, promote it to UMP.
Expose v1 MIDI ports with the MIDI DSP property again.

If we see an UMP port, set the MIDI2 flag on the port.

This is functionaly equivalent to what we have. Old jack midi ports will
now however not have the UMP DSP format but the old MIDI format so that
we can, in the JACK API, make a distinction between MIDI1 and MIDI2 ports.
2025-01-27 13:05:21 +01:00
Sanchayan Maity
23ae55015d bluez5-dbus: Do not setup ASHA profile for unconnected devices
Do not add/connect the profile for unconnected devices.

This fixes the issue where a previously paired ASHA device
would show up in the pavucontrol output device list even
when not connected.
2025-01-27 09:22:41 +00:00
Wim Taymans
ce31e66fb7 audioadapter: only add/remove port when passthrough changed
We only need to switch between the converter ports and the follower port
when we switch between passthrough. Avoid emiting remove of the (non
existing) follower ports when the mode changes from none to DSP at startup.
2025-01-27 10:20:55 +01:00
Arun Raghavan
43f148677e spa: audioadapter: Enum follower formats first in convert mode 2025-01-26 18:58:36 -05:00
Arun Raghavan
beb81e8f4e spa: audioadapter: Explicitly track port mode
Will be useful for convert-mode-specific EnumFormats.
2025-01-26 18:52:51 -05:00
Pauli Virtanen
50437fb4eb bluez5: set device.routes on device set nodes
Device set node props are controlled by a Route, so set device.routes=1
to avoid Wireplumber restoring node props on it.
2025-01-26 21:04:49 +02:00
Pauli Virtanen
de0f54c324 bluez5: support BAP hardware volume on device sets
Enable hardware volume for device sets, when all devices in the set
support HW volume.
2025-01-25 15:37:52 +00:00
Pauli Virtanen
34ac0d8256 bluez5: support BAP hardware volume
Support BAP HW volume now that it's implemented in BlueZ, with the
volume range 0-255 per spec.
2025-01-25 15:37:52 +00:00
Wim Taymans
b72eed8f03 audioadapter: don't emit result events for internal param enums
All of the _sync param enum calls are internal end should not result in
a result event externally.

See !2260
2025-01-25 16:34:35 +01:00
Wim Taymans
8b02e5f737 stream: fix ticks calculation 2025-01-24 16:39:16 +01:00
Wim Taymans
fa15af376f context: avoid some scaling overflows
Make a macro to scale without overflows and use this in the context.
2025-01-24 16:23:01 +01:00
Wim Taymans
eb462302b7 docs: fix indentation of properties 2025-01-24 16:23:01 +01:00
Michael Tretter
0468712fea stream: fix ticks calculation if rate is 0/0
If the rate is 0/0, converting nsec to ticks doesn't work and will
result in 0 ticks, and it is not possible to convert ticks back to a
timestamp.

This can be reproduced by connecting a GStreamer pipewiresrc to a
libcamera node. The libcamera-utils has a rate of 0/0 and the
pipewireclock won't be able to determine a correct time with that.  This
error was caused by Commit 89993a3cc6 ("gst: enable the pipewire ticks
as a clock source").

Fix this by using the nsec as ticks and setting the appropriate rate.
2025-01-24 16:03:42 +01:00
Wim Taymans
5d35986329 doc: document module-link-factory 2025-01-24 15:35:46 +01:00
Wim Taymans
19d78ef195 module: improve loopback docs 2025-01-24 13:13:23 +01:00
Wim Taymans
40c1552402 modules: improve profiler docs
The profiler now can have arguments.
2025-01-24 12:53:13 +01:00
Wim Taymans
830bd19ca2 rtp: take into account ipv4/ipv6 when calculating header size
Calculate the header_size based on the IP version instead of using a
hardcoded value.

Fixes #4524
2025-01-24 12:45:05 +01:00
Taruntej Kanakamalla
180967bb64 gst: pipewirepool:fix lock evasion in release_buffer 2025-01-24 10:51:29 +00:00
Wim Taymans
0c8f803d59 audioconvert: optimise f32d to/from s16s conversions
They are mostly used for sending and receiving RTP so it might be worth
to make them a bit faster.
2025-01-24 10:37:02 +01:00
Sam James
edcecd8975
meson.build: drop -Wno-error=strict-aliasing
This was added in error (88873e295b) but
we discussed it in !2180 and it turned out CFLAGS="... -fstrict-aliasing"
was set in the environment, overriding the earlier -fno-strict-aliasing
already set in meson.build (which we're keeping here).

That is, when -fno-strict-aliasing is in-effect, there's already no
need for -Wno-error=strict-aliasing (as the warnings aren't emitted), but
if there *is* a need for a -Wno-error=strict-aliasing for a user, it
means they're (likely unintentionally) enabling strict-aliasing and we
certainly want to make them aware of that.
2025-01-24 06:15:05 +00:00
Arun Raghavan
d186297745 meson: Bump webrtc-audio-processing to v2.1
No major changes, but should make some usage as a subproject work more
reliably.
2025-01-23 11:57:11 -05:00
Arun Raghavan
800cd53c56 gst: sink: Whitespace fixups 2025-01-23 10:17:19 -05:00
Arun Raghavan
9ece286c90 gst: Fix up some debug logs
Copy-pasto in the pause code, plus let's use GST_DEBUG_OBJECT() so
we can track which pool is affected.
2025-01-23 10:17:19 -05:00
Wim Taymans
9e2a494d05 jack: add a UMP source example 2025-01-23 15:53:17 +01:00
Wim Taymans
ae758885dd 1.3.81 2025-01-23 09:52:29 +01:00
Wim Taymans
a2824b6773 po: Update Slovenian (sl) translation
Fixes #4522
2025-01-23 09:51:39 +01:00
Sanchayan Maity
6e67b3a2d7 bluez5: media-sink: Use correct profile name for ASHA 2025-01-23 10:13:48 +05:30