Commit graph

89 commits

Author SHA1 Message Date
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
Fabrice Fontaine
8d9dc023ac spa/meson.build: add atomic_dep dependency
Commit fa64d93e64 moved the atomic_dep
from pipewire-jack to pipewire_dep however atomic_dep should also be
added to spa_dev to avoid the following build failure when building
examples (which don't depend on pipewire_dep):

FAILED: spa/examples/adapter-control
/home/buildroot/autobuild/instance-0/output-1/host/bin/sparc-linux-gcc  -o spa/examples/adapter-control spa/examples/adapter-control.p/adapter-control.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -Wl,--start-group -lintl -ldl -pthread -lm -Wl,--end-group
/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: spa/examples/adapter-control.p/adapter-control.c.o: in function `spa_graph_node_trigger':
adapter-control.c:(.text+0xdf4): undefined reference to `__atomic_fetch_sub_4'

Fixes:
 - http://autobuild.buildroot.org/results/192f40a5c6e05fc11507494e19db52a47082fc35
2022-01-25 21:39:04 +01:00
Barnabás Pőcze
ac376106d9 spa: meson.build: export data directory on dependency 2021-12-28 18:41:09 +01:00
Barnabás Pőcze
92a259470c spa: meson.build: only look for libcamera under one name
Commit d06a2e2140
added support for finding libcamera under two different
names. However, due to breaking changes in libcamera[1],
the current codebase only supports the latest version,
thus drop support for the old name.

[1]: see commit 57dae3e2b3
2021-12-28 18:34:54 +01:00
Barnabás Pőcze
2b110af366 treewide: meson.build: use dependency variable for SPA
Use `spa_dep` everywhere instead of `spa_inc`,
and remove `spa_inc` altogether.
2021-12-28 18:34:06 +01:00
Neal Gompa
1216371f8c bluez5: Use libfreeaptx instead of libopenaptx
libfreeaptx is a fork of libopenaptx prior to the dubious licensing
situation was introduced to the library.

As it's fully API compatible, let's use that instead for those who
want to use aptX support.

The library source is available at https://github.com/iamthehorker/libfreeaptx
2021-07-29 15:22:04 +00:00
Barnabás Pőcze
d06a2e2140 spa: meson.build: look for libcamera under another name
libcamera commit ec7afef665a87eb389a5a4cb9ff35e9c24bbcc29 (2021-06-24)
changed the name of the generated pkg-config file from 'camera.pc'
to 'libcamera.pc'.

First look for the libcamera dependency under the new name 'libcamera',
and if that's not found, look for it under the older name 'camera'.

Fixes #1355
2021-06-27 18:24:15 +00:00
Niklāvs Koļesņikovs
b55bafae09
meson.build: move libcamera and libdrm summary() to 'Backend' section 2021-06-25 15:13:07 +03:00
Niklāvs Koļesņikovs
38d5de789d
meson_options.txt: disable vulkan option since it's not ready for use
According to George Kiagiadakis it being set to auto is an accident,
because the Vulkan support does not [yet] provide anything useful.
2021-06-25 15:12:27 +03:00
Ivan
0a02396995 meson: Make summary() respect vulkan headers detection
Fix false positive that caused by summary() checking only for vulkan
library but not headers.
2021-06-25 11:27:31 +00:00
Niklāvs Koļesņikovs
71d39e90ed meson: adds post meson setup/--reconfigure summary for auto features
As suggested by George Kiagiadakis, adds calls to summary() function
for each feature that is by default set to auto, so that an overview
of their effective state is printed at the end of meson setup or
meson --reconfigure command.

Currently ordering is a bit messy but tidying it up would detach
the summary() functions from the dependencies they rely on and could
be done later along with meson_options.txt re-ordering so that the
two match as much as possible.
2021-06-25 08:31:12 +00:00
George Kiagiadakis
2723b0c6e2 meson: export plugin and data dirs for other projects to find them
SPA_PLUGIN_DIR is exported in pkgconfig as 'plugindir'
PIPEWIRE_MODULE_DIR is exported as 'moduledir'
PIPEWIRE_CONFIG_DIR is exported only in uninstalled environments
as 'confdatadir' (not making this public due to the possible upcoming
configuration changes in pipewire)

All variables are also exported on the meson dependency objects,
so that subprojects can find them.

Wireplumber can then find them like this:

  pipewire_moduledir = pipewire_dep.get_variable(
    pkgconfig: 'moduledir', internal: 'moduledir', default_value: '')

... and this works regardless of whether wireplumber is being
configured as a subproject or using the uninstalled pkgconfig files
or using the system installation of pipewire.

This is required in order to run wireplumber tests in the
uninstalled environment with 'meson test'
2021-06-18 19:24:28 +03:00
George Kiagiadakis
7ab5c35cad meson: declare spa_dep and override_dependency() for spa and pipewire
This allows meson subprojects (or projects using pipewire as a meson
subproject) to be able to use dependency('libpipewire-0.3') and
dependency('libspa-0.2') to find the uninstalled versions of these
libraries directly from the build dir instead of going through pkg-config
2021-06-18 17:54:18 +03:00
Huang-Huang Bao
e953bb3238
meson: fix build if bluez5 option is disabled
Don't look up codecs dependencies and don't include 'bluez5' subdir if 'bluez5' option is disabled or libbluetooth is not found.
See https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/707.
2021-05-28 21:01:38 +08:00
Oschowa
8892152b13 meson: Require bluetooth codec library dependencies only when bluez5 is
enabled
2021-05-28 09:49:46 +00:00
Barnabás Pőcze
3baf3fcfec spa: ffmpeg: remove libavformat dependency
`av_register_all()` is the only thing used from libavformat,
but that doesn't seem to be needed for codec enumeration,
so remove it, and call `avcodec_register_all()` instead
when libavcodec < 58.10.100.
2021-05-16 13:10:59 +00:00
Daniel Stone
d08b6fac6b openaptx: Blacklist >= 0.2.1 due to license change
openaptx has recently changed its license to explicitly exclude
'Freedesktop projects' from using it, which would include PipeWire, as
well as shifting to base terms of GPLv3:
    811bc18586

This unilateral license change is legally dubious in many ways.

The original work came from ffmpeg under the LGPL v2.1, to which third
parties may not add additional restrictions (per sections 2 and 7 of the
LGPL v2.1), so LGPLv2.1 + may-not-use restrictions are not permissible
without the explicit consent of the original copyright holder.

The upgrade to LGPL v3.0 without explicit consent from the original
copyright holder is in itself permissible through the upgrade terms of
the LGPL, however the additional restrictions imposed again conflict
with sections 7 and 10 of the GPLv3 (as the base of the LGPLv3, with
those sections not being invalidated by the additional LGPLv3 text).

Though it does not impact the legal validity of the redeclaration of
licensing, the claims that freedesktop.org has violated the terms of the
openaptx license in the past are false; the work was contributed to the
PulseAudio project with an explicit open license, with the original
contributor later attempting to revoke permission for its use, despite
the explicit terms of the license giving no ability to do so as they
lack a change-of-heart provision.

The claims that Collabora violated the license are even more baseless;
they are based on an assertion that when I (acting on behalf of
freedesktop.org rather than Collabora, in my own unpaid time) banned
users from freedesktop.org's GitLab instance due to sustained violations
of the Code of Conduct users agree to when creating an account on that
platform, this somehow constituted a violation of the license. Even if
Collabora were somehow involved in this - which they were not at all -
there is no requirement under open licenses that users be given
unlimited access under all terms to any platform on the internet. Such
terms would mean that open development could only be conducted on
completely unmoderated platforms, which does not stand up to any
scrutiny.

Regardless of the declared license having no legal validity, the LGPL's
explicit provision in both v2.1 and v3.0 for such additional
restrictions to be stripped, and the low likelihood of it ever being
used together with PipeWire as its licensing terms would not be
acceptable to any distribution, enforcing a version check seems like the
safest way to ensure complete legal clarity, not put users or
downstreams in any jeopardy, and comply with the author's stated wishes
for v0.2.1 and above to not be used by PipeWire.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2021-05-11 12:48:24 +00:00
Jonas Holmberg
ad0d7ef9f2 spa: Fix build without v4l2
libudev_dep was not required if only alsa was enabled.
2021-04-22 07:27:14 +00:00
Nils Tonnätt
f47a7a8ea3 Rearrange libudev dependency
Make libudev dependency required if v4l2 feature option is set to enabled or
auto, or if alsa dependency is found or enabled through pipewire-alsa or alsa.
2021-04-18 07:58:49 +00:00
Ivan
529f4d318f meson: Fix build without vulkan headers
Some distros ship Vulkan headers separately. In that case dependency
check is passed but build is failing due to the missing headers.
2021-03-17 20:52:20 +02:00