Commit graph

331 commits

Author SHA1 Message Date
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
Wim Taymans f274e53d25 0.3.56 2022-07-19 09:49:51 +02:00
Wim Taymans 957e3a7b38 0.3.55 2022-07-12 10:54:59 +02:00
Wim Taymans 752afa06a2 0.3.54 2022-07-07 10:19:55 +02:00
Wim Taymans 3853eba32f 0.3.53 2022-06-30 09:15:01 +02:00
Lucas Holt 6a15a02ec2 Add support for MidnightBSD
Fix build issue

Fix build issue
2022-06-19 18:22:47 +00:00
Jonas Holmberg 671fc51d27 pw-cli: Work without readline too
Build and install pw-cli using getline() (standardized in POSIX.1-2008)
if readline is not found.
2022-06-15 16:37:01 +02:00
Wim Taymans 31bf631057 0.3.52 2022-06-09 10:35:24 +02:00
Fabrice Fontaine 85ca67b927 fix detection of reallocarray
Fix detection of reallocarray (e.g. on glibc) raised since commit
0708a39b43

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-05-30 09:33:27 +02:00
Wim Taymans ebc775674a 0.3.51 2022-04-27 19:59:21 +02:00
Wim Taymans 64cf5e80e6 0.3.50 2022-04-13 12:41:34 +02:00
Wim Taymans 075e7b2668 0.3.49 2022-03-29 09:44:36 +02:00
Wim Taymans 6c4d3a5158 0.3.48 2022-03-03 11:30:56 +01: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
Barnabás Pőcze c9612225e1 pipewire: module-x11-bell: handle X11 errors
Unfortunately, libX11 has global error and I/O error handlers,
which make it inconvenient to use them from library code.

Since libX11 1.7.0, there is a per-display "exit_handler" which
is called from `_XIOError()`, however, the global I/O error
handler is still called before that, and that - by default -
calls `exit(1)` in `_XDefaultIOError()` after printing the error
to stderr.

To avoid exiting, custom handlers will be registered when
libpipewire-module-x11-bell.so is loaded given that at
that moment the default handlers are installed.

When the shared object is unloaded, the handlers will
be reset to the default ones given that the currently
registered handlers are the ones that were registered
when the module was loaded.

The logic only works correctly if there are no concurrent
calls to `XSet{IO}ErrorHandler()` while `{set,restore}_x11_handlers()`
is running. Since module-x11-bell is probably mostly going to
be loaded in `pipewire-pulse`, this seems like a reasonable
assumption to make.
2022-02-18 12:30:53 +01:00
Wim Taymans 2af3938893 0.3.47 2022-02-18 09:27:44 +01:00
Wim Taymans 0df9d03729 0.3.46 2022-02-17 09:46:57 +01: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
Barnabás Pőcze 15e7a61aa7 treewide: only define feature macros when the feature is available
Most feature checks already use #ifdef, and do not care about
the value of the macro. Convert all feature checks to do that,
and simplify the meson build scripts by replacing

  if cond
    cdata.set('X', 1)
  endif

with

  cdata.set('X', cond)
2022-02-04 00:15:59 +01:00
Barnabás Pőcze 140378efd6 meson.build: remove unused config macro 2022-02-04 00:15:59 +01:00
Barnabás Pőcze 7b0f22636f meson.build: remove unused feature macros 2022-02-04 00:15:59 +01:00
Wim Taymans bdd407fe66 0.3.45 2022-02-03 12:24:24 +01:00
Wim Taymans 7201b079fc meson: reverse intl check
If we have a library, use that, otherwise use the normal dep.

