Commit graph

209 commits

Author SHA1 Message Date
Wim Taymans
22f7a1de28 filter-chain: move filter-chain to a spa_interface
Move the filter-chain code to a filter-graph SPA interface.

The idea is to make this more useful outside of the filter-chain.
2024-11-12 11:32:58 +01: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
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
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
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
e7846fc12a protocol-native: add security context API
Add a new extension that can create a server on a user provided socket
with user provided security properties.

This is mainly used in flatpaks that want to create and bind a pipewire
socket with specific permissions for the flatpak app.

The flatpak will also provide an fd that will be closed when the server
can be removed.
2024-03-13 12:53:04 +01:00
Wim Taymans
1b6370ace1 meson: fix compilation when spa-plugins is disabled
Fixes #3811
2024-02-06 11:50:54 +01:00
Wim Taymans
d71fb40989 pulse-server: move extension to modules
Add extension support to modules. This is a list of extension commands
that can be performed on the module.

Remove the custom registry of extensions and make proper modules that
implement the extensions.

This is more in line with what pulseaudio does. The advantage is that the
modules actually show up in the module list and that we can use the
module user_data to implement the extension later.
2024-01-23 13:31:05 +01: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
Mark Gallagher
bd87902da6 Add a build option to specify whether pulse gsettings schema should be installed 2023-12-16 21:10:00 +01:00
Mark Gallagher
ee42a6868d Add pulseaudio gsettings schema 2023-12-16 21:09:17 +01:00
Barnabás Pőcze
333fd8d2ae pipewire: module-roc-{sink,source}: port to ROC v0.3.X
ROC 0.3 introduced breaking changes, so adjust the code.
Also set the minimum supported ROC version to 0.3.0.

Fixes #3667
2023-11-23 14:12:35 +01:00
WalkerGriggs
03b1d9589b
modules: Check for opus custom functions in addition to headers 2023-11-10 09:57:53 -08: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
Christian Glombek
60d0943c19 module-raop-sink: Port to rtp-module/stream 2023-10-09 10:52:25 +02:00
Wim Taymans
dbf1ea0e78 pulse-server: add alsa source and sink module
See #3456
2023-08-23 11:15:59 +02:00
Wim Taymans
ce8f2c5d10 modules-vban: add vban sender and receiver
Fixes #3380
2023-07-25 18:36:48 +02:00
Wim Taymans
98f138dbe0 filter-chain: move sofa and lv2 to external modules
dlopen lv2 and sofa plugin modules instead of hardcoding them into the+
filter-chain. This also makes it possible to add more plugin module
types externally.
2023-06-29 14:04:40 +02:00
Wim Taymans
5d177acc53 meson: clean up echo-cancel sources 2023-06-29 12:12:10 +02:00
Wim Taymans
4b32b1fef0 modules: add example filter 2023-06-27 14:02:38 +02:00
Niklāvs Koļesņikovs
e4cc63a6dc src/modules/meson: ensure Opus libs were actually found, too
The old way fails, if a distro has the header but not the library,
which can happen on at least Gentoo with multilib deployments,
where the shared header is present but non-native libraries might not.

This could still fail, if a distro had some but not all libraries for
some architectures but hopefully no one did that. In that case, a compile
test would likely be required via cc.check_header() instead but let's try
the faster fix first.

Reported-by: Sam James <sam@gentoo.org>
Thanks-to: Barnabás Pőcze <pobrn@protonmail.com>
Thanks-to: Xavier Claessens <xavier.claessens@collabora.com>
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
2023-06-26 15:21:49 +00:00
Wim Taymans
7c7e814b02 modules: build virtual sink/source 2023-06-16 16:24:49 +02:00
Niklāvs Koļesņikovs
3be07c7de2
src/modules/meson: make Opus custom modes optional for NetJack2
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
2023-06-14 13:54:08 +03:00
Wim Taymans
8dfb22d12b module-netjack2: add opus support 2023-06-12 11:44:50 +02:00
Wim Taymans
2cc0fe0b3c module-netjack2: add netjack2 manager
This module listens for messages from netjack2 drivers and makes a sink
and source filter to send and receive data from the remote driver.
2023-06-01 18:36:07 +02:00
Wim Taymans
991a1558dc module: add a netjack2 driver module
The module advertizes itself on multicast and will trigger a new client
in the netjack2 manager. Tested with jack2 and 'jack_load netmanager'.

