Commit graph

103 commits

Author SHA1 Message Date
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
Wim Taymans
6605caa39e filter-graph: add ONNX plugin
It uses the onnxruntime library to parse the onnx file and construct a
neural network. It uses the label field to setup the plugin and how to
map the various tensors of the model to input, output, control and
notify ports.

Add an example config for how to use the silero VAD ONNX model with the
noise gate.
2025-07-17 13:16:00 +02:00
Pauli Virtanen
87843366ce bluez5: add PLC for MSBC using spandsp
Use spandsp as optional dependency for MSBC codec, for providing PLC.
2025-07-12 19:59:33 +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
Pauli Virtanen
4c51e6518b bluez5: ldac decoding support
Add support for LDAC decoding, if libldac decoder is available.
2025-04-10 13:22:57 +00:00
Sanchayan Maity
41d099a580 bluez5: Add G722 codec for ASHA
For documentation on ASHA, see
https://source.android.com/docs/core/connect/bluetooth/asha
2025-01-09 14:51:50 +00:00
Wim Taymans
df271d13f3 filter-chain: add ebur128 filter
The EBU R128 filter measures the signal and generates LUFS control
notifications for further processing.

It also adds a plugin that can convert LUFS to a gain (based on a target
LUFS).

Also add an example filter-chain to enable the EBU R128 measurement and
how to use the results to adjust the volume dynamically.

See #2286 #222 #2210
2024-12-09 11:31:33 +01: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
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
Pauli Virtanen
da1a5568a1 doc: add options to change what /usr and /etc paths are shown
Add options to change the 'prefix' and 'sysconfdir' values shown in
documentation, e.g. on config file man pages.

Update CI to set them, so that its produced output doesn't show
/builds/pipewire/... on man pages
2024-03-10 22:25:42 +02: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
Sergio Costas Rodriguez
5125d69a69 Better meson_options description 2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez
d568dcd64f pipewire-pulse: add snap permissions support
SNAP containers have two main "audio" security rules:

 * audio-playback: the applications inside the container can
   send audio samples into a sink

 * audio-record: the applications inside the container can
   get audio samples from a source

Also, old SNAP containers had the "pulseaudio" rule, which just
exposed the pulseaudio socket directly, without limits. This
is similar to the current Flatpak audio permissions.

In the pulseaudio days, a specific pulseaudio module was used
that checked the permissions given to the application and
allowed or forbade access to the pulseaudio operations.
With the change to pipewire, this functionality must be
implemented in pipewire-pulse to guarantee the sandbox
security.

This patch adds support for sandboxing permissions in the
pulseaudio module, and implements support for the SNAP audio
security model, thus forbiding a SNAP application to record
audio unless it has permissions to do so.

The current code for pipewire-pulseaudio checks the permissions
of the snap and adds three properties to each new client:

 * pipewire.snap.id: contains the Snap ID of the client.

 * pipewire.snap.audio.playback: its value is 'true' if the client
   has permission to play audio, or 'false' if not.

 * pipewire.snap.audio.record: its value is 'true' if the client
   has permission to record audio, or 'false' if not.

These properties must be processed by wireplumber to add or
remove access permissions to the corresponding nodes. That
code is available in a separate patch: https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_requests/567
2024-01-12 11:35:17 +00:00
Barnabás Pőcze
e6c2e8465e meson_options: pass proper boolean values to boolean options
Passing strings has been deprecated:
https://mesonbuild.com/Release-notes-for-1-1-0.html#coercing-values-in-the-option-function-is-deprecated
2024-01-05 03:43:46 +01:00
Mark Gallagher
bd87902da6 Add a build option to specify whether pulse gsettings schema should be installed 2023-12-16 21:10:00 +01:00
Pauli Virtanen
ffa52fdbc1 meson.build: separate options for installing man pages or docs 2023-11-25 00:14:18 +02:00
Pauli Virtanen
0fbcc87314 doc: make all manpages with Doxygen
Use (fixed-up) Doxygen manpage output for all program & module manpages.

This also allows formatting the manual pages properly in the HTML docs.

The Markdown pages work properly only with Doxygen >= 1.9.7, older
versions put them to wrong place in the HTML docs.
2023-11-22 20:10:49 +02:00
Pauli Virtanen
c29d4d4ab7 meson.build: make pandoc optional
Skip only pandoc-requiring parts if it is not available.
2023-11-21 17:00:45 +00:00
Pauli Virtanen
72462ebd07 module-protocol-native: add module argument 'sockets'
Add module argument 'sockets' for creating multiple sockets clients can
connect to.

