Commit graph

403 commits

Author SHA1 Message Date
Wim Taymans
6d74eee874 spa: bump channels to 128 again
Remove the SPA_AUDIO_MAX_POSITION define and use the
SPA_AUDIO_MAX_CHANNELS again.

Make a compile time define to override the default max channels of 64.

Make sure we compile the SPA library with the default 64 channels. If
you use the SPA library on a spa_audio_info you will get 64 channel
support, like before. If you want more channels, you will need to make
a padded structure or redefine the MAX_CHANNELS before you use the
spa_audio_info structures. You can use the padded structure with the
new functions that take the structure size.

With the extra checks in the parsing code, we avoid making a
valid spa_audio_info with too many channels that don't fit in the
structure. This means that code that receives a spa_audio_info can
assume there is enough padding for all the channels.
2025-10-24 08:53:21 +02:00
Wim Taymans
3263e2497e 1.5.81 2025-10-16 10:07:11 +02:00
Carlos Rafael Giani
52041e888c meson.build: Make libswscale a requirement only if videoconvert is enabled 2025-10-02 12:05:07 +02:00
Barnabás Pőcze
cec0ab322e meson.build: set PW_BUILDDIR in devenv
This is needed by `pw-v4l2`.
2025-09-08 11:36:24 +00:00
Barnabás Pőcze
fcb318b9c5 pwtest: is_debugger_attached(): rework test
Check if the "TracerPid" field in `/proc/self/status` is non-zero. This does
not need libcap, and does not depend on capabilities, and it also works under
qemu user emulation.
2025-08-13 07:14:33 +00:00
Demi Marie Obenour
bac3d31283 pod: fix some data races in body code
The body code didn't use atomic loads, so it had undefined behavior if
the body was concurrently modified.  Use atomic loads to fix this.
Since the memory order is __ATOMIC_RELAXED this has no runtime overhead.
Also add barriers around a strncpy call and cast to volatile before
checking for a NUL terminator, though NUL-terminated strings in shared
memory are unuseable.  There are some places where bytewise atomic
memcpy(), which doesn't currently exist, is needed.  Instead, try to
fake it by using two barriers around memcpy().
2025-08-05 10:49:33 -04:00
Demi Marie Obenour
a09bf57944 meson: Always use -fno-strict-aliasing and -fno-strict-overflow
SPA does not respect the C strict aliasing rules at all, so any code
that uses it must be built with -fno-strict-aliasing.  Furthermore,
there is code in SPA that compares pointers that point to different
objects, so -fno-strict-overflow is also needed.
2025-07-24 07:30:28 +00:00
Barnabás Pőcze
f2c878a2c1 meson.build: rework systemd related options
One issues is that the `systemd-{system,user}-service` feature options
do not anything without the `systemd` option. This makes it more
complicated to arrive at the desired build configuration since there
are 3^3 = 27 possible ways to set each of them, but if `systemd=disabled`,
then the other two are just ignored.

Secondly, the `systemd` option also influences whether or not libsystemd
will be used or not. This is not strictly necessary, since the "systemd"
and "libsystemd" pkg-config files might be split, and one might wish to
disable any kind of service file generation, but use libsystemd.

Solve the first issues by using the `systemd-{system,user}-service` options
when looking up the "systemd" dependency for generating service files. This
means that the corresponding option is in full control, no secondary options
are necessary. This means that the "systemd" dependency is looked up potentially
twice, but that should not be a significant issue since meson caches dependecy
lookups.

And solve the second issue by renaming the now unused `systemd` option to
`libsystemd` and using it solely to control whether or not libsystemd will
be used.

Furthermore, the default value of `systemd-user-service` is set to "auto" to
prevent the dependency lookup from failing on non-systemd systemd out of
the box. And the journal tests in "test-support" are extended to return "skip"
if `sd_journal_open()` returns `ENOSYS`, which is needed because "elogind"
ships the systemd pkg-config files and headers.
2025-07-18 09:46:17 +00:00
Sam James
64b7a8990e
meson: add fftw option
Packagers need to have a way to control whether a dependency is used
even if it's installed/available.
2025-06-28 02:59:03 +01:00
Wim Taymans
feba1fd260 meson: fix avfilter dependency 2025-06-10 11:23:15 +02:00
Wim Taymans
94116901ce filter-graph: add an ffmpeg plugin
Allows for using an ffmpeg filter-graph as a filter-graph node.
2025-06-10 10:55:45 +02:00
Arun Raghavan
31069b2626 Don't log to systemd during development
Can get a bit spammy if we're doing verbose logging.
2025-04-18 12:28:23 -04:00
Taruntej Kanakamalla
ee2c6eb41e gst: sink: Manage buffer pool memory manually
Let's make sure we own the memory in buffers, so that we can be
resilient to the PW link going away. This currently maintains the status
quo of copying data into the pipewirepool for sending to the remote end,
but moves the allocation of buffers so that ownership is maintained by
the sink in all cases.