The driver will receive and send data (no midi yet) from and to the
manager in sync with the manager, without resampling and with a fixed
latency.
2023-05-31 17:22:05 +02:00
Wim Taymans
3c44634dd8 modules: add ffado driver module 2023-05-28 15:53:58 +02:00
Wim Taymans
0629647cb5 module-jack: load libjack.so.0 with dlopen
This way we can search for the real jack library instead of using our
custom libjack.so. Add an option to override the search path with
LIBJACK_PATH and an option to select the library name to load.
2023-05-05 15:42:14 +02:00
Wim Taymans
b13e9f7a8d pipewire-pulse: add module-jackdbus-detect 2023-05-04 18:46:36 +02:00
Wim Taymans
90c8cb42ff meson: fix filename 2023-04-30 10:39:06 +02:00
Wim Taymans
4a81c17b68 modules: add jackdbus-detect module
Loads jack-tunnel based on jackdbus state.
2023-04-30 10:34:19 +02:00
Wim Taymans
ab0cee29dd doc: add jack-tunnel to docs 2023-04-27 17:03:10 +02:00
Wim Taymans
73f5f7ae65 jack-tunnel: add a new 0-latency JACK sink/source module
Add a new JACK sink/source pair that translates to a single JACK
client.

The JACK playback port appears as PipeWire source and is processed
directly, synchronously, through the complete pipewire graph into
the PipeWire sink that is then made available on the JACK capture
ports.

Because all this happens in the same JACK cycle with no delay, the
latency is 0. A jack_iodelay on the JACK server has exactly the same
latency as the jack_iodelay on the PipeWire side.

The PipeWire sink and source are forced into the same rate and
buffer_size as the JACK server and can't dynamically change.

This only supports Audio for now.
2023-04-27 16:27:54 +02:00
Wim Taymans
d13099b9ff docs: add rtp-sap and rtp-session modules to docs 2023-03-15 18:01:15 +01:00
Wim Taymans
345582dd15 module-rtp: add opus encoding 2023-03-12 18:40:36 +01:00
Wim Taymans
670bf8fe8f echo-cancel: add wav debug file support 2023-03-09 16:31:30 +01:00
Wim Taymans
be09198249 module-rtp: port source and sink to new stream 2023-03-09 13:14:22 +01:00
Wim Taymans
cb1e5661dc move SAP in separate module
The idea is to have the rtp-source and rtp-sink be separate modules that
can be loaded a static ip/port as well.

The SAP module would then expose existing rtp-sinks or additionally load
rtp-sources based on SAP messages.

This makes things a bit more flexible when we also want to expose the
rtp-sink using zeroconf, for example.
2023-03-09 13:14:22 +01:00
Wim Taymans
3badf6f3ac module-rtp: move avahi in rtp-session
It needs to be there because we need to be able to relate
zeroconf entries to udp connections.
2023-03-09 13:14:21 +01:00
Wim Taymans
7da031c969 module-rtp: add new rtp-session module
The module uses the apple session setup for managing peer connections.

Make a generic rtp stream object, make midi and audio implementations.
2023-03-09 13:14:21 +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
Niklāvs Koļesņikovs
d082ec0809
src/modules/meson.build: fix indentation and remove obsolete comment
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
2023-02-14 17:37:59 +02:00
Dmitry Sharshakov
9399fc318e spatializer: move to sofa_plugin 2023-01-30 21:07:06 +03: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
Wim Taymans
fba7083f8c modules: also install module-combine-stream 2023-01-26 11:57:45 +01:00
Wim Taymans
29787b51ef modules: add combine-stream module
The module can:

- Make a sink that sends all or some channels to other sinks.
- Make a source that combines multiple sources into one.

The selection of what streams to combine is implemented with rules so
that the selection is very configurable. By default all Audio/Sink or
Audio/Source nodes are selected.
2023-01-23 17:06:56 +01:00
Barnabás Pőcze
73c5f6e1bf pipewire: module-roc-{sink,source}: port to ROC v0.2.X
Incompatible changes between ROC v0.1.X and v0.2.X require
adjusting the ROC modules' code. The largest change is going
from `roc_address` to `roc_endpoint`. There is also a breaking
change, the removal of `local.ip` parameter from module-roc-sink
as `roc_sender_bind()` has been removed.

The API usage was modelled after https://github.com/roc-streaming/roc-pulse

See #1757
Fixes #2911
2022-12-29 10:13:30 +00:00
Wim Taymans
0f2f113bdc filter-chain: add optimized sum function 2022-12-16 10:19:20 +01:00
Dmitry Sharshakov
7950d3ff0d filter-chain: convolver: resample IR
Ensure correct filtering when node rate does not match filter rate
2022-12-13 10:09:55 +00:00
Wim Taymans
b29200ee82 pulse-server: add a pulse.cmd section
Add a new config section that can contain a set of commands to run after
starting.

There is only load-module available now but it can be used to remove the
dependency on pactl when starting the server.
2022-12-12 16:46:16 +01:00