Commit graph

108 commits

Author SHA1 Message Date
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
Pauli Virtanen
5fa137cc0d meson.build: make spa-json-dump available for subprojects
Add override that provides host binary for subprojects to use.

Also fix cross-compilation to use the host binary.
2025-07-23 12:19:21 +00:00
Wim Taymans
efa4d31cfb meson: use libonnxruntime so that the .pc file can be found 2025-07-17 14:02:19 +02: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
e9a0ac1346 spa: allow disabling deps via -Debur128/-Dudev
With .enabled(), Meson doesn't have some magic that packagers rely on
to explicitly disable finding a dependency if an option is off. Drop
the unnecessary .enabled() accordingly.
2025-06-28 07:55:54 +00:00
Pauli Virtanen
9f34e962a6 bluez5: backend-native: don't hardcode available HFP codecs
Remove most hardcoding of possible HFP codecs. Instead, get what is
available from codec lists.
2025-06-13 17:51:16 +00: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
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
Wim Taymans
9b2b420cf5 spa: we need ALSA >= 1.2.11 for snd_seq_ump_ev_clear() 2025-03-19 17:53:05 +01:00
Pauli Virtanen
fd5bd5ca6e spa: fix ALSA UMP support detection in meson 2025-03-10 18:12:54 +00: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
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
Barnabás Pőcze
bf5d5f0201 spa: define feature macro without value
This is how it is done everywhere else.
2024-12-14 23:28:43 +01: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
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
Wim Taymans
d966a36fdd spa: compile all function into libspa.so 2024-11-26 11:58:51 +01: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
Wim Taymans
1b6370ace1 meson: fix compilation when spa-plugins is disabled
Fixes #3811
2024-02-06 11:50:54 +01:00
Wim Taymans
b4c7973d49 meson: fix build with missing libudev-devel 2024-02-06 11:49:40 +01:00
Barnabás Pőcze
4aa2e44796 spa: move dbus helpers out of bluez plugin
The file is moved into a new "include-private" directory. This is done
because otherwise adjustments would have to be made to the list of installed
headers, the way include tests currently work and which files are
used for generating documentation.
2024-02-05 13:03:20 +00:00
Pauli Virtanen
fe412784a4 bluez5: support LC3-SWB in HFP RFCOMM & add codec id for it
HFP 1.9 adds LC3 as a possible codec in addition to CVSD & mSBC.
E.g. Pixel Buds Pro latest firmware supports it.

Add the RFCOMM side and codec selection for it.
2024-01-25 08:43:45 +00:00
Barnabás Pőcze
4b145ad444 spa: libcamera: bump minimum supported version to 0.2.0 2024-01-11 12:04:27 +00:00
Gioele Barabucci
b31cf7ac30 spa/meson.build: Look for udev rules in /usr by default
`/usr/lib/udev/rules.d` is the path specified in udev(7) [1], as well as
the location for udev rules in all current major distributions.

[1] https://github.com/systemd/systemd/blob/v254/man/udev.xml#L51
2023-12-02 10:08:12 +01:00
Pauli Virtanen
422c270a74 meson.build: fix compile with -Dexamples=disabled 2023-11-28 10:18:25 +00:00
columbarius
886ca8f004 build: increase required vulkan version
We require VK_EXT_KHR_synchronization_2 to build, which seems to be
added to libvulkan at 2.1.170 [1].

[1] 1d99b835ec
2023-10-15 20:32:57 +00:00
columbarius
6064e5087e build: Restructure vulkan dependency handling and assert headers
vulkan_headers was a workaround for distributions providing pkg-config information
without the headers. Replacing it with a more conventional have_vulkan
and assert header availability if the option vulkan is enabled.
2023-10-15 20:32:57 +00: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
Robert Mader
5bac089229 spa: libcamera: add libcamera version check for properties::SystemDevices 2023-07-19 09:21:03 +00:00
Pauli Virtanen
6c0434ec9c spa: fix wrong meson check for BAP 2023-03-26 15:12:55 +03:00
Pauli Virtanen
aa06c547d9 bluez5: align audio output of all BAP sinks
Make BAP nodes align the first sample of their packets at multiples of
the ISO interval, counted in the shared graph sample position.  This
skips a few samples (< 10ms) at the start of playback to ensure the
alignment.

Since the sinks align their flush timing to the graph time, this also
results to them sending packets corresponding to the same graph time at
the same real time instants.

Due to packet queues in kernel/controller, the playback may still be off
by multiples of packets. Kernel changes are needed to address that part.

This works towards making BAP left and right channels to be
synchronized in TWS headsets, where the two earpieces currently appear
as different devices.
2023-03-19 19:18:10 +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
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
Pauli Virtanen
417f1dc02a bluez5: fix dependency checking
Don't do subdir_done() in bluez5/meson.build, since the presence of
dependencies is supposed to be checked in spa/meson.build.
2023-02-05 09:36:45 +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
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
Pauli Virtanen
de595a78ff bluez5: add GDBus-based object monitor framework 2023-01-24 08:27: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
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
af4875eb47 avb: remove libavtp dependency 2022-07-12 12:27:21 +02:00
Wim Taymans
f95b8263e6 avb: more improvements 2022-07-12 12:27:21 +02:00
Pauli Virtanen
6ccb939267 bluez5: use lc3plus.h instead of lc3.h
The file name "lc3.h" in the ETSI LC3plus package may conflict with the
actual LC3 codec, so try to find a file "lc3plus.h" instead.  Also try
to find a pkg-config dependency for it first (in which case use lc3.h,
assuming it's in different directory).  This can be fine tuned, if
something starts to package that library.
2022-05-03 00:29:47 +03: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
columbarius
7155913553 Revert "spa: set _GNU_SOURCE"
This reverts commit a2e98e28c1.
2022-04-05 17:13:18 +00:00
ErikMN
a2e98e28c1 spa: set _GNU_SOURCE
Set CFLAG _GNU_SOURCE in order to suppress warnings about implicit
declaration from strtof_l and strtod_l.
2022-04-02 09:32:40 +02:00
Barnabás Pőcze
cc73053512 treewide: meson.build: use feature.allowed()
Since meson 0.59.0, a feature object has an `allowed()`
method which returns true when the feature is set to
'enabled' or 'auto'.

Utilize that instead of the previously used

  not feature.disabled()
2022-02-04 00:15:59 +01:00