Might fix build on musl
2022-01-29 08:28:15 +01:00
Wim Taymans 4660e16d5b meson: enable some more warnings
Fix some warnings
2022-01-27 11:07:17 +01:00
Wim Taymans c4ca245b24 0.3.44 2022-01-27 10:17:53 +01:00
Wim Taymans b1a989f62e meson: improve SDL2 summary 2022-01-21 16:30:02 +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
Pauli Virtanen 88e744a06f doc: include manpages in html docs
Include manpages as raw text in html docs.  Simple and readable
enough...
2022-01-20 20:51:03 +00:00
Barnabás Pőcze ec465966bc treewide: meson.build: simplify get_variable() calls
Since 01c6fd0a88 the
minimum required meson version is 0.59.0, and since
meson 0.58.0, `get_variable()` on a dependency object
accepts a positional argument. The "type" of variable
(internal, pkgconfig, etc.) in that case does not need
to be specified explicitly.
2022-01-17 08:28:53 +00:00
Barnabás Pőcze 33fb98fddf meson.build: remove version check around devenv
Since 01c6fd0a88 the
minimum required meson version is 0.59.0, therefore
there is no need to check if it's at least 0.58.0,
which was needed for the devenv functionality.
2022-01-17 08:28:53 +00:00
Robbert van der Helm 2b73c86af5 modules: Rename module-rtkit to module-rt
I don't think PipeWire currently has a way to temporarily alias
module-rtkit to module-rt though, so right now this would break realtime
scheduling for people with modified configs that use module-rtkit.
2022-01-15 20:59:41 +01:00
Niklāvs Koļesņikovs 01c6fd0a88 meson.build: bump Meson minimum version to 0.59.0
When creating a new build directory, Meson prints a warning:
  WARNING: Project specifies a minimum meson_version '>= 0.56.0' but
  uses features which were added in newer versions:
   * 0.59.0: {'unescaped_variables arg in pkgconfig.generate'}

Since 0.59.0 was released a while ago and no one has complained so far,
it should be reasonable to just bump the minimum version required,
rather than try to make it 0.56.0 compliant.
2022-01-06 12:20:12 +00:00
Wim Taymans 07724b7aef 0.3.43 2022-01-05 11:25: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 93b4fc59cf treewide: meson.build: get PIPEWIRE_{CONFIG,MODULE}_DIR from dependency
Instead of hard-coding the paths relative to the project root,
retrieve the correct paths from `pipewire_dep`.
2021-12-28 18:40:41 +01:00
Barnabás Pőcze 26eb66fb5b treewide: meson.build: get SPA_PLUGIN_DIR from dependency
Instead of hard-coding the path relative to the project root,
retrieve the correct path from `spa_dep`.
2021-12-28 18:39:17 +01:00
Barnabás Pőcze 8ed46a283f treewide: meson.build: use project_{build,source}_root()
Use `meson.project_{build,source}_root()` instead of
`meson.{build,source}_root()` because those functions
do not work as expected when used inside a subproject,
and they have been deprecated in meson 0.56.0.
2021-12-28 18:37:18 +01:00
Barnabás Pőcze a9225d3150 meson.build: use project_{build,source}_root() in devenv
The paths are calculated relative to the project root,
so use the appropriate functions to retrieve it
instead of using the current build/source directory.
2021-12-28 18:35:44 +01:00
Barnabás Pőcze 248b8c40a3 meson.build: require meson 0.56.0 2021-12-28 18:35:12 +01:00
Barnabás Pőcze f090fd86e2 meson.build: remove unnecessary import
The "gnome" meson module is not used, do not import it.
2021-12-28 18:34:54 +01:00
Gleb Popov 014881ca32 Add Meson logic to properly locate OpenSSL on FreeBSD. 2021-12-26 17:43:23 +03:00
Wim Taymans 65aadeb2d7 meson: use c++17 as default to compile libcamera
Fixes #1940
2021-12-24 17:56:37 +01:00
Wim Taymans 7b26384388 Merge tag '0.3.42' 2021-12-16 09:51:21 +01:00
Wim Taymans 3cac296ee0 0.3.42 2021-12-16 09:17:48 +01:00
Jonas Holmberg 6aeb640e31 tests: Add pipewire-alsa stress test
Add test that opens, prepares and closes the alsa pcm device in several
threads simultaneously in an infinite loop.
2021-12-15 16:13:08 +01:00
Wim Taymans 717fb64e4e 0.3.41 2021-12-13 09:35:30 +01:00
Wim Taymans bcd867f8eb filter-chain: disable lilv code when not available 2021-12-10 18:46:06 +01: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
Wim Taymans 9223fc2885 raop: add beginnings of RAOP protocol 2021-11-12 16:58:27 +01:00
Wim Taymans 7afd80052b 0.3.40 2021-11-11 13:21:29 +01:00
columbarius 9f34885174 examples: Create source and sink with fixation on format negotiation
This commit uses the video-src-alloc and video-play-reneg templates to create
examples for manual fixation at the format negotiation phase. These
clients simulate modifier negotiation done by clients handling DmaBufs.

Note: Neither client is capable of proper DmaBuf handling!

