platform/upstream/pulseaudio.git
4 years agortp: Use yes/no in configure instead of 1/0
Sebastian Dröge [Wed, 2 Mar 2016 18:28:00 +0000 (20:28 +0200)]
rtp: Use yes/no in configure instead of 1/0

4 years agortp: Add a GStreamer-based RTP implementation
Arun Raghavan [Thu, 12 May 2016 13:56:55 +0000 (19:26 +0530)]
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>
4 years agortpoll: Separate out before/after/work callback userdata
Arun Raghavan [Thu, 12 May 2016 12:35:14 +0000 (18:05 +0530)]
rtpoll: Separate out before/after/work callback userdata

It is possible that we might want to have a separate userdata to be used
for these callbacks, so let's split them out.

This is particularly needed when using an pa_rtpoll_item around pa_fdsem
since that uses its own before/after callback but will essentially have
whatever is using the fdsem set up the work callback appropriately (and
thus at least the work callback's userdata needs to be separated from
the before/after callback -- we might as well then just separate all
three).

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
4 years agortp: Hide RTP implementation details from module-rtp-*
Arun Raghavan [Thu, 12 May 2016 12:29:55 +0000 (17:59 +0530)]
rtp: Hide RTP implementation details from module-rtp-*

This moves RTP implementation-specific information out of
module-rtp-send/recv. This is basically done by making the
pa_rtp_context structure opaque from the perspective of these modules.
We can then potentially replace the underlying RTP implementation with
something else transparently.

One RTP detail that does "leak" is the RTP timestamp. We provide this to
module-rtp-recv so that it can perform rate adjustments to match the
sender rate.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
4 years agortp: Move MTU handling to the RTP implementation
Arun Raghavan [Thu, 12 May 2016 12:27:04 +0000 (17:57 +0530)]
rtp: Move MTU handling to the RTP implementation

module-rtp-send itself doesn't really need to handle this, the
implementation can keep track (and make sure sending happens in MTU
sized chunks).

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
4 years agortp: Drop support for non-L16 media
Arun Raghavan [Thu, 12 May 2016 12:26:56 +0000 (17:56 +0530)]
rtp: Drop support for non-L16 media

There doesn't seem much value in supporting streaming U8/mulaw/alaw on
the network, and it's unlikely these get any testing. Makes more sense
to drop these formats and just convert to L16 if we're dealing with
source media in that format.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
4 years agortp: Don't use cookie for SSRC
Arun Raghavan [Thu, 12 May 2016 12:26:51 +0000 (17:56 +0530)]
rtp: Don't use cookie for SSRC

Publishing the cookie on multicast seems to be a bad idea.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
4 years agortp: Make init return a value for success/failure
Arun Raghavan [Thu, 12 May 2016 12:26:43 +0000 (17:56 +0530)]
rtp: Make init return a value for success/failure

This will be used in the future when writing other RTP implementations
that can fail on init.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
4 years agomeson: allow to disable installing completions
Timo Gurr [Thu, 7 Nov 2019 12:50:56 +0000 (12:50 +0000)]
meson: allow to disable installing completions

5 years agoFix memory leak in context_free
Daniil Kovalev [Sat, 2 Nov 2019 18:43:51 +0000 (21:43 +0300)]
Fix memory leak in context_free

In commit f727cd9a `int error` member in `struct pa_context` was changed
to `pa_context_error *error`. The memory that is allocated with
`pa_xnew0` in src/pulse/context.c:142 is never freed, and it causes
a leak of 4 bytes. The leak can be easily detected with leak-sanitizer.

5 years agostart-pulseaudio-x11: fix KDE version check
Rickie Schroeder [Wed, 16 Oct 2019 19:33:19 +0000 (19:33 +0000)]
start-pulseaudio-x11: fix KDE version check

Current check wasn't working in case when $DESKTOP_SESSION wasn't set
which happens when session is started without display manager like sddm.
Parsing "plasmashell -v" output should be more reliable and less hacky.

This also changes legacy backticks `...` to modern $(...) as recommended
by shellcheck:
https://github.com/koalaman/shellcheck/wiki/SC2006

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/751

5 years agortp: Fix reverted test for INHIBIT_AUTO_SUSPEND_ONLY_WITH_NON_MONITOR_SOURCES
ckdo [Sun, 20 Oct 2019 06:19:54 +0000 (08:19 +0200)]
rtp: Fix reverted test for INHIBIT_AUTO_SUSPEND_ONLY_WITH_NON_MONITOR_SOURCES