Also allow setting socket file permissions.
2023-10-11 19:08:18 +03:00
Pauli Virtanen
cd3375f39e meson.build: enable LC3 by default
Enable LE Audio support by default if liblc3 is present, the Pipewire
implementation should be OK. Remove unused HAVE_BLUETOOTH_BAP define,
we don't have any #ifdefs for this.

The feature is still disabled by default in BlueZ, which also now takes
care of necessary hardware feature checks, and should be safe to enable
on Pipewire side.
2023-07-25 07:26:21 +00:00
Wim Taymans
3c44634dd8 modules: add ffado driver module 2023-05-28 15:53:58 +02:00
Wim Taymans
345582dd15 module-rtp: add opus encoding 2023-03-12 18:40:36 +01:00
Carlos Rafael Giani
031f992981 alsa-compress-offload-sink: major sink rework
* Add support for running the sink as a driver
* Detect which compressed formats are actually supported
* Correctly open/close/start/stop device according to the node commands
* Shift away from tinycompress and use Compress-Offload ioctls directly
  to be able to access various caps information (including fragment sizes)
  which are unavailable in the tinycompress API
* Implement SPA_PARAM_PropInfo and SPA_PARAM_Props support
2023-02-24 14:15:13 +01:00
Niklāvs Koļesņikovs
5e0bfa0beb
RLIMITs: add support for generating limits.d files
This commit implements generating /etc/security/limits.d/20-pw-defaults.conf and
/etc/security/limits.d/25-pw-rlimits.conf files. The numbering is arbitrary and
may very well warrant being in the reverse order, however `man 5 limits.conf`
does not appear to specify the parsing order or even say exactly how multiples
matches will resolve, so the value can be adjusted later, if required.

The actual limit values, the match rule and even whether each file is to be
installed can be changed via the build system before compilation. Likewise
the files can be modified or (re)moved during distro package building phase.

The 20-pw-defaults.conf should only be installed on legacy systems lacking both
a modern kernel and up to date systemd, because all it does is set the current
Linux default. Accordingly its not installed by default.

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
2023-02-14 17:37:59 +02:00
Dmitry Sharshakov
57f19959a7 meson: drop unnecessary option
Co-authored-by: Barnabás Pőcze <pobrn@protonmail.com>
2023-02-10 09:21:58 +00:00
Dmitry Sharshakov
3d971b4024 meson: allow building libcamera from source as a subproject
Many distributions provide outdated libcamera versions. This change should also help making changes to libcamera itself.

System libcamera is kept a default to avoid breaking existing build processes relying to packaged libcamera.
2023-02-10 09:21:58 +00:00
Dmitry Sharshakov
3e0dc2678b filter-chain: add spatializer
SOFA is a file format used for storing and accessing spatial audio data, namely head-related transfer functions. These can be used to create binaural spatial sound using head- or earphones.

This commit introduces libmysofa as an optional dependency for loading SOFA files and creates a spatializer plugin for the filter-chain

ci: install libmysofa-devel for full build

ci: bump FDO_DISTRIBUTION_TAG
2023-01-30 21:07:06 +03:00
Carlos Rafael Giani
f07bb84348 meson: Set default compress-offload option value to "disabled"
The tinycompress library is not in the package repositories of the
major Linux distributions, so set the default option to "disabled".
2023-01-24 08:44:14 +00:00
Carlos Rafael Giani
6284cf39c0 meson: Rework FFmpeg / tinycompress detection and add pw-cat-ffmpeg option
* Decouple FFmpeg integration in pw-cat from the ffmpeg option; if
  one wants to use Compress-Offload but not the ffmpeg SPA plugin,
  it is then possible to just pass -Dpw-cat-ffmpeg=enabled to meson.
  Likewise, this also makes it possible to build the ffmpeg plugin
  without extending pw-cat.
* tinycompress does not need to be detected in the root meson.build,
  since it is only needed by the alsa plugin.
2023-01-24 08:44:14 +00:00
Carlos Rafael Giani
e9a2c6aa34 Rename "compressed-offload to "Compress-Offload" in the code 2023-01-24 08:44:14 +00:00
Sanchayan Maity
6a034cc398 Add support for ALSA compressed offload
See
https://docs.kernel.org/sound/designs/compress-offload.html
https://github.com/alsa-project/tinycompress
2023-01-24 08:44:14 +00:00
Wim Taymans
37439d2b73 pulse-server: add gsettings module
Uses a thread to monitor gsettings data. Loads and unload modules
based on gsettings.

This makes paprefs work.
2022-12-07 09:45:43 +01:00
Niklāvs Koļesņikovs
0da1a3ba82
meson_options.txt: Disable the legacy volume SPA
The volume plugin was an experiment that's not really used anywhere
that we're aware of. As such it makes sense to switch the default to
disabled state and skip building something no one probably needs.

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
2022-11-28 16:18:33 +02:00
Jonas Holmberg
050a51aab3 meson_options: Add readline option
Make it possible to disable code that depends on readline even if
readline is pulled in by another dependency, like bluez.
2022-11-07 16:16:12 +01:00
George Kiagiadakis
33e8667cfc meson_options: change default session manager to wireplumber 2022-10-18 14:51:56 +00:00
Frédéric Danis
28533cb615 bluez5: backend-native: Add a ModemManager dependency
Some Linux phones doesn't use oFono but ModemManager to control the modem.
2022-10-05 19:31:50 +00:00
Frédéric Danis
201fd7755d bluez5: Add LC3 codec support to LE Audio BAP
By default this codec is disabled as the BlueZ support for LE Audio is
still experimental.
2022-09-15 11:17:20 +00:00
Pauli Virtanen
3730e54484 modules: support getting app_id in pw_check_flatpak
Support getting the Flatpak application ID from the .flatpak-info file,
similarly as what xdg-desktop-portal does.
2022-08-01 19:36:00 +00:00
Pauli Virtanen
434cc6a90b bluez5: add Opus as a (Pipewire-specific) A2DP vendor codec
Support Opus as A2DP vendor codec.

The specification for vendor A2DP codec is our Pipewire-specific one, so
it is compatible only with devices running Pipewire.
2022-07-19 13:44:56 +00:00
Wim Taymans
1adc94df11 start of AVB support 2022-07-12 12:27:21 +02:00
Pauli Virtanen
9e59a56894 bluez5: add LC3plus A2DP vendor codec
Implement codec plugin for the LC3plus codec, supporting the LC3plus
encoder/decoder from Fraunhofer.
2022-05-01 15:09:00 +03:00
Carlos Rafael Giani
e8f93c3e1e meson: Add option to enable/disable legacy RTKit module
The RTKit module is being replaced by the RT module. Currently, it is
always built if D-Bus is present. For packagers, it can be beneficial to
be able to disable the legacy module. Add a Meson option to allow for
exactly that. Make it enabled by default to not change default behavior.
2022-03-31 07:07:40 +00:00
Barnabás Pőcze
d6c5da5678 pipewire: module-x11-bell: mark connection as terminatable
Since XFixes version 6[1] it is possible to mark
an X connection as terminatable. The X server will
gracefully terminate after a timeout if only
terminatable connections remain.

[1]: https://gitlab.freedesktop.org/xorg/lib/libxfixes/-/merge_requests/1
2022-02-18 12:30:53 +01:00
Wim Taymans
0cd0ef5912 modules: add x11-bell module
It listens for X11 bell events and plays a sample with libcanberra.

Fixes #1668
2022-01-21 16:30:02 +01:00
Timo Gurr
814d409501 systemd: Add systemd-system-unit-dir override 2022-01-06 12:17:10 +00:00
Wim Taymans
597b332666 filter-chain: add support for lv2 plugins
Support lv2 plugins and their control values.
2021-12-10 17:44:28 +01:00
Niklāvs Koļesņikovs
ceeaf6c2f9 meson: add -Draop switch for OpenSSL dep control
Even though OpenSSL is very common, automagic dependencies
are still not great, so let's have a raop switch to control
that.
2021-11-13 12:07:33 +00:00
Peter Hutterer
6fab8fabca meson: add a libv4l2-path option to match libjack-path
pw-v4l2 uses the gnu ld's ${LIB} features, see meson.build.
Make it possible to work around this by specifying an explicit path,
just like for pw-jac.

Fixes #1751
2021-10-28 07:38:02 +00:00
Tom Briden
6cea8b201b meson: Allow session-managers option to be an absolute path
If it's not an absolute_path, then set the build_ms and build_wp
as normal, otherwise use the value as passed in.
2021-10-27 08:27:53 +00:00
Wim Taymans
e68fd36f90 pipewire-v4l2: the start of a v4l2 LD_PRELOAD library 2021-10-14 10:16:35 +02:00