There are some tricky corners, especially with bufferpool vs. buffers
param negotiation -- bufferpool parameters can be negotiated in
GStreamer before the link even comes up, so we try to adapt the buffers
param to use the negotiated value. For now, that is more brittle than
tying those two aspects together. We can revisit this if we can find a
way to tie pipeline state and link state more closely.

Co-authored-by: Arun Raghavan <arun@asymptotic.io>
2025-04-02 08:20:38 +00:00
sunyuechi
60981494d6 Add x86 CPU check in meson.build for clang build fix
have_avx = cc.has_argument(avx_args)

gcc generates an error when AVX is unsupported, whereas clang only
produces a warning.

Thus, using Clang on the RISC-V platform incorrectly enables AVX file
compilation, leading to build failures.
2025-03-12 20:49:26 +00:00
Wim Taymans
b997ff8ac1 devolpment is 1.5.0 2025-03-11 15:14:03 +01:00
Nikolay Borodin
6620c6cde1 spa: alsa: allow building without UMP in libalsa
Allow building with older libalsa releases that don't have UMP.
2025-03-10 18:12:54 +00:00
Wim Taymans
df1c36aec2 1.4.0 2025-03-06 13:11:38 +01:00
Wim Taymans
e67c1bc734 1.3.83 2025-02-20 15:19:41 +01:00
Wim Taymans
7e5cd195ac 1.3.82 2025-02-06 11:37:00 +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
Wim Taymans
ae758885dd 1.3.81 2025-01-23 09:52:29 +01:00
Arun Raghavan
19c15e2e90 meson: Correctly use fallback for webrtc-audio-processing
If system deps are not found, we need to fallback to
webrtc-audio-processing-2, not webrtc-audio-processing (i.e. 0.3).

Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4493
2025-01-09 15:33:32 -05:00
Arun Raghavan
71e403bbdb spa: aec: Add support for webrtc-audio-processing-2 2025-01-09 12:06:58 +00:00
Barnabás Pőcze
705c2a652b pipewire: module-vban: fix vban serial header
The expression `VBAN_PROTOCOL_SERIAL | vban_BPSList[14]` is assigned
to an 8 bit field of the header, but, `vban_BPSList[14]` being
115200, it does not fit. Instead, its index, 14, should be
placed in the header.

In addition to fixing the issue, add `-Werror=constant-conversion`,
and clang diagnostic that catches such issues.

Fixes: 1a5514e5cf ("module-vban: create streams per stream_name")
2024-12-14 23:09:45 +01:00
Wim Taymans
2b24b27f7f meson: move some filter-graph deps to spa
The filter-graph deps can now be in spa meson
2024-12-09 11:30:04 +01:00
Philip Withnall
88873e295b build: Explicitly disable -Werror=strict-aliasing
Pipewire is designed to be built without strict aliasing enabled (as
evidenced by already hard-coding `-fno-strict-aliasing`). In case people
have strict aliasing warnings enabled by default in their build
environment, explicitly disable errors from those.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-11-22 16:24:51 +00:00
Wim Taymans
7f8ce35709 filter-chain: add support for fftw in the convolver
It's faster than pffft.
2024-10-18 16:26:39 +02:00
Arun Raghavan
050ae8cc56 meson: Prepend some environment variables
We should prepend rather than override these, so we can stack
environments if we want.
2024-10-09 19:39:15 +00:00
psykose
2d071d658f spa: use a separate logind dependency separate from systemd
non-systemd systems also have logind, in the form of elogind, which works to
resolve the v4l2 video source race just as well. permit finding elogind, by
using a separate dep object.
2024-09-21 21:56:34 +00:00
sunyuechi
8166b9c580 spa/support: implement RISCV V CPU detection 2024-09-18 10:40:48 +00:00
Philippe Normand
5ed170f6c4 meson: Fix typo in GStreamer dependencies mapping
Without this the device provider cannot be enabled when building PipeWire as a
GStreamer subproject.
2024-09-11 13:14:26 +00:00
Wim Taymans
2cbcdbc579 videoconvert: add an ffmpeg based video converter
To activate:

PIPEWIRE_PROPS='{ video.adapt.converter = video.convert.ffmpeg }' build/src/examples/video-play

This makes it possible to start firefox with mjpg capture and then
video-play and it will decode the mjpeg transparently. Works for other
incompatible video formats as well, as long as they can be mmapped.

Ideally this should use something GPU accelerated and this is what the
vulkan converter will do.
2024-09-06 12:27:02 +02:00
Nedko Arnaudov
d85c6212b3 jack: set current pipewire version in jack.pc file
jack[server] version has 3 for major
and pipewire's "1000*major + 100*minor + micro" as minor version
2024-08-29 14:22:46 +02:00
Arun Raghavan
70a7bae5d7 resampler: Precompute some common filter coefficients
While this is quite fast on x86 (order of a few microseconds), the
computation can take a few milliseconds on ARM (measured at 1.9ms (32000
-> 48000) and 3.3ms (32000 -> 44100) on a Cortex A53).

Let's precompute some common rates so that we can avoid this overhead on
each stream (or any other audioconvert) instantiation. The approach
taken here is to write a little program to create the resampler
instance, and run that on the host at compile-time to generate some
common rate conversions.
2024-08-08 00:30:24 -04:00
Dylan Aïssi
0c5b2f1154 meson: allow fallback to find_library for readline detection
Fixes: 050a51aa (" meson_options: Add readline option")

Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com>
2024-07-31 15:39:38 +00:00
Wim Taymans
db31586298 development is 1.3.0 2024-07-30 12:07:20 +02:00
Wim Taymans
65f067347d require newer alsa 1.2.10 for UMP support 2024-07-30 10:06:41 +02:00
Eli Schwartz
b5f031bc15 meson: fix conflicting use of feature-based dependency lookups
When spa-plugins is enabled, the gio-2.0 global dependency is
overwritten.

When bluez support is enabled, OR when gsettings is enabled, the gio-2.0
dependency is then detected as found. This means that
pipewire-module-protocol-pulse can end up enabling gsettings support
even if it has been forcibly turned off.

Rename the meson variables to ensure they are looked up separately.
2024-06-30 18:39:38 +00:00
Barnabás Pőcze
ec521ca870 meson.build: enable -Werror=format 2024-06-27 21:18:06 +00:00
Wim Taymans
7b4c0dd5ec 1.2 2024-06-27 15:31:45 +02:00
Wim Taymans
ae7ec595a2 1.1.83 2024-06-18 12:47:40 +02:00
Wim Taymans
1ae4374ccf Fix compilation with -Werror=float-conversion
Better make the conversions explicit so that we don't get any surprises.

Fixes #4065
2024-06-18 12:17:56 +02:00
Eli Schwartz
acd5bf60b9 meson: fix webrtc-audio-processing dependency ignoring configure args
Most dependencies use meson "feature" options for optional
functionality. This allows people to disable them, if they don't want
them, through the power of tristate decision-making.

This particular dependency does something a bit more complicated than
can be described by simply passing feature options to the required
kwarg. It:

- tries to look for two different names of the dependency
- selects different version ranges, depending on the dependency name
- has a hole in the middle of the versions

Unfortunately, `required: false` for the first dependency isn't
equivalent to a tristate decision-making process. We have to manually
code the logic ourselves.

The problem is that when we look up the first name, we cannot pass the
feature option in because if the option is force enabled, then the
dependency lookup fails and configuration never tries to find the older
version instead.

But also, we can't just say it *isn't* required, because if the option
is force *disabled* but it is installed on the system, we still find it
and build against it.

One solution would be using meson 0.60's support for multiple dependency
names:

```
dependency('webrtc-audio-processing-1', 'webrtc-audio-processing',
    version : ['>= 0.2'],
    required: get_option('echo-cancel-webrtc'),
)
```

Unfortunately, this too doesn't work since we could end up detecting 1.1
(the hole in the middle) which is invalid.

Instead, we do a bit of checking for tristate values before deciding to
invoke `dependency()`. This lets us guarantee that disabled dependencies
are well and truly disabled.

Bug: https://bugs.gentoo.org/933218
Fixes: #3678
2024-06-11 07:16:30 +00:00
Wim Taymans
7eeb657d37 1.1.82 2024-05-24 11:48:53 +02:00
Wim Taymans
e37a1e25fc 1.1.81 2024-05-16 10:25:45 +02:00
Barnabás Pőcze
8b35b00d82 meson.build: add -Werror=incompatible-pointer-types 2024-04-23 14:49:34 +02:00
Pauli Virtanen
29614a2c46 doc: fix workaround for old doxygen versions
Fix workaround for old doxygen versions, and put a version requirement
for Doxygen.
2024-04-23 10:59:24 +00:00
Robert Mader
f1b75fc6f8 gst: Add support for DMA_DRM / explicit modifiers
Gstreamer 1.24 added and largely switched to a new, modifier aware
DMABuf API. Unfortunately that breaks the existing DMABuf support in the
PW Gst element.

Add support for the new API.
2024-03-05 12:08:32 +01:00
Wim Taymans
f1a6fabb6c meson: add options to set server and client RT priority
Make a rtprio-server and rtprio-client option. Leave the server
priority by default to 88 but lower client priority to 83. JACK
does something similar by setting clients to rtprio-server - 5.

Make module-rt use the client priority by default and bump the server
priority explicitly in the config file.

Leave the pulse-server to the default rtprio-client, there is no reason
to lower this any further because it is really just a regular client.

Bump the ffado packetizer thread to rtprio-server + 5 because that is
also what JACK does.

88 is still much higher than the value of 60 that JACK uses in
Fedora but now this is at least configurable.
2024-02-15 11:53:32 +01:00
Barnabás Pőcze
b9b5a26199 Apply 1 suggestion(s) to 1 file(s) 2024-01-12 11:35:17 +00:00