Commit graph

172 commits

Author SHA1 Message Date
Patrick Gaskin
613b3ebc2c win32: Fix privlibdir for running on Windows
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>
2021-01-13 03:42:24 +00:00
Igor V. Kovalenko
c2ae56a73c database: clean up remaining references to CANONICAL_HOST
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>
2021-01-07 23:27:16 +00:00
Igor V. Kovalenko
b6396dbe9c x11: gracefully handle X11 connection error
Perform X11 connection recovery via XSetIOErrorExitHandler mechanism.

Implementation is largely inspired by this change to GNOME/mutter
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1447

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/441>
2021-01-04 15:59:22 +00:00
Edward Lee
b892e327a9 win32: Fix meson build system for Windows.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>
2020-12-16 11:05:28 -05:00
Igor V. Kovalenko
d285b00a16 build-sys: meson: change oss-output boolean to Meson feature
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/437>
2020-12-14 19:48:06 +00:00
Tanu Kaskinen
dc79f304dd build-sys: Add an option for enabling/disabling Valgrind
In OpenEmbedded the PulseAudio recipe currently disables Valgrind
support by passing "ac_cv_header_valgrind_memcheck_h=no" to the
configure script (this was added to make it deterministic whether
Valgrdind support gets enabled or not). I'm converting the PulseAudio
recipe to use Meson, and I needed an option to disable Valgrind.
2020-12-09 11:07:09 +00:00
Georg Chini
4cdc0053c0 protocol-native: add message sending capability
This patch adds the PA_COMMAND_SEND_OBJECT_MESSAGE command to protocol-native
so that clients can use the messaging feature introduced in the previous patch.

Sending messages can in effect replace the extension system for modules. The
approach is more flexible than the extension interface because a generic string
format is used to exchange information. Furthermore the messaging system can be
used for any object, not only for modules, and is easier to implement than
extensions.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>
2020-12-03 14:41:39 +00:00
Igor V. Kovalenko
cb3d12377c build-sys: meson: use target_machine.cpu_family() for CANONICAL_HOST
target_machine provides information about the machine on which the compiled
binary's output will run.

cpu_family() returns CPU family name (such as x86_64, not more specific amd64)

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/426>
2020-11-30 13:40:04 +03:00
Igor V. Kovalenko
ecd597995a build-sys: meson: add oss-output option for OSS output support
Restore an option to disable OSS output available with autotools.
2020-11-28 00:34:49 +03:00
Sanchayan Maity
45abd0b43c Add default.pa.d folder support
The .include meta command already supports specifying a directory and
when including a directory, all files with the extension '.pa' in that
directory will be parsed in alphabetical order.

This feature can be used to add support for default.pa.d directory, so
that packages for other applications or users can just drop in a file
for configuration without changing the default.pa which is shipped.

We use the PA_DEFAULT_CONFIG_DIR for this, however, since meson quotes
this build variable, introduce an unquoted version for this purpose and
use it with .include.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/909

Signed-off-by: Sanchayan Maity <sanchayan@asymptotic.io>
2020-11-23 22:07:36 +00:00
Arun Raghavan
c442227c6b glib-mainloop: Drop deprecated g_get_current_time() usage
This uses the year 2038-safe g_get_real_time() as recommended instead.
Bumps GLib dependency to 2.28 as a result.
2020-11-23 19:02:33 +00:00
Arun Raghavan
d1e0594e93 build-sys: Bump libpulse soversion
This is because we reverted the previous API breaking change to the
meaning of the pa_mainloop_prepare() timeout argument.
2020-11-23 13:24:03 -05:00
Arun Raghavan
5f12dde2f5 rtp: gstreamer: Don't count on buffer DTS for capture time
With GStreamer 1.18, the old behaviour of storing the capture time in
DTS is gone (which is reasonable, since the semantics really don't
match). So instead, we get a capture timestamp when the buffer is being
pushed from udpsrc. This should eventually move into udpsrc, and the
timestamp should come from the cmsg instead of the clock.

We still fallback to the DTS if the meta isn't available, as the meta
might be dropped in older versions of rtpL16pay due to a bug.
2020-10-23 12:11:35 -04:00
Arun Raghavan
d0c3ef1a7d build-sys: Bump soversions
libpulse gets a full API bump due to the addition of availability
groups, and libpulse-mainloop-glib gets a minor bump for implementation
change.
2020-09-20 19:10:03 -04:00
Tanu Kaskinen
2c790e1937 meson: Add doxygen target
The documentation can be generated with "ninja -C build doxygen". The
output will go to "doxygen/html" under the build directory.
2020-08-10 19:50:57 +03:00
Jan Alexander Steffens (heftig)
b657cff400 build: Make alsadatadir configurable
Pipewire has started shipping copies of PulseAudio's ALSA card profiles.

It would be useful if both projects could share the same profiles and
this patch is a step toward that.
2020-08-09 01:57:01 +00:00
Tanu Kaskinen
0e691b9664 build-sys: meson: bump protocol version
This was forgotten in commit 861836c5f7.
2020-07-11 15:17:11 +03:00
Jan Alexander Steffens (heftig)
0547ae49ba
build-sys: meson: Fix detection of SYS_memfd_create
It's a define resolving to a number, not a function.
2020-06-17 20:01:15 +02:00
Tanu Kaskinen
1fe37e6d4b stream-restore: Forget pre-14.0 stream routing
Prior to commits f899d5f466 and
f62a49b8cf, GNOME's sound settings
overwrote the routing for all entries in the stream-restore database
when selecting a device. Now we prevent that from happening (see the
aforementioned commits), but the old overwritten settings can still be in
the database after updating to PulseAudio 14.0, and they can cause
problems, as documented here:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/832

We can't distinguish between devices set by GNOME's sound settings
and devices set by the user, so this patch discards all old device
settings, even though that is going to cause PulseAudio to forget routing
settings for many users. This is less bad than keeping the incorrect
routing settings in the database, because it's difficult for users to
figure out how to fix the situation when e.g. speaker test tones go to
the internal speakers no matter what device is selected as the default,
whereas old manual configuration can be restored restored by doing the
manual configuration again. Also, it's probably more common to have at
some point changed the default device in GNOME's sound settings than it
is to have any manual per-stream routing settings.

This is disabled by default, because this causes data loss, but
distributions that use GNOME are recommended to enable this with
the --enable-stream-restore-clear-old-devices (Autotools) or
-Dstream-restore-clear-old-devices=true (Meson) build option.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/832
2020-06-01 18:24:16 +00:00
Arun Raghavan
ef8a302d6b build: Bump soversion for libpulse
No interface changes, but minor implementation change via a fix for when
contexts are freed.
2020-02-14 05:07:56 -05:00
Arun Raghavan
74f8456acb rtp: Add a GStreamer-based RTP implementation
This adds a GStreamer-based RTP implementation to replace our own. The
original implementation is retained for cases where it is not possible
to include GStreamer as a dependency.

The idea with this is to be able to start supporting more advanced RTP
features such as RTCP, non-PCM audio, and potentially synchronised
playback.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
2019-11-08 17:39:40 +05:30
Rasmus Thomsen
bff163089c meson: link libintl if it's not provided by libc
This fixes the build on musl with external gettext
2019-09-25 04:42:03 +00:00
Arun Raghavan
3fa0daee37 build-sys: Fix documentation of version info
The comment has been incorrect for a while now. Thanks to Jan Steffens
for pointing this out.
2019-09-02 04:31:53 +00:00
Arun Raghavan
fb530e0f3b build-sys: Bump version info for libpulse
Minor implementation change since last release (we now load X11
properties only for SSH connections).
2019-09-01 13:05:10 +05:30
Arun Raghavan
1172daf19b build-sys: meson: Process subdirectories before generating configuration
Subdirectories add to the top-level cdata (specifically, the SIMD
detection happens in the pulsecore meson.build), so we were missing
HAVE_MMX/SSE2/NEON defines without this fix.
2019-08-22 19:05:40 +05:30
Arun Raghavan
f515443fa0 build-sys: meson: Fixes for some ARM compiler checks 2019-08-22 19:05:40 +05:30
Arun Raghavan
27e72814d0 build-sys: meson: Add a bunch of missing checks 2019-08-15 18:57:13 +05:30
Arun Raghavan
2b0a33053c build-sys: meson: Add some missing declaration checks 2019-08-15 18:57:13 +05:30
Arun Raghavan
cd8dfee947 build-sys: meson: Add a check for fast 64-bit operations 2019-08-15 18:57:13 +05:30
Arun Raghavan
c90fa7f857 build-sys: meson: Add ARMv6 instruction check 2019-08-15 18:57:13 +05:30
Arun Raghavan
1e996445f7 build-sys: meson: Add atomic ops related checks 2019-08-15 18:57:13 +05:30
Lucas Stach
25308fe88f meson: add stdint.h to checked headers
Without this check we won't ever define HAVE_STDINT_H, which isn't used
in pulse directly, but is needed by e.g. the speex headers to work
correctly.
2019-08-14 10:16:34 +02:00
Lucas Stach
1911ef16e2 meson: allow to build bluez support without libbluetooth
pulseaudio does not link against libbluetooth, as it's only talking to the
bluez daemon over dbus. So the build dependency on libbluetooth is overly
restrictive, as some embedded systems choose to ship without libbluetooth
but still have bluez daemon support.

This syncs the meson to the autotools configuration behavior by changing
the bluez option to a default on boolean.
2019-08-14 10:16:34 +02:00
Jan Alexander Steffens (heftig)
493e7f3582
build-sys: meson: Add some missing checks
- Header and function checks from configure.ac
  (some libc, some libpthread, dladdr from libdl)
- Find iconv and check constness
2019-08-09 23:11:24 +02:00
Arun Raghavan
f996ad0688 build-sys: meson: Add -Wl,no-delete to relevant libraries
This mirrors the autotools option for all server-side dynamic libraries.
2019-08-05 09:52:32 +05:30
Jan Alexander Steffens (heftig)
8e98ed9493 meson: Fix library versioning to match Autotools
For ease of maintaining both build systems, use the same version info
sequences as configure.ac. This should be simplified after Autotools has
been dropped.
2019-07-25 16:53:01 +00:00
Jan Alexander Steffens (heftig)
09231eaead meson: Fix build of padsp
- Rename "pulsedspdir" to the same "padsplibdir" that Autotools uses.

 - Add a new option "pulsedsp-location" that is only used for padsp.in,
   just like Autotools' --with-pulsedsp-location.

 - Use 'set' instead of 'set_quoted' to avoid PULSEDSP_LOCATION getting
   quoted twice.
2019-07-25 16:53:01 +00:00
Arun Raghavan
0cd931dc80 build-sys: Fixes for i18n parts of the meson build 2019-07-05 08:38:58 +00:00
Alan Coopersmith
9901a26d95 meson: check for sys/filio.h
Needed for FIONREAD on Solaris

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-07-01 01:37:04 +00:00
Alan Coopersmith
e64f8a5e42 meson: fix builds on platorms without libsystemd
Without this, meson on Solaris exits with:
src/daemon/meson.build:138:15: ERROR: Unknown variable "systemd_dep".

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-07-01 01:37:04 +00:00
Thomas Hutschenreuther
d4ff4adce2 atomic: fix load and store for armv7 and higher
The original atomic implementation in pulseaudio based on
libatomic stated that the intent was to use full memory barriers.

According to [1], the load and store implementation based on
gcc builtins matches sequential consistent (i.e. full memory barrier)
load and store ordering only for x86.

I observed random crashes in client applications using memfd srbchannel
transport on an armv8-aarch64 platform (cortex-a57).
In all those crashes the first read on the pstream descriptor
(the size field) was wrong and looked like it contained old data.
I boiled the relevant parts of the srbchannel implementation down to
a simple test case and could observe random test failures.
So I figured that the atomic implementation was broken for armv8
with respect to cross-cpu memory access ordering consistency.

In order to come up with a minimal fix, I used the newer
__atomic_load_n/__atomic_store_n builtins from gcc.

With
aarch64-linux-gnu-gcc (Linaro GCC 7.3-2018.05) 7.3.1 20180425
they compile to
ldar and stlxr on arm64, which is correct according to [1] and [2].

The other atomic operations based on __sync builtins don't need
to be touched since they already are of the full memory barrier
variety.

[1] https://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html
[2] <https://community.arm.com/developer/ip-products/processors
    /b/processors-ip-blog/posts/armv8-a-architecture-2016-additions>
2019-06-11 19:04:46 +03:00
Arnaud Rebillout
b0a4a85db4 meson: Add running-from-build-tree option
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-06-08 12:03:03 +02:00
Arnaud Rebillout
1a3ed2f430 meson: Add support for gcov
Unlike autotools, we use the option --coverage, which is a synonym for
-profile-arcs and -ftest-coverage (when compiling) and -lgcov (when
linking).

For reference, see:
https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-06-08 12:03:03 +02:00
Arnaud Rebillout
aa5502926f meson: Add ORC support
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-06-08 12:03:03 +02:00
Arnaud Rebillout
538229633f meson: Install cmake files
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-06-08 12:03:03 +02:00
Arnaud Rebillout
091906cb03 meson: Fix udevrulesdir
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-06-08 11:57:00 +02:00
Arnaud Rebillout
68f9984ac0 meson: Add basic po support
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-06-08 11:57:00 +02:00
Arnaud Rebillout
8f336ede12 meson: Add udevrulesdir option
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-06-08 11:57:00 +02:00
Arnaud Rebillout
fdf3384f24 meson: Add systemduserunitdir option
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-06-08 11:57:00 +02:00
Arnaud Rebillout
a7b24ed03d meson: Fix pulsedspdir
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-06-08 11:57:00 +02:00