RTP Monitor sources were never suspended when
inhibit_auto_suspend=only_with_non_monitor_sources

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/735

5 years agoalsa-mixer: recognize the "Speaker Jack" control
Tanu Kaskinen [Sat, 2 Sep 2017 12:35:01 +0000 (15:35 +0300)]
alsa-mixer: recognize the "Speaker Jack" control

This control has been seen in the wild:
https://lists.freedesktop.org/archives/pulseaudio-discuss/2017-August/028595.html
(The pastebin link in that mail might not work anymore, but the paste
just shows that there's a Speaker Jack control).

5 years agoqpaeq: use python3 instead of python 2
Felipe Sateler [Fri, 25 Oct 2019 11:39:03 +0000 (08:39 -0300)]
qpaeq: use python3 instead of python 2

The script was already compatible, so lets just switch interpreter

5 years agoqpaeq: Drop unused imports
Felipe Sateler [Fri, 25 Oct 2019 11:34:59 +0000 (08:34 -0300)]
qpaeq: Drop unused imports

Neither sip nor PyQt5 are used. From PyQt5 we only use the named imports just below

5 years agoatomic: Explicitly cast void* to unsigned long
Peter Levine [Thu, 26 Sep 2019 07:24:40 +0000 (07:24 +0000)]
atomic: Explicitly cast void* to unsigned long

5 years agomeson: link libintl if it's not provided by libc
Rasmus Thomsen [Sun, 15 Sep 2019 12:22:49 +0000 (14:22 +0200)]
meson: link libintl if it's not provided by libc

This fixes the build on musl with external gettext

5 years agonull-sink: allow clients to configure the supported formats
Tanu Kaskinen [Thu, 19 Sep 2019 07:50:58 +0000 (10:50 +0300)]
null-sink: allow clients to configure the supported formats

The set_formats() callback is already implemented, so the only thing
missing was the SET_FORMATS flag.

5 years agoraop: Fix non working tcp mode
ckdo [Wed, 18 Sep 2019 01:53:42 +0000 (03:53 +0200)]
raop: Fix non working tcp mode

5 years agodaemon-conf: disable flat-volumes by default
Tanu Kaskinen [Mon, 23 Sep 2019 04:48:48 +0000 (07:48 +0300)]
daemon-conf: disable flat-volumes by default

Almost all distributions patch the configuration to disable
flat-volumes, because users tend to find the concept confusing (and it
also causes nasty surprises when some application pushes the volume to
100%). Let's remove the need for patching and disable the feature by
default.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/691

5 years agoalsa-mixer-path-test: Hide unused functions when building with Meson
Tanu Kaskinen [Fri, 20 Sep 2019 14:09:40 +0000 (17:09 +0300)]
alsa-mixer-path-test: Hide unused functions when building with Meson

Silences these warnings:

[509/574] Compiling C object 'src/tests/a4ccf2d@@alsa-mixer-path-test@exe/alsa-mixer-path-test.c.o'.
../src/tests/alsa-mixer-path-test.c:24:20: warning: ‘load_makefile’ defined but not used [-Wunused-function]
 static pa_strlist *load_makefile() {
                    ^~~~~~~~~~~~~
../src/tests/alsa-mixer-path-test.c:17:20: warning: ‘get_default_paths_dir’ defined but not used [-Wunused-function]
 static const char *get_default_paths_dir(void) {
                    ^~~~~~~~~~~~~~~~~~~~~

5 years agoUpdate NEWS
Tanu Kaskinen [Fri, 20 Sep 2019 13:49:44 +0000 (16:49 +0300)]
Update NEWS

The release notes, on which the NEWS file is based on, weren't complete
at the time of release. Now the notes should be complete.

5 years agomeson: Define TUNNEL_SINK for module-tunnel-sink
Jan Alexander Steffens (heftig) [Sun, 15 Sep 2019 11:47:19 +0000 (13:47 +0200)]
meson: Define TUNNEL_SINK for module-tunnel-sink

This was missing, so it was building another tunnel-source instead.

Fixes https://bugs.archlinux.org/task/63755

5 years agoautotools: Put module-tunnel-source X11_CFLAGS into CFLAGS instead of LDFLAGS
Jan Alexander Steffens (heftig) [Sun, 15 Sep 2019 11:39:45 +0000 (13:39 +0200)]
autotools: Put module-tunnel-source X11_CFLAGS into CFLAGS instead of LDFLAGS

Seems this happened because the order of automake variables for modules
is not consistent.

5 years agol10n: Update Italian translation
Milo Casagrande [Thu, 19 Sep 2019 07:58:16 +0000 (09:58 +0200)]
l10n: Update Italian translation

Signed-off-by: Milo Casagrande <milo@milo.name>
5 years agobuild-sys: Add missing files to release tarballs upstream/13.0 v13.0
Tanu Kaskinen [Fri, 13 Sep 2019 13:18:43 +0000 (16:18 +0300)]
build-sys: Add missing files to release tarballs

5 years agoupdate NEWS
Tanu Kaskinen [Fri, 13 Sep 2019 12:48:51 +0000 (15:48 +0300)]
update NEWS

5 years agoman: Add description of pactl special names.
Danny O'Brien [Mon, 2 Sep 2019 07:06:49 +0000 (00:06 -0700)]
man: Add description of pactl special names.

5 years agobuild-sys: Fix documentation of version info
Arun Raghavan [Mon, 2 Sep 2019 04:29:29 +0000 (09:59 +0530)]
build-sys: Fix documentation of version info

The comment has been incorrect for a while now. Thanks to Jan Steffens
for pointing this out.

5 years agol10n: Update lt.po
Moo [Sun, 1 Sep 2019 13:16:20 +0000 (13:16 +0000)]
l10n: Update lt.po

5 years agobuild-sys: Bump version info for libpulse v12.99.3
Arun Raghavan [Sun, 1 Sep 2019 07:35:10 +0000 (13:05 +0530)]
build-sys: Bump version info for libpulse

Minor implementation change since last release (we now load X11
properties only for SSH connections).

5 years agopo: Update Brazilian Portuguese translation
Rafael Fontenelle [Fri, 30 Aug 2019 13:12:24 +0000 (13:12 +0000)]
po: Update Brazilian Portuguese translation

5 years agodaemon: Drop KDE-specific loading of module-device-manager
Nicolas Fella [Fri, 30 Aug 2019 11:07:52 +0000 (11:07 +0000)]
daemon: Drop KDE-specific loading of module-device-manager

Newer versions of Plasma no longer use this module, and the consensus
seems to be that module-switch-on-connect works better for most cases.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/509

5 years agoclient-conf: Avoid loading X11 properties unless SSH_CONNECTION is set
Carlos Garnacho [Sat, 22 Jun 2019 12:33:59 +0000 (14:33 +0200)]
client-conf: Avoid loading X11 properties unless SSH_CONNECTION is set

Reading properties from the X11 root window is meant to provide 1:1 results
with reading the configuration directly in the local case. This configuration
is essentially different only in remote cases.

Add an extra check for the SSH_CONNECTION envvar, so we don't even need
opening a X11 display connection for IPC in the most usual case.

5 years agogitlab: white space change to Bug.md
Russell Treleaven [Mon, 19 Aug 2019 10:54:06 +0000 (10:54 +0000)]
gitlab: white space change to Bug.md

Add a second whitespace at the end of the line to force a newline in the
output.

5 years agodbus: fix ActiveProfile setting
David Emett [Sat, 27 Jul 2019 21:24:42 +0000 (22:24 +0100)]
dbus: fix ActiveProfile setting

Just like with handle_set_active_port, we need to look up the profile
corresponding to the provided path rather than doing a name comparison.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/709

5 years agobluetooth: Only perform write-related calculations when we have a sink
Pali Rohár [Tue, 27 Aug 2019 03:11:27 +0000 (08:41 +0530)]
bluetooth: Only perform write-related calculations when we have a sink

This avoids a potential divide-by-zero when we try to decide how much to
write to the sink in the source thread when there is no sink.

Fixes https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/717

5 years agobuild-sys: meson: Process subdirectories before generating configuration
Arun Raghavan [Thu, 22 Aug 2019 13:23:13 +0000 (18:53 +0530)]
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.

5 years agobuild-sys: meson: Fixes for some ARM compiler checks
Arun Raghavan [Thu, 22 Aug 2019 12:28:20 +0000 (17:58 +0530)]
build-sys: meson: Fixes for some ARM compiler checks

5 years agopo: update Ukrainian translation
Yuri Chornoivan [Mon, 19 Aug 2019 08:35:06 +0000 (08:35 +0000)]
po: update Ukrainian translation

5 years agoUpdate Bug.md to encourage users to attach pa-info output to bug reports
Russell Treleaven [Sun, 18 Aug 2019 20:48:23 +0000 (20:48 +0000)]
Update Bug.md to encourage users to attach pa-info output to bug reports

5 years agobuild-sys: meson: Give ourselves a little more timeout headroom
Arun Raghavan [Sat, 17 Aug 2019 10:42:37 +0000 (16:12 +0530)]
build-sys: meson: Give ourselves a little more timeout headroom

We're seeing CI failures due to once-test sometimes taking long. Let's
give ourselves a little more space per test (2 min -> 5 min) to avoid
this.

5 years agoraop: Fix infinite loop in raop-sink with UDP mode
RODRIGUEZ Christophe [Sat, 17 Aug 2019 10:43:20 +0000 (10:43 +0000)]
raop: Fix infinite loop in raop-sink with UDP mode

There are potentially unresolved issues around the EAGAIN logic, but
this should prevent an infinite loop and log flood in the mean time.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/695

5 years agobuild-sys: meson: Add a bunch of missing checks
Arun Raghavan [Thu, 15 Aug 2019 10:19:30 +0000 (15:49 +0530)]
build-sys: meson: Add a bunch of missing checks

5 years agobuild-sys: meson: Add mkfifo checks for module-pipe-*
Arun Raghavan [Thu, 15 Aug 2019 10:00:41 +0000 (15:30 +0530)]
build-sys: meson: Add mkfifo checks for module-pipe-*

5 years agobuild-sys: meson: Add some missing declaration checks
Arun Raghavan [Thu, 15 Aug 2019 10:00:26 +0000 (15:30 +0530)]
build-sys: meson: Add some missing declaration checks

5 years agobuild-sys: meson: Add a check for fast 64-bit operations
Arun Raghavan [Thu, 15 Aug 2019 10:00:00 +0000 (15:30 +0530)]
build-sys: meson: Add a check for fast 64-bit operations

5 years agobuild-sys: meson: Add ARMv6 instruction check
Arun Raghavan [Thu, 15 Aug 2019 07:38:14 +0000 (13:08 +0530)]
build-sys: meson: Add ARMv6 instruction check

5 years agobuild-sys: meson: Add atomic ops related checks
Arun Raghavan [Thu, 15 Aug 2019 07:37:54 +0000 (13:07 +0530)]
build-sys: meson: Add atomic ops related checks

5 years agomeson: add stdint.h to checked headers
Lucas Stach [Tue, 13 Aug 2019 15:27:37 +0000 (17:27 +0200)]
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.

5 years agomeson: allow to build bluez support without libbluetooth
Lucas Stach [Tue, 13 Aug 2019 15:08:13 +0000 (17:08 +0200)]
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.

5 years agomeson: fix build files list when building with NEON
Lucas Stach [Tue, 13 Aug 2019 14:01:01 +0000 (16:01 +0200)]
meson: fix build files list when building with NEON

Sync the meson NEON build files list with the autotools build
sources list. Fixes "ERROR: File svolume_neon.c does not exist."

5 years agobuild-sys: meson: Fix 2 cases of joining paths w/o join_paths
Jan Alexander Steffens (heftig) [Tue, 13 Aug 2019 19:47:23 +0000 (21:47 +0200)]
build-sys: meson: Fix 2 cases of joining paths w/o join_paths

Fixes https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/712

5 years agobootstrap.sh: don't set sysconfdir and localstatedir configure options
Tanu Kaskinen [Tue, 13 Aug 2019 13:49:31 +0000 (16:49 +0300)]
bootstrap.sh: don't set sysconfdir and localstatedir configure options

I don't know why these options were being passed to configure
(--sysconfdir has been there from the very beginning, --localstatedir
got added when the system mode was added). Overwriting system files by
default is not good, so let's not set these options.

5 years agobuild-sys: meson: Add some missing checks
Jan Alexander Steffens (heftig) [Thu, 8 Aug 2019 18:23:12 +0000 (20:23 +0200)]
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

5 years agoadd script to collect information for bug reports
Russell Treleaven [Thu, 8 Aug 2019 16:30:05 +0000 (12:30 -0400)]
add script to collect information for bug reports

5 years agol10n: Update Italian translation
Milo Casagrande [Wed, 7 Aug 2019 07:53:37 +0000 (09:53 +0200)]
l10n: Update Italian translation

  * Fixed typo.
  * Fixed use of double quotes.

Signed-off-by: Milo Casagrande <milo@milo.name>
5 years agobuild-sys: autotools: Add meson build files to EXTRA_DIST v12.99.2
Arun Raghavan [Tue, 6 Aug 2019 16:25:44 +0000 (21:55 +0530)]
build-sys: autotools: Add meson build files to EXTRA_DIST

As we currently still generate our tarballs using autotools, let's make
sure the meson build system is distributed with the tarball.

5 years agobuild-sys: Move svolume-*.c to libpulsecore
Arun Raghavan [Mon, 5 Aug 2019 08:49:27 +0000 (14:19 +0530)]
build-sys: Move svolume-*.c to libpulsecore

The various software volume implementations were being built as part of
libpulsecommon for some reason. These should only ever be used in the
daemon, so they should be in libpulsecore.

5 years agobuild-sys: meson: Fix minor typo in orc build
Arun Raghavan [Mon, 5 Aug 2019 08:39:44 +0000 (14:09 +0530)]
build-sys: meson: Fix minor typo in orc build

5 years agobuild-sys: meson: Add symbol versioning as in autotools
Arun Raghavan [Mon, 5 Aug 2019 05:09:49 +0000 (10:39 +0530)]
build-sys: meson: Add symbol versioning as in autotools

Adds the -version-script linker argument that we use with autotools to
version symbols in our public API.

5 years agobuild-sys: meson: Fix some defines for default.pa generation
Arun Raghavan [Mon, 5 Aug 2019 05:00:50 +0000 (10:30 +0530)]
build-sys: meson: Fix some defines for default.pa generation

Removes a warning from HAVE_GCONF not being set, and fixes generation of
a large section that depends on OS_IS_WIN32 being explicitly set to 0.

We can't set OS_IS_WIN32 to 0 by default since a bunch of code uses it
via an ifdef rather than by value.

5 years agobuild-sys: meson: Correctly set up RPATH
Arun Raghavan [Fri, 2 Aug 2019 21:11:55 +0000 (02:41 +0530)]
build-sys: meson: Correctly set up RPATH

This was being done automatically by autotools, now we need to manually
specify this for each executable/library with a dependency in a
non-standard directory.

5 years agobuild-sys: meson: Add -Wl,no-delete to relevant libraries
Arun Raghavan [Fri, 2 Aug 2019 20:22:09 +0000 (01:52 +0530)]
build-sys: meson: Add -Wl,no-delete to relevant libraries

This mirrors the autotools option for all server-side dynamic libraries.

5 years agoFixes to Catalan translation
Jordi Mas [Sun, 28 Jul 2019 10:17:39 +0000 (10:17 +0000)]
Fixes to Catalan translation

5 years agomeson: Fix installation of headers
Jan Alexander Steffens (heftig) [Wed, 10 Jul 2019 23:32:57 +0000 (01:32 +0200)]
meson: Fix installation of headers

To match Autotools:
 - internal.h should not be installed
 - Install simple.h and version.h

5 years agomeson: Fix library versioning to match Autotools
Jan Alexander Steffens (heftig) [Wed, 10 Jul 2019 23:25:38 +0000 (01:25 +0200)]
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.

5 years agomeson: Fix build of padsp
Jan Alexander Steffens (heftig) [Wed, 10 Jul 2019 22:52:50 +0000 (00:52 +0200)]
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.

5 years agobluetooth: Fix usage of RTP structures in SBC codec
Pali Rohár [Sun, 21 Jul 2019 15:07:02 +0000 (17:07 +0200)]
bluetooth: Fix usage of RTP structures in SBC codec

Rename struct rtp_payload to rtp_sbc_payload as it is specific for SBC
codec payload.

Add proper checks for endianity in rtp.h header and use uint8_t type
where appropriated.

Field frame_count is only 4 bit number, so add checks to prevent overflow.

And because is_fragmented field is not parsed by decoder there is no
support for decoding fragmented SBC frames. So throw an error in this case.

5 years agobluetooth: Change A2DP codec API of reset() method to indicate failure
Pali Rohár [Sun, 21 Jul 2019 15:07:01 +0000 (17:07 +0200)]
bluetooth: Change A2DP codec API of reset() method to indicate failure

SBC codec reset() method may fail, so propagate this failure to caller.

5 years agobluetooth: Fix usage of MTU, buffer sizes and return values of encode/decode methods
Pali Rohár [Sun, 21 Jul 2019 15:07:00 +0000 (17:07 +0200)]
bluetooth: Fix usage of MTU, buffer sizes and return values of encode/decode methods

Add explanation why minimal bitpool value is used in SBC codec as initial
bitpool value for A2DP source.

Set buffer size for reading/writing from/to A2DP socket to exact link MTU
value. This would ensure that A2DP codec does not produce larger packet as
maximal possible size which can be sent.

Because A2DP socket is of SOCK_SEQPACKET type, it is guaranteed that
we do not read two packets via one read/recvmsg call.

Properly check for all return values of encode/encode methods of A2DP codec
functions. They may fail at different levels. Also encode or decode API
method may return zero length buffer (e.g. because of algorithmic delay of
codec), so do not fail in this case.

5 years agoCommit fd9e3452 removed -ffast-math from the compile flags. Under some
Georg Chini [Sun, 21 Jul 2019 13:07:18 +0000 (15:07 +0200)]
Commit fd9e3452 removed -ffast-math from the compile flags. Under some
conditions this may lead to massive slowdown of floating point operations
when underflows or denormals are encountered. In particular, this problem
was observed with the soxr resampler after applying
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/120

Therefore this patch adds -ffast-math to the link flags of the pulseaudio
daemon. Linking with -ffast-math adds a procedure set_fast_math() to the
startup code of the daemon. On x86, the procedure sets bit 6 and 15 of the
mxcsr register. When these bits are set, denormals and results of
underflowing operations are truncated to 0.

5 years agoi18n: update Polish translation
Piotr Drąg [Sat, 20 Jul 2019 12:13:29 +0000 (14:13 +0200)]
i18n: update Polish translation

5 years agopasuspender: explain program argument in help
S Page [Tue, 16 Jul 2019 06:23:50 +0000 (06:23 +0000)]
pasuspender: explain program argument in help

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/706

5 years agosvolume: Mark channel parameter as earlyclobber
Arun Raghavan [Thu, 11 Jul 2019 05:27:31 +0000 (10:57 +0530)]
svolume: Mark channel parameter as earlyclobber

For all our MMX/SSE code, we use a temporary channel variable, assigned
to the DI register, which is zero'ed as the very first operation in the
inline assembly code, before any other code is run.

With GCC 9.1, while using -O2, the DI register is also used for the
input operand. This is perfectly legal, but causes our code to become
incorrect because the output operand that is assigned to DI is not
explicitly marked as being clobbered before inputs are read.

This change fixes the problem by adding an earlyclobber annotation (&)
to the DI output argument.

5 years agoalsa-mixer: Add a missing USB product ID for SteelSeries Arctis 7
Kaleb Ercanbrack [Thu, 11 Jul 2019 14:09:58 +0000 (14:09 +0000)]
alsa-mixer: Add a missing USB product ID for SteelSeries Arctis 7

5 years agobuild-sys: Install cmedia-high-speed-true-hdaudio.conf
Jan Alexander Steffens (heftig) [Wed, 10 Jul 2019 23:41:55 +0000 (01:41 +0200)]
build-sys: Install cmedia-high-speed-true-hdaudio.conf

This profile set was missing from the installation.

5 years agobuild-sys: meson: Disable coverage by default
Arun Raghavan [Thu, 11 Jul 2019 02:24:13 +0000 (07:54 +0530)]
build-sys: meson: Disable coverage by default

5 years agobuild-sys: Fixes for i18n parts of the meson build v12.99.1
Arun Raghavan [Mon, 1 Jul 2019 15:49:04 +0000 (21:19 +0530)]
build-sys: Fixes for i18n parts of the meson build

5 years agobuild-sys: Bump libpulse soversion
Arun Raghavan [Thu, 4 Jul 2019 08:49:33 +0000 (14:19 +0530)]
build-sys: Bump libpulse soversion

We've added new API and updated an enum. A bunch of function parameters
have been marked as const, but this probably shouldn't count as a change
anyway.

5 years agocore-util: Fix detection when running in a VM
Arun Raghavan [Mon, 1 Jul 2019 01:52:55 +0000 (07:22 +0530)]
core-util: Fix detection when running in a VM

The original code that was written was trying to detect what hypervisor
we were running under, rather than testing the presence bit first. We
don't really need the former, so let's use the more comprehensive latter
instead.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/684

5 years agosink-input: fix rewriting render memblockq when nothing should be rewound
Georg Chini [Wed, 3 Jul 2019 10:32:50 +0000 (12:32 +0200)]
sink-input: fix rewriting render memblockq when nothing should be rewound

If process_rewind() is called with nbytes = 0, process_rewind() will
nevertheless request a rewrite of the render memblockq.

This patch fixes the problem by adding the render memblockq length to the
rewrite amount only if nbytes > 0.

5 years agosource-output: Fix rewinding bug
Georg Chini [Wed, 3 Jul 2019 10:32:16 +0000 (12:32 +0200)]
source-output: Fix rewinding bug

Currently the rewind logic for the source output is broken if the output
does not implement a process_rewind() callback. In that case, the read
index of the delay memblockq is rewound. This is wrong, because the data
that is going to be re-written was not yet read. Instead the write index
should be rewound and the read index left untouched. This is the reason
for the rewind glitches of monitor sources.

5 years agobluetooth: Fix crash when disabling Bluetooth adapter
Frédéric Danis [Wed, 19 Jun 2019 09:09:11 +0000 (11:09 +0200)]
bluetooth: Fix crash when disabling Bluetooth adapter

This crash occurs when PA is connected to a phone through the oFono
backend.
When disabling the Bluetooth adapter, pa_bluetooth_device is removed before
hf_audio_card. Both keep refs on pa_bluetooth_transport. Those removal will
call pa_bluetooth_transport_free() from device_free() (bluez5-util.c) and
hf_audio_card_free() (backend-ofono.c).
In the end, the call to pa_bluetooth_transport_free() calls
pa_hasmap_remove() through pa_bluetooth_transport_unlink(), but since
memory has already been freed, the second try results in a segfault.

Triggering hf_audio_card removal during pa_bluetooth_device removal allows
hf_audio_card to be freed at the right time.

5 years agobluetooth: Fix crash in setup_stream()
Frédéric Danis [Tue, 18 Jun 2019 08:15:15 +0000 (10:15 +0200)]
bluetooth: Fix crash in setup_stream()

setup_stream() crashes when calling set_nonblock() with an invalid
stream_fd.

On a new call, the ofono backend gets notified of a new connection.
The ofono backend sets the transport state to playing, and that triggers
a profile change, which sets up the stream for the first time.
Then module-bluetooth-policy sets up the loopbacks. The loopbacks get
fully initialized before the crash.

After module-bluetooth-policy has done its things, the execution
continues in the transport state change hook. The next hook user is
module-bluez5-device, whose handle_transport_state_change() function
gets called. It will then set up the stream again even though it's
already set up. I'm not sure if that's a some kind of a bug.
setup_stream() can handle the case where it's unnecessarily called,
though, so this second setup is not a big problem.

The crash happens, because the connection died due to POLLHUP in the IO
thread before the second setup_stream() call.

5 years agocore-util: Use /proc/fd on Solaris as well in pa_close_all
Alan Coopersmith [Thu, 27 Jun 2019 01:32:40 +0000 (18:32 -0700)]
core-util: Use /proc/fd on Solaris as well in pa_close_all

Gets rid of > 65,000 unnecessary close() syscalls

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
5 years agomeson: check for sys/filio.h
Alan Coopersmith [Thu, 27 Jun 2019 00:31:14 +0000 (17:31 -0700)]
meson: check for sys/filio.h

Needed for FIONREAD on Solaris

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
5 years agomeson: fix builds on platorms without libsystemd
Alan Coopersmith [Thu, 27 Jun 2019 00:16:51 +0000 (17:16 -0700)]
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>
5 years agoi18n: update Polish translation
Piotr Drąg [Sun, 30 Jun 2019 14:37:28 +0000 (16:37 +0200)]
i18n: update Polish translation

5 years agoUpdate Croatian translation
muzena [Sun, 23 Jun 2019 12:26:22 +0000 (14:26 +0200)]
Update Croatian translation

5 years agomain: Log more information when executing default.pa fails
Tanu Kaskinen [Sat, 8 Jun 2019 08:44:43 +0000 (11:44 +0300)]
main: Log more information when executing default.pa fails

"Failed to initialize daemon" is not as informative message as it could
be. This change was inspired by the discussion in this bug:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/597

5 years agodaemon: Harden systemd service
Topi Miettinen [Wed, 10 Apr 2019 11:44:28 +0000 (14:44 +0300)]
daemon: Harden systemd service

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
5 years agoa2dp-codec-sbc: get rid of compiler warnings
Tanu Kaskinen [Sun, 16 Jun 2019 09:09:27 +0000 (12:09 +0300)]
a2dp-codec-sbc: get rid of compiler warnings

The warnings:

modules/bluetooth/a2dp-codec-sbc.c: In function ‘default_bitpool’:
modules/bluetooth/a2dp-codec-sbc.c:161:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
             switch (mode) {
             ^~~~~~
modules/bluetooth/a2dp-codec-sbc.c:169:9: note: here
         case SBC_SAMPLING_FREQ_44100:
         ^~~~
modules/bluetooth/a2dp-codec-sbc.c:170:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
             switch (mode) {
             ^~~~~~
modules/bluetooth/a2dp-codec-sbc.c:180:9: note: here
         case SBC_SAMPLING_FREQ_48000:
         ^~~~

These were valid warnings in that an invalid channel mode would result
in unintended fallthroughs, but the end result would anyway been a crash
in the pa_assert_not_reached() at the end of the function, so
functionally there's no change.

5 years ago.gitignore: add atomic-test
Tanu Kaskinen [Sat, 15 Jun 2019 08:14:33 +0000 (11:14 +0300)]
.gitignore: add atomic-test

5 years agoatomic: fix load and store for armv7 and higher
Thomas Hutschenreuther [Wed, 29 May 2019 17:20:37 +0000 (19:20 +0200)]
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>

5 years agoi18n: update Polish translation
Piotr Drąg [Mon, 10 Jun 2019 13:55:07 +0000 (15:55 +0200)]
i18n: update Polish translation

5 years agosink, source: Don't change suspend cause when unlinking
Tanu Kaskinen [Mon, 10 Jun 2019 11:18:47 +0000 (14:18 +0300)]
sink, source: Don't change suspend cause when unlinking

See the added comments for why this is necessary.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/667

5 years agomainloop: fix timeout assignment in pa_mainloop_prepare
shdown [Sun, 9 Jun 2019 13:40:14 +0000 (13:40 +0000)]
mainloop: fix timeout assignment in pa_mainloop_prepare

The function calculates the correct timeout (in microseconds) to assign
in the `u` variable, but then assigns `m->prepared_timeout` the value
of the `timeout` argument (in milliseconds).

5 years agostream-restore: Don't restore if the active_port is PA_AVAILABLE_NO
Hui Wang [Wed, 15 May 2019 06:39:27 +0000 (14:39 +0800)]
stream-restore: Don't restore if the active_port is PA_AVAILABLE_NO

We met two problems recently, one happened on a Lenovo machine with
dual analogue codecs, the other happened on a Dell machine with
a digital mic directly connected to PCH. The two problems are
basically same, there is an internal mic and an external mic, the
internal mic always shows up in the gnome-control-center, the external
mic only shows up when it is plugged. After the external mic is
plugged and users select it from gnome-control-center, the
gnome-control-center will read all saved streams through extension_cb,
and bind the source of external mic to all streams, after that the
apps only record sound via the source of external mic, after the
external mic is unplugged, the internal mic will automatically be
selected since it is the only left input device in the
gnome-control-center, since users don't select it, all streams are
still bond the source of external mic. When users record sound via
apps, they can't record any sound even the default_source is the
source of internal mic and the internal mic is selected in the UI.

It is very common that a machine has internal mic and external mic,
but this problem didn't expose before, that is because both internal
mic and external mic belong to one source, but for those two
machines, the internal mic belongs to one source, while the external
mic belongs to another source (they are in differnt codecs or one is
in the codec and the other is from PCH),

To fix it with a mininal change, we just check if the active_port is
PA_AVAILABLE_NO or not when building a new stream, if it is, don't
restore the device to the new built stream, let pa_source_output_new()
decide the source device for this stream.

And we also do the same change to sink_input.

This change only affects the new built streams, it will not change
the database, so the users' preference is still saved in the database,
after the active_port is not PA_AVAILABLE_NO, the new streams will
still restore to the preferred device.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
5 years agoi18n: Fix copyright information in pt_BR.po
Mark Filion [Thu, 6 Jun 2019 20:41:08 +0000 (20:41 +0000)]
i18n: Fix copyright information in pt_BR.po