Commit graph

192 commits

Author SHA1 Message Date
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
Peter Hutterer 7177d82c34 test: check for CAP_SYS_PTRACE before testing for an attached debugger
If we don't have the capability to ptrace, we are probably running inside a
container, not the debugger. Check this first so we don't disable forking
mode.

Make this conditional on libcap - where libcap is not available always assume
we *do not* have a debugger attached. This is easier than telling everyone who
runs the tests in a confined system to install libcap.

Fixes #1285
2021-06-10 09:36:12 +02:00
Peter Hutterer 2d238f1d33 meson.build: drop config.h.meson
This seems to be a leftover from the autotools conversion but it
does not provide huge benefits. Meson's default behavior is to generate a
header like this, the main advantage of a config.h.meson header is to *filter*
things that should show up in the config.h file. That comes at the cost of
having to #mesondefine every single variable we want.

In most cases, it's easier with meson to just use different configuration_data
objects instead - which we do for most of the code.

The new header file is identical to the old one, discounting comments, sort
order and the following #defines that didn't end up in the config.h before:
  HAVE_STRNDUPA
  HAVE_STDDEF_H
2021-06-10 09:31:47 +02:00
Peter Hutterer 0cd0d6e826 meson.build: split the version data into a separate config
Use this for the version.h file so we enforce that being used everywhere
instead of accidentaly relying on whatever ends up in config.h.

The generated version.h file is identical.
2021-06-10 09:30:56 +02:00
Peter Hutterer b5e98027b7 meson.build: drop VERSION, use PACKAGE_VERSION in the C sources
Slightly better namespaced since it's not usually used anywhere else, VERSION
is too generic.
2021-06-10 09:30:56 +02:00
Peter Hutterer c4e3efbcf8 meson.build: drop PIPEWIRE_PACKAGE_ORIGIN and PIPEWIRE_LICENSE defines
These seems to be a copy/paste from GST_* but was never actually used anywhere
in our tree.
2021-06-10 09:30:56 +02:00
Peter Hutterer 66abafaa3d meson.build: drop the PIPEWIRE_PACKAGE_NAME define
The only user of this was the dbus protocol, dropped in 7cbdaeb3b6
2021-06-10 09:30:56 +02:00
Peter Hutterer 478e1cc516 meson.build: define WORDS_BIGENDIAN if need be
Drop the Apple-specific defines from config.h.meson - this was never true in
the meson build anyway as nothing set the AC_APPLE_UNIVERSAL_BUILD and the
else condition only undef'd WORDS_BIGENDIAN if... it was not defined.

Drop this and replace it with a meson endian check. There is only one source
file that checks for this #define in spa/plugins/alsa/acp/compat.h, let's hope
nothing breaks here.
2021-06-10 09:30:56 +02:00
Peter Hutterer 14eb43ea86 meson.build: check for SYS_pidfd_open 2021-06-10 15:19:20 +10:00
Peter Hutterer 731f45ed50 test: add sigabbrev_np() for systems where it's not available
sigabbrev_np() was first added to glibc 2.32 (Aug 2020) which is too recent
for some of the distributions we support.
2021-06-10 15:13:57 +10:00
Peter Hutterer ed3f882fa9 test: add the pwtest test framework
Heavily inspired by libinput's litest framework (built around check), this is
a from-scratch framework that simplifies adding tests for various parts of
pipewire. See the pwtest.h documentation for details but the basics are:

- PW_TEST() and PWTEST_SUITE() specify the tests to be run
- Test are run in forked processes, any errors/signals are caught and printed
  to the log
- Tests have a custom pipewire daemon started on demand to talk to [1]. The
  daemon's log is available in the test output.
- Output is YAML to be processed into whatever format needed

[1] There are limits here, since we can't emulate devices yet there is only
so much we can rely on with the daemon.
2021-06-09 18:00:06 +10:00
Peter Hutterer 0054319d88 meson.build: add -D_GNU_SOURCE to the project arguments
This appends it to every compilation command so we can get rid of the c_args
for (almost all) executables.
2021-06-09 07:47:51 +00:00
Wim Taymans e857856be7 0.3.30 2021-06-09 09:14:11 +02:00
Peter Hutterer d9cc1a25f1 Include the valgrind headers in our tree
These headers are designed for including in the project. So the user doesn't
need to install valgrind-devel and we don't have to worry about whether the
headers are available or not.
2021-06-07 10:44:27 +00:00
Barnabás Pőcze 4e5b20b1f5 meson.build: add devenv
Add meson devenv with the appropriate env variables
set up. Largely based on pw-uninstalled.sh
2021-06-05 15:49:17 +02:00
Wim Taymans 1b484867eb 0.3.29 2021-06-03 12:01:53 +02:00
Arun Raghavan d95870d8d3 module-echo-cancel: Wire up the webrtc echo canceller
Mostly uses the existing infrastructure, but the webrtc canceller has a
fixed blocksize, so we:

  1. Use the canceller blocksize if configured
  2. Accumulate output data in a ringbuffer
  3. Push out the data in the required chunk size
2021-06-02 17:56:40 -04:00
Fabrice Fontaine fa64d93e64 fix linking with -latomic
Linking with -latomic has been added to pipewire-jack since
b8c58c74d8

However, this is not the right place to add this dependency, atomic_dep
should be added to pipewire_dep to avoid the following build failure:

/home/giuliobenetti/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/9.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: src/pipewire/libpipewire-0.3.so.0.326.0.p/filter.c.o: in function `impl_node_process':
filter.c:(.text+0xf28): undefined reference to `__atomic_fetch_add_4'

Indeed, atomic operation such as __atomic_fetch_add is used in libcamera
as well as in ./spa/plugins/libcamera/libcamera_wrapper.cpp,
./spa/include/spa/utils/ringbuffer.h and ./spa/include/spa/graph/graph.h

Fixes:
 - http://autobuild.buildroot.org/results/b5305e8e7dd1a5e8bfaba72b06251056ba7d1af1

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-05-24 08:33:50 +00:00
Wim Taymans fb55cc4786 0.3.28 2021-05-19 10:11:36 +02:00
Wim Taymans 1609126bcd conf: move config file to datadir
Install the config file in $PREFIX/share/pipewire so that a factory
reset can be done by wiping /etc and /home.
Add this new directory to the search path.
System wide config can still be done in /etc, user config in
$HOME/.config/pipewire/ by copying files from $PREFIX/share/pipewire

Fixes #1191
2021-05-17 16:22:31 +02:00
Wim Taymans 31d79f4c9b Clarify license
fixes #1174
2021-05-14 12:09:33 +02:00
Wim Taymans 6744934734 zeroconf: add avahi zerconf discover module
Discovers remote sinks and sources and load the tunnel module to
make a local sink and source for them.
2021-05-14 09:09:48 +02:00
Wim Taymans 44f326013b module-pulse-tunner: add module to tunnel to PulseAudio
Add a module that can make a source or sink that tunnels audio
to or from a (remote) PulseAudio server.
2021-05-12 15:56:59 +02:00
Wim Taymans e598d0a422 0.3.27 2021-05-06 10:22:37 +02:00
Fabrice Fontaine ce89ce3844 meson.build: fix build with uclibc-ng
Build with uclib-ng fails since commit
a4b0b9afe5 on:

FAILED: src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o
/srv/storage/autobuild/run/instance-2/output-1/host/bin/mips64el-linux-gcc -Isrc/pipewire/libpipewire-0.3.so.0.326.0.p -Isrc/pipewire -I../src/pipewire -Isrc -I../src -I. -I.. -Ispa/include -I../spa/include -fdiagnostics-color=always -pipe -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -fvisibility=hidden -Werror=suggest-attribute=format -Wsign-compare -Wpointer-arith -Wpointer-sign -Wformat -Wformat-security -Wimplicit-fallthrough -Wmissing-braces -Wtype-limits -Wvariadic-macros -Wno-missing-field-initializers -Wno-unused-parameter -Wno-pedantic -Wold-style-declaration -Wunused-result -DFASTPATH -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -fPIC -pthread -DHAVE_CONFIG_H -D_GNU_SOURCE -D_POSIX_C_SOURCE -MD -MQ src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o -MF src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o.d -o src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o -c ../src/pipewire/impl-core.c
../src/pipewire/impl-core.c:54:9: error: conflicting types for 'getrandom'
 ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) {
         ^~~~~~~~~
In file included from ../src/pipewire/impl-core.c:34:
/srv/storage/autobuild/run/instance-2/output-1/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:28:12: note: previous declaration of 'getrandom' was here
 extern int getrandom(void *__buf, size_t count, unsigned int flags)
            ^~~~~~~~~

Fix this build failure by adding -D_GNU_SOURCE as getrandom is protected
by:

if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU

Extracted from:
 - https://github.com/wbx-github/uclibc-ng/blob/master/libc/sysdeps/linux/common/sys/random.h

Fixes:
 - http://autobuild.buildroot.org/results/a45f0ee009d90cef867dee4b1093225610fa10df

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-05-05 08:04:51 +00:00
Evgeniy Khramtsov 4d064a3718 meson: prefer libintl on FreeBSD
FreeBSD does not have gettext in libc.
It is implemented in the third-party library.
2021-04-23 22:57:51 +03:00
Wim Taymans f0fc4f7fc6 0.3.26 2021-04-22 11:58:59 +02:00
Wim Taymans 5f09e302a9 pipewire: add i18n initialization
Initialize the i18n support.
Add two methods to call the i18n interface.
Add defines for _() and N_() for translations.
2021-04-15 17:56:40 +02:00
Peter Hutterer 223f20709d meson: replace join_paths(a, b) with a / b
More readable and from the meson reference manual:
(since 0.49.0) Using the/ operator on strings is equivalent to calling join_paths.
2021-04-15 06:57:00 +00:00
Peter Hutterer 6eb4114238 meson: fix handling of the alsa option
Option 'pipewire-alsa' is a meson feature and defaults to 'auto'. This is
different to 'disabled', so on systems where alsa's deps weren't available
we would still end up trying to build. Switch to checking alsa_dep.found()
instead.
2021-04-14 09:59:06 +10:00
Wim Taymans c324107211 0.3.25 2021-04-06 15:51:02 +02:00
Arseny Maslennikov 403f27c531 meson, pw-top: use ncursesw
Some PulseAudio clients are known to use localised client and
stream names as values for the respective PulseAudio props, most
notably plain old pavucontrol.

We call setlocale before anything else for ncurses to display
localised text correctly. We also want to link with ncursesw, which
supports multibyte Unicode locales.
2021-03-25 11:22:52 +00:00
Wim Taymans c81d44e8a9 0.3.24 2021-03-18 14:50:04 +01:00
Jan Alexander Steffens (heftig) 9cdf3d1a0b meson.build: Check strndupa using has_header_symbol
It's a macro here, which has_function misses, at least from meson
0.57.1.
2021-03-13 14:49:35 +00:00
Thibault Saunier 485bae5eb0 meson: Use feature options everywhere it makes sense 2021-03-10 20:18:34 +00:00
Wim Taymans 68f6c75cae 0.3.23 2021-03-04 16:21:21 +01:00
Wim Taymans a4b0b9afe5 build: check for getrandom and sys/random.h
Fixes #833
2021-03-04 10:57:48 +01:00
Wim Taymans 052bc85dad jack: ship our own jack headers and build against them 2021-03-03 15:54:48 +01:00
Gleb Popov dbc9a520ef Check for sys/mount.h and sys/vfs.h headers and include them conditionally 2021-02-24 19:29:57 +00:00
Gleb Popov fd544544ab Link v4l2 plugin to libinotify on FreeBSD 2021-02-24 19:29:57 +00:00
Wim Taymans 22d563720a 0.3.22 2021-02-18 11:12:15 +01:00
Carlos Rafael Giani b17fe4aba4 meson: Make SDL2 and libsndfile dependencies configurable
This is important for cross-platform build frameworks such as Yocto
where the build configurations must be deterministic. In this case, if
some other build dependency pulled in SDL2, then the meson.build logic
would suddenly enable extra features that would not have been built
otherwise. By allowing for explicitely enabling/disabling SDL2 and sndfile
depending bits, this problem is fixed.
2021-02-15 17:12:48 +01:00
Wim Taymans 885748dfbd 0.3.21 2021-02-03 15:20:26 +01:00
Wim Taymans aee694fb82 0.3.20 2021-01-20 15:54:15 +01:00
Wim Taymans abe73c9146 meson: use global b_pie to build PIE executables 2021-01-14 16:29:32 +01:00
Frédéric Danis 7bd86df6df bluez5: Add simple HFP AG support to backend-native 2021-01-12 11:21:55 +01:00
Wim Taymans 3c2794dcc9 add i18n support 2021-01-08 10:26:46 +01:00
Wim Taymans b2b45abe01 0.3.19 2021-01-05 13:39:10 +01:00
Wim Taymans ae8f8b25f6 pw-top: add new tool
Uses ncurses to display all drivers and nodes with their latency,
error count and DSP usage.
2020-12-25 16:33:54 +01:00
Wim Taymans 91b0d3bb39 Remove pipewire-libpulse
We use the original pulseaudio client library and the replacement
server pipewire-pulse.
2020-12-17 15:44:49 +01:00