video-play-fixate can be used to test if a producer is capable to
fallback to shm buffer transport, while video-src-fixate can only be
used with the former example!
2021-10-27 11:09:24 +02:00
Peter Hutterer 9acee530e2 meson: switch to "foo in array" style for meson arrays
In Meson, string.contains() is a substring check but array.contains() is
a full string check. Let's use 'foo in bar' style instead to avoid
confusion.

Supported since meson 0.49.0
2021-10-26 06:22:20 +00:00
Wim Taymans 5b7ef959d1 0.3.39 2021-10-20 17:00:38 +02:00
Peter Hutterer 1bced6b2ef Remove media-session from this tree
It is now available as a separate project in
https://gitlab.freedesktop.org/pipewire/media-session

The code required by pw-reservice has moved to src/tools/reserve.{c|h}
2021-10-18 20:44:07 +10:00
Barnabás Pőcze 5cfdc2620c meson.build: set MEDIA_SESSION_CONFIG_DIR in devenv
Commit 6c156cdbb4 made pw-uninstalled.sh
export the MEDIA_SESSION_CONFIG_DIR environmental variable, its value
being the location of the media-session configuration files in the
build directory.

Export this environtmental variable in the meson devenv as well.

Fixes: 6c156cdbb4 ("media-session: move the media-session config files to here")
2021-10-14 21:54:37 +02:00
Wim Taymans e68fd36f90 pipewire-v4l2: the start of a v4l2 LD_PRELOAD library 2021-10-14 10:16:35 +02:00
Peter Hutterer 55200209b5 meson.build: fix some formatting 2021-10-13 09:13:12 +00:00
Peter Hutterer ec5b8bf153 meson: use cdata.set_quoted instead of manual quoting 2021-10-13 09:13:12 +00:00
Wim Taymans 5f7c4dec34 meson: make it possible to compile without dbus
Make an option to disable dbus and all the code that depends on
it.

Fixes #1685
2021-10-09 15:00:04 +02:00
Joshua Strobl ddfbd684e7 Fix readline detection by allowing fallback to cc find_library 2021-09-30 21:27:47 +00:00
Wim Taymans 47a294c5bf 0.3.38 2021-09-30 10:42:30 +02:00
Peter Hutterer abd5f9fbe8 Remove remaining tabs from meson.build files
No changes, just tab-to-space replacement and a little bit of manual
twiddling.
2021-09-30 00:08:27 +00:00
Peter Hutterer 7c28b0d7af meson: add a summary for the readline dependency 2021-09-29 13:21:08 +10:00
Peter Hutterer ae59185f6f pw-cli: use readline() in interactive mode
With history and a simple command completion hook this makes the
interactive mode a lot easier to deal with.
2021-09-28 07:19:13 +00:00
Wim Taymans c41e3553bf 0.3.37 2021-09-23 10:17:19 +02:00
Peter Hutterer e8e7e72b76 meson: require alsa for pipewire-alsa or media-session
The previous code had alsa optional if pipewire-alsa was on
auto/disabled bug failed later with missing alsa if media-session was in
the session manager array. Which it is by default.

Fixes #1632
2021-09-21 08:59:30 +10:00
Pauli Virtanen 229892d45d pw-uninstalled: set SPA_DATA_DIR + fix meson devenv
Set SPA_DATA_DIR needed for the bluez5 plugin hwdb file in
pw-uninstalled.

Also fix its value for meson devenv.
2021-09-19 18:12:19 +00:00
Pauli Virtanen cae1554449 bluez5: move bluez-hardware.conf loading to the plugin
It's not really the responsibility of the session manager to load the
bluez5 device quirks, and it's easier for eg. Wireplumber if it doesn't
need to do it.

Move loading bluez-hardware.conf to be the responsibility of the bluez5
spa plugin, similarly as the alsa plugin deals with the ACP database.

Put the configuration to share/spa-0.2/bluez5, mirroring the plugin
directory structure in lib/spa-0.2/bluez5.
2021-09-19 17:28:17 +00:00
Wim Taymans 10abcd92d7 update version number as well 2021-09-16 18:38:56 +02:00
Wim Taymans 91069ec3d2 0.3.35 2021-09-09 09:52:35 +02:00
Niklāvs Koļesņikovs 40cbcf2887 Meson: Update two pipewire.org URLs to HTTPS 2021-09-03 11:41:45 +00:00
Niklāvs Koļesņikovs e41187d643 man: move from xmltoman to rst2man
xmltoman looks dead and uses XML as well as pulls in a long list of
Perl dependencies. This replaces it with rst2man that has almost no
dependencies beyond Python, which is already required for the Meson
build system.

Naturally rst2man uses reStructuredText and the pages were rewritten
via regex and manual editing to be as close to original XML format
as possible. A few fixes and updates were done too. Most notably a
note was added to indicate that production deployments should not be
starting the session manager via pipewire.conf file.

There's three slight formatting issues/differences:
1. rst2man produces simpler footer.
2. "-f | --foo=value" confuses the parser and it fails to correctly
   add argument specific syntax highlighting to assignment value.
3. XML version had inconsistent use of <arg> and <opt> which has
   been partially addressed. But different manual pages still have
   their differences to what and how is highlighted.
2021-09-03 11:41:45 +00:00
Wim Taymans 1924c2c298 0.3.34 2021-08-26 13:05:12 +02:00
Wim Taymans f816f702a5 filter-chain: make sndfile optional
Replace the code paths that require sndfile with a fallback when the
dependency was not found.
2021-08-12 09:59:56 +02:00
Nils Tonnätt 8028f9dd6e meson: decrease minimum required meson version to 0.54.0
To generate a correct jack pkg-config file unescape_variable
is required which was introduced with Meson 0.59.0.
When using an older version a warning is printed that no
jack.pc file is generated.
2021-08-08 19:18:40 +00:00
Nils Tonnätt dd12910769 Revert "[Meson] Fix all deprecation warnings"
This reverts commit f7e1175ef0.
2021-08-08 19:18:40 +00:00
Nils Tonnätt f7e1175ef0 [Meson] Fix all deprecation warnings 2021-08-06 07:56:16 +00:00
Nils Tonnätt 8dc8fb55f2 [Meson] Unescape pkgconf variable 2021-08-06 07:56:16 +00:00
Wim Taymans 8119e5cdb4 0.3.33 2021-08-05 16:19:43 +02:00
Peter Seiderer 6af1388d66 meson: fix getrandom detection for uclibc
The getrandom() detection from meson.build fails with the following error
message:

  .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35: error: unknown type name 'size_t'
     27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)
        |                                   ^~~~~~
  .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:8:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?

Fix it by adding stddef.h include to the meson getrandom() detection.

Fixes:

  ../src/pipewire/impl-core.c:54:9: error: conflicting types for ‘getrandom’
     54 | ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) {
        |         ^~~~~~~~~
  In file included from ../src/pipewire/impl-core.c:34:
  .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:12: note: previous declaration of ‘getrandom’ was here
     27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)
        |            ^~~~~~~~~

[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/pipewire/0001-meson-fix-getrandom-detection-for-uclibc.patch]
2021-07-25 11:17:41 +00:00
Érico Nogueira 4c166709d0 modules: improve _gettid wrapper
- use meson to check for gettid() function, always use if available
- use syscall fallback on linux, if not
- restrict thr_self() fallback to *only* FreeBSD
- error out if there isn't any gettid impl
2021-07-20 15:51:50 +00:00
Wim Taymans 41ce309275 0.3.32 2021-07-20 13:06:13 +02:00
Wim Taymans c43dabcc96 0.3.31 2021-06-28 15:32:38 +02: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
Peter Hutterer c69ebf6361 meson.build: define cpp dependency as non-native
meson.build:93: WARNING: add_languages is missing native:,
  assuming languages are wanted for both host and build.

Doesn't matter for our use-case (compilation check only), so let's define it
as non-native.
2021-06-25 08:25:02 +00:00
Peter Hutterer 5e76f39e9d meson.build: move -D_GNU_SOURCE to the other hardcoded args
No need for this to be on its own line
2021-06-25 08:25:02 +00:00
Pauli Virtanen 5e0b63b149 bluez5: backend-native: use quirks + usb adapter caps for checking msbc
Use the quirks database to check whether to enable MSBC codec for each
device.

If quirks don't allow ALT1 mode for an USB adapter, check whether the
adapter has an usable ALT6 mode and disable MSBC if not.
2021-06-22 10:58:50 +03:00
Evgeniy Khramtsov c3d7561d17 test: unbreak FreeBSD 2021-06-21 09:28:02 +00: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
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