platform/upstream/pulseaudio.git
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

5 years agomeson: Duplicate split of long daemon tests from autotools build
Arun Raghavan [Sat, 8 Jun 2019 10:52:05 +0000 (12:52 +0200)]
meson: Duplicate split of long daemon tests from autotools build

This avoids the running the longer daemon tests by default to make CI
faster.

5 years agomeson: Skip norun tests
Arun Raghavan [Sat, 8 Jun 2019 10:47:53 +0000 (12:47 +0200)]
meson: Skip norun tests

These weren't meant to be run, so we skip then while generating meson
tests.

5 years agodaemon: Drop empty fields in desktop file
Arun Raghavan [Sat, 8 Jun 2019 10:40:47 +0000 (12:40 +0200)]
daemon: Drop empty fields in desktop file

The fields weren't used, and were incorrectly munged during generation.
This makes validation succeed.

5 years agomeson: Disable alsa-mixer-path-test
Arnaud Rebillout [Wed, 16 Jan 2019 11:33:15 +0000 (18:33 +0700)]
meson: Disable alsa-mixer-path-test

This test relies on parsing the generated Makefile. A meson equivalent
requires to re-write all the parser.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Add running-from-build-tree option
Arnaud Rebillout [Wed, 16 Jan 2019 10:58:42 +0000 (17:58 +0700)]
meson: Add running-from-build-tree option

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Increase timeout for tests
Arnaud Rebillout [Wed, 16 Jan 2019 08:40:31 +0000 (15:40 +0700)]
meson: Increase timeout for tests

This solves numerous timeout failures

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Add support for gcov
Arnaud Rebillout [Wed, 28 Nov 2018 13:43:53 +0000 (20:43 +0700)]
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>
5 years agomeson: Add ORC support
Arnaud Rebillout [Wed, 28 Nov 2018 08:42:25 +0000 (15:42 +0700)]
meson: Add ORC support

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Disable esound modules
Arnaud Rebillout [Mon, 26 Nov 2018 10:38:31 +0000 (17:38 +0700)]
meson: Disable esound modules

For now esound is not supported with the meson build, although it
wouldn't be that hard to support it.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Install headers
Arnaud Rebillout [Mon, 26 Nov 2018 10:33:11 +0000 (17:33 +0700)]
meson: Install headers

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Install cmake files
Arnaud Rebillout [Mon, 26 Nov 2018 10:29:28 +0000 (17:29 +0700)]
meson: Install cmake files

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Install systemd user service
Arnaud Rebillout [Mon, 26 Nov 2018 10:12:09 +0000 (17:12 +0700)]
meson: Install systemd user service

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Build libwebrtc-util as a shared library
Arnaud Rebillout [Mon, 26 Nov 2018 09:44:06 +0000 (16:44 +0700)]
meson: Build libwebrtc-util as a shared library

As it'sdone in the autotools

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Install utils symlinks, install qpaeq
Arnaud Rebillout [Mon, 26 Nov 2018 09:43:25 +0000 (16:43 +0700)]
meson: Install utils symlinks, install qpaeq

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Move oss-util in a library
Arnaud Rebillout [Mon, 26 Nov 2018 09:29:12 +0000 (16:29 +0700)]
meson: Move oss-util in a library

Like it was with the aututools

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Fix udevrulesdir
Arnaud Rebillout [Mon, 26 Nov 2018 08:50:56 +0000 (15:50 +0700)]
meson: Fix udevrulesdir

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Install dbus policy file
Arnaud Rebillout [Mon, 26 Nov 2018 08:45:41 +0000 (15:45 +0700)]
meson: Install dbus policy file

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Fix install paths
Arnaud Rebillout [Mon, 26 Nov 2018 08:36:13 +0000 (15:36 +0700)]
meson: Fix install paths

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Build daemon custom targets by default
Arnaud Rebillout [Mon, 26 Nov 2018 08:33:13 +0000 (15:33 +0700)]
meson: Build daemon custom targets by default

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Translate and install desktop file
Arnaud Rebillout [Mon, 26 Nov 2018 08:32:25 +0000 (15:32 +0700)]
meson: Translate and install desktop file

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Add basic po support
Arnaud Rebillout [Mon, 26 Nov 2018 08:31:49 +0000 (15:31 +0700)]
meson: Add basic po support

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Install ALSA udevrules
Arnaud Rebillout [Mon, 26 Nov 2018 08:12:29 +0000 (15:12 +0700)]
meson: Install ALSA udevrules

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Fix various install scripts
Arnaud Rebillout [Mon, 26 Nov 2018 07:11:47 +0000 (14:11 +0700)]
meson: Fix various install scripts

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Add udevrulesdir option
Arnaud Rebillout [Mon, 26 Nov 2018 08:12:04 +0000 (15:12 +0700)]
meson: Add udevrulesdir option

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Add systemduserunitdir option
Arnaud Rebillout [Mon, 26 Nov 2018 06:33:44 +0000 (13:33 +0700)]
meson: Add systemduserunitdir option

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Fix pulsedspdir
Arnaud Rebillout [Mon, 19 Nov 2018 08:49:24 +0000 (15:49 +0700)]
meson: Fix pulsedspdir

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Install pkg-config files
Arnaud Rebillout [Mon, 19 Nov 2018 08:48:35 +0000 (08:48 +0000)]
meson: Install pkg-config files

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Install vala apis
Arnaud Rebillout [Mon, 5 Nov 2018 05:17:37 +0000 (12:17 +0700)]
meson: Install vala apis

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Fix man install dir
Arnaud Rebillout [Mon, 5 Nov 2018 05:21:31 +0000 (12:21 +0700)]
meson: Fix man install dir

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Handle man pages symlinks with a meson install script
Arnaud Rebillout [Mon, 5 Nov 2018 05:05:35 +0000 (12:05 +0700)]
meson: Handle man pages symlinks with a meson install script

This seems to be the common way to handle that, until meson decides to
address #1602: https://github.com/mesonbuild/meson/issues/1602

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Make man page build and install conditional
Arnaud Rebillout [Mon, 5 Nov 2018 05:03:03 +0000 (12:03 +0700)]
meson: Make man page build and install conditional

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Install completion files
Arnaud Rebillout [Mon, 5 Nov 2018 04:42:24 +0000 (11:42 +0700)]
meson: Install completion files

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agotest-daemon: No need to define dl-search-path
Arnaud Rebillout [Wed, 31 Oct 2018 11:41:46 +0000 (18:41 +0700)]
test-daemon: No need to define dl-search-path

There's already a hook that modifies the search path when run from the
build tree.

      if (pa_run_from_build_tree()) {
          pa_log_notice("Detected that we are run from the build tree, fixing search path.");
  #ifdef MESON_BUILD
          c->dl_search_path = pa_xstrdup(PA_BUILDDIR PA_PATH_SEP "src" PA_PATH_SEP "modules");
  #else
          c->dl_search_path = pa_xstrdup(PA_BUILDDIR);
  #endif
      } else

I'm not sure how it works behind the hood, but by setting
--dl-search-path, we get errors in the logs when running `make
check-daemon`:

 E: [pulseaudio][daemon/ltdl-bind-now.c:75 bind_now_open()] Failed to open module /home/arno/proj/pulse/src/pa.up/src/.libs/.libs/module-native-protocol-unix.so:
   /home/arno/proj/pulse/src/pa.up/src/.libs/.libs/module-native-protocol-unix.so: cannot open shared object file: No such file or directory
 I: [pulseaudio][pulsecore/module.c:197 pa_module_load()] Loaded "module-native-protocol-unix" (index: #3; argument: "").

So basically, PA tries two paths, fails the first time (obviously we can
see the path is not correct), then tries again with another path (where
does it gets it?) and succeeds. So there's no obvious error if you don't
look at the log.

This commit removes the useless `--dl-search-path`, which has the effect
to remove the errors in the logs.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years ago.gitlab-ci: Add meson test-daemon
Arnaud Rebillout [Wed, 31 Oct 2018 11:51:29 +0000 (18:51 +0700)]
.gitlab-ci: Add meson test-daemon

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Enable echo-cancel test
Arnaud Rebillout [Wed, 31 Oct 2018 12:16:08 +0000 (19:16 +0700)]
meson: Enable echo-cancel test

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Define HAVE_SYS_UN_H, this was forgotten
Arnaud Rebillout [Wed, 31 Oct 2018 11:39:40 +0000 (18:39 +0700)]
meson: Define HAVE_SYS_UN_H, this was forgotten

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Boolean options default to true, no need to say it
Arnaud Rebillout [Wed, 31 Oct 2018 12:18:09 +0000 (19:18 +0700)]
meson: Boolean options default to true, no need to say it

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Enable (almost) all tests
Arnaud Rebillout [Wed, 31 Oct 2018 05:45:11 +0000 (12:45 +0700)]
meson: Enable (almost) all tests

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Add libpulse simple
Arnaud Rebillout [Wed, 31 Oct 2018 05:31:18 +0000 (12:31 +0700)]
meson: Add libpulse simple

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Move shm_dep check where it belongs
Arnaud Rebillout [Wed, 31 Oct 2018 05:36:01 +0000 (12:36 +0700)]
meson: Move shm_dep check where it belongs

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Add some symbol checks
Arnaud Rebillout [Wed, 31 Oct 2018 05:34:03 +0000 (12:34 +0700)]
meson: Add some symbol checks

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Add a check for sys/eventfd.h header
Arnaud Rebillout [Wed, 31 Oct 2018 05:32:39 +0000 (12:32 +0700)]
meson: Add a check for sys/eventfd.h header

This test is present in the configure.ac, it was forgotten in
meson.build.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agomeson: Add a dependency object for libpulse_mainloop_glib
Arnaud Rebillout [Wed, 31 Oct 2018 05:31:41 +0000 (12:31 +0700)]
meson: Add a dependency object for libpulse_mainloop_glib

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
5 years agosink: Set monitor source's avoid-resampling value to its sink's
Sangchul Lee [Fri, 7 Jun 2019 12:20:55 +0000 (21:20 +0900)]
sink: Set monitor source's avoid-resampling value to its sink's

It was omitted. This patch fixes unexpected behavior that avoid-
resampling does not work in some cases.

Signed-off-by: Sangchul Lee <sangchul1011@gmail.com>
5 years agobuild-sys: Fix up meson install paths
Arun Raghavan [Sat, 13 Oct 2018 06:20:03 +0000 (11:50 +0530)]
build-sys: Fix up meson install paths

Brings things in line with the autotools build, and adds ALSA mixer
paths and profile-sets into the meson build system as well.

The module installation path is also now customisable.

5 years agoloopback: fix callback name in comment
Tanu Kaskinen [Wed, 29 May 2019 08:07:01 +0000 (11:07 +0300)]
loopback: fix callback name in comment

5 years agoloopback: remove an unnecessary level of pointer dereferencing
Tanu Kaskinen [Wed, 29 May 2019 05:02:45 +0000 (08:02 +0300)]
loopback: remove an unnecessary level of pointer dereferencing

The userdata struct has a pointer to the core itself, no need to go via
u->module to get to it.

5 years agoi18n: Don't compile with -ffast-math
Felipe Sateler [Wed, 16 Jan 2019 00:52:31 +0000 (21:52 -0300)]
i18n: Don't compile with -ffast-math

This flag results in calls to (at least) isfinite() and isnan() becoming
skipped, and a constant false returned. This caused volume-test to fail
on Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916504

Since PulseAudio deals with negative infinities with volume dB values,
this is not a problem only in volume-test. We shouldn't use -ffast-math
at all.

5 years agoi18n: New translation for Afrikaans (af)
Friedel Wolff [Wed, 9 Jan 2019 10:24:00 +0000 (12:24 +0200)]
i18n: New translation for Afrikaans (af)

5 years agocore: add simple message interface
Georg Chini [Tue, 26 Mar 2019 09:41:05 +0000 (10:41 +0100)]
core: add simple message interface

This patch adds a new feature to the core which allows to send messages
to objects. An object can register/unregister a message handler with
pa_message_handler_{register, unregister}() while a message can be sent
to the handler using the pa_message_handler_send_message() function.
A message has 4 arguments (apart from passing the core):

object_path: The path identifying the object that will receive the message
message: message command
message_parameters: A string containing additional parameters
response: Pointer to a response string that will be filled by the
          message handler. The caller is responsible to free the string.

The patch is a precondition for the following patches that allow clients
to send messages to pulseaudio objects.

There is no restriction on object names, except that an object path
always starts with a "/". The intention is to use a path-like syntax,
for example /core/sink_1 for a sink or /name/instances/index for modules.
The exact naming convention still needs to be agreed.

5 years agocore-util: Avoid usage of pa_strbuf in pa_escape()
Georg Chini [Tue, 26 Mar 2019 09:39:21 +0000 (10:39 +0100)]
core-util: Avoid usage of pa_strbuf in pa_escape()

The current code uses a pa_strbuf to construct the escaped string. This
will generate a linked list member for each character which may be very
inefficient.
This patch avoids the use of pa_strbuf by allocating a sufficiently large
string which can be filled with the output data.

5 years agoExpose control param to alsa-card module
Nate Brown [Tue, 14 May 2019 16:28:32 +0000 (09:28 -0700)]
Expose control param to alsa-card module

5 years agocore: send subscription events when the configured default sink or source changes
Tanu Kaskinen [Tue, 21 May 2019 12:57:20 +0000 (15:57 +0300)]
core: send subscription events when the configured default sink or source changes

These events were missing, because the
pa_core_update_default_sink/source() calls were assumed to send the
subscription events when necessary. Often that indeed is the case, but
if the current configured default sink doesn't exist, and then the
current default sink is set as the configured default sink, the
configured default sink changes but the default sink doesn't, and in
this case pa_core_update_default_sink() doesn't send the change event.

module-default-device-restore relies on getting a notification whenever
the configured default sink changes, and the missing event meant that
the files containing the configured sink and source weren't updated in
some cases.

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

5 years agoi18n: a couple of improvements to the Spanish translation
Tanu Kaskinen [Wed, 22 May 2019 15:07:09 +0000 (18:07 +0300)]
i18n: a couple of improvements to the Spanish translation

Suggested by R. Diez:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/613

5 years agoi18n: Update Galician translations
Fran Diéguez [Tue, 21 May 2019 11:57:18 +0000 (11:57 +0000)]
i18n: Update Galician translations

5 years ago[l10n] Update Ukrainian translation
Yuri Chornoivan [Tue, 21 May 2019 09:56:29 +0000 (09:56 +0000)]
[l10n] Update Ukrainian translation

5 years agoUpdate Brazilian Portuguese translation
Rafael Fontenelle [Tue, 14 May 2019 22:17:02 +0000 (22:17 +0000)]
Update Brazilian Portuguese translation

5 years agoUpdate Swedish Translation
Josef Andersson [Tue, 8 Jan 2019 23:01:58 +0000 (00:01 +0100)]
Update Swedish Translation

5 years agonull-sink: setting maximum latency to 50 ms when rewinds are disabled
Wellington Wallace [Wed, 8 May 2019 15:05:49 +0000 (12:05 -0300)]
null-sink: setting maximum latency to 50 ms when rewinds are disabled

5 years agonull-sink: add an option that allows rewinds to be disabled
Wellington Wallace [Tue, 7 May 2019 14:58:45 +0000 (11:58 -0300)]
null-sink: add an option that allows rewinds to be disabled

5 years agoMerge branch 'allow-to-disable-null-sink-rewinds' of https://gitlab.freedesktop.org...
Wellington Wallace [Tue, 7 May 2019 14:06:59 +0000 (11:06 -0300)]
Merge branch 'allow-to-disable-null-sink-rewinds' of https://gitlab.freedesktop.org/wwmm/pulseaudio into allow-to-disable-null-sink-rewinds

5 years agonull-sink: add an option that allows rewinds to be disabled
Wellington Wallace [Sat, 4 May 2019 16:21:21 +0000 (13:21 -0300)]
null-sink: add an option that allows rewinds to be disabled

5 years agonull-sink: add an option that allows rewinds to be disabled
Wellington Wallace [Sat, 4 May 2019 16:21:21 +0000 (13:21 -0300)]
null-sink: add an option that allows rewinds to be disabled

5 years agoalsa: Fix inclusion of use-case.h
Takashi Iwai [Sun, 21 Apr 2019 09:59:30 +0000 (11:59 +0200)]
alsa: Fix inclusion of use-case.h

The recent change in ALSA upstream stripped -I$include/alsa path from
pkgconfig.  We already fixed for this change in some places but still
the code for UCM was overlooked, and this resulted in the unresolved
symbols in alsa card module. Fix them as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 years agobuild-sys: Update meson dependency to 0.50.0
Arun Raghavan [Wed, 17 Apr 2019 10:28:45 +0000 (15:58 +0530)]
build-sys: Update meson dependency to 0.50.0

This is needed for currently used features (disabler and install in
configure_file).

5 years agobuild-sys: Fix the Meson build
Tanu Kaskinen [Fri, 12 Apr 2019 13:05:51 +0000 (16:05 +0300)]
build-sys: Fix the Meson build

The recent bluetooth patches didn't update the Meson build system.

5 years agobluetooth: Set correct endianity of audio samples for SBC codec
Pali Rohár [Sat, 6 Apr 2019 09:16:01 +0000 (11:16 +0200)]
bluetooth: Set correct endianity of audio samples for SBC codec

Pulseaudio SBC codec defines that audio samples are in PA_SAMPLE_S16LE
format which is little endian. But libsbc library expects audio samples by
default in host endianity which is big endian on big endian system. So SBC
support on big endian system is broken. To fix this problem tell libsbc
library that audio samples are in little endian to match PA_SIMPLE_S16LE
sample format.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=91359

5 years agobluetooth: Clean up SBC bitpool calculation
Pali Rohár [Sat, 6 Apr 2019 09:16:00 +0000 (11:16 +0200)]
bluetooth: Clean up SBC bitpool calculation

Remove dead code and replace numeric bitpool values by macro definitions.

Maximal bitpool value in fill_capabilities() was reduced from 64 to 53
(SBC_BITPOOL_HQ_JOINT_STEREO_44100) because default_bitpool() already set
maximal value to 53.

This patch does not change SBC behavior as maximal bitpool was already
limited to 53. So it is just clean up.

5 years agobluetooth: Add missing validations for SBC codec parameters
Pali Rohár [Sat, 6 Apr 2019 09:15:59 +0000 (11:15 +0200)]
bluetooth: Add missing validations for SBC codec parameters

5 years agobluetooth: Modular API for A2DP codecs
Pali Rohár [Sat, 6 Apr 2019 09:15:58 +0000 (11:15 +0200)]
bluetooth: Modular API for A2DP codecs

This patch introduce new modular API for bluetooth A2DP codecs. Its
benefits are:

* bluez5-util and module-bluez5-device does not contain any codec specific
  code, they are codec independent.

* For adding new A2DP codec it is needed just to adjust one table in
  a2dp-codec-util.c file. All codec specific functions are in separate
  codec file.

* Support for backchannel (microphone voice). Some A2DP codecs (like
  FastStream or aptX Low Latency) are bi-directional and can be used for
  both music playback and audio call.

* Support for more configurations per codec. This allows to implement low
  quality mode of some codec together with high quality.

Current SBC codec implementation was moved from bluez5-util and
module-bluez5-device to its own file and converted to this new A2DP API.

5 years agobluetooth: Update a2dp-codecs.h from upstream bluez project
Pali Rohár [Sat, 6 Apr 2019 09:15:57 +0000 (11:15 +0200)]
bluetooth: Update a2dp-codecs.h from upstream bluez project

5 years agobluetooth: policy: Remove BlueZ 4 related code
Pali Rohár [Sat, 6 Apr 2019 09:15:56 +0000 (11:15 +0200)]
bluetooth: policy: Remove BlueZ 4 related code

5 years agol10n: Update lt.po
Moo [Mon, 8 Apr 2019 20:37:14 +0000 (20:37 +0000)]
l10n: Update lt.po

5 years agomeson: when avahi is disabled, do not build it's code
David Heidelberg [Sat, 23 Mar 2019 19:21:17 +0000 (20:21 +0100)]
meson: when avahi is disabled, do not build it's code

Signed-off-by: David Heidelberg <david@ixit.cz>
5 years agomeson: fix build with simple
David Heidelberg [Sat, 23 Mar 2019 16:12:52 +0000 (16:12 +0000)]
meson: fix build with simple

Signed-off-by: David Heidelberg <david@ixit.cz>
5 years agothread-mainloop: Add API for running a callback unlocked
Arun Raghavan [Tue, 12 Mar 2019 06:38:08 +0000 (12:08 +0530)]
thread-mainloop: Add API for running a callback unlocked

This adds API to allow clients to schedule a callback in the mainloop
thread without the mainloop lock being held. This is meant for a case
where the client might be dealing with locking its own objects in
addition to the mainloop thread itself. In this case, it might need ton
control the locking order of the two, to match the order in other
threads, as it might not always be able to allow for its objects to be
locked after the mainloop thread lock.

5 years agonull-source: fix multiple bugs
Georg Chini [Tue, 26 Mar 2019 09:36:19 +0000 (10:36 +0100)]
null-source: fix multiple bugs

The current null-source implementation has several bugs:

1) The latency reported is the negative of the correct latency.
2) The memchunk passed to pa_source_post() is not initialized
with silence.
3) In PA_SOURCE_MESSAGE_SET_STATE the timestamp is always set
when the source transitions to RUNNING state. This should only
happen when the source transitions from SUSPENDED to RUNNING
but also if it changes from SUSPENDED to IDLE.
4) The timing of the thread function is incorrect. It always
uses u->latency_time, regardless of the specified source
latency.
5) The latency_time argument seems pointless because the source
is defined with dynamic latency.

This patch fixes the issues by
1) inverting the sign of the reported latency,
2) initializing the memchunk with silence,
3) changing the logic in PA_SOURCE_MESSAGE_SET_STATE so that
the timestamp is set when needed,
4) using u->block_usec instead of u->latency_time for setting
the rtpoll timer and checking if the timer has elapsed,
5) removing the latency_time option.

5 years agoremap: support S32NE work format
Sascha Silbe [Tue, 26 Mar 2019 09:35:55 +0000 (10:35 +0100)]
remap: support S32NE work format

So far PulseAudio only supported two different work formats: S16NE if
it's sufficient to represent the input and output formats without loss
of precision and FLOAT32NE in all other cases. For systems that use
S32NE exclusively, this results in unnecessary conversions from S32NE to
FLOAT32NE and back again.

Add S32NE remap operations and make use of them (for the COPY and
TRIVIAL resamplers) if both input and output format are S32NE. This
avoids the back and forth conversions between S32NE and FLOAT32NE,
significantly improving performance for those cases.

5 years agotests: test NEON 2-channel->4-channel rearrange
Sascha Silbe [Fri, 8 Mar 2019 10:42:30 +0000 (11:42 +0100)]
tests: test NEON 2-channel->4-channel rearrange

We have optimised 2-channel->4-channel rearrange remap functions. Test
them.

5 years agotests: fix possible segfault in cpu-remap-test
Sascha Silbe [Fri, 8 Mar 2019 09:32:19 +0000 (10:32 +0100)]
tests: fix possible segfault in cpu-remap-test

pa_init_remap_func() takes care to initialise pa_remap_t.do_remap to
NULL before calling init_remap_func (the CPU-specific remap init
function) and invokes init_remap_c if init_remap_func did not set
pa_remap_t.do_remap to non-NULL. remap_init_test_channels() calls
init_remap_func() directly so it must make sure pa_remap_t.do_remap is
set to NULL. Otherwise we'll end up with a random value in
pa_remap_t.do_remap if there is no CPU-optimised remap function for the
current operation.

5 years agoalsa: Use correct header path
Olaf Hering [Wed, 27 Mar 2019 08:35:05 +0000 (09:35 +0100)]
alsa: Use correct header path

Consumers are expected to use <alsa/asoundlib.h> instead of
<asoundlib.h>.

This is in preparation of an change to pkgconfig(alsa) to
not pollute CFLAGS with -I/usr/include/alsa anymore.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
5 years agoi18n: Update Russian translation
Alexander Potashev [Sat, 9 Mar 2019 20:34:59 +0000 (23:34 +0300)]
i18n: Update Russian translation

Translated in sync with the guidelines at
http://l10n.lrn.ru/wiki/Pulseaudio

5 years agostream-interaction: Remove useless condition
Sangchul Lee [Tue, 26 Mar 2019 14:14:19 +0000 (23:14 +0900)]
stream-interaction: Remove useless condition

Signed-off-by: Sangchul Lee
5 years agorole-ducking, role-cork: Add use_source_trigger argument
Sangchul Lee [Mon, 18 Mar 2019 05:46:13 +0000 (14:46 +0900)]
role-ducking, role-cork: Add use_source_trigger argument

This is added to keep backward compatibility. The default value of
this new argument is false. Therefore, triggering by source-output
will be activated only if it is set to true explicitly.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
5 years agostream-interaction: Use PA_IDXSET_FOREACH macro to iterate idxset
Sangchul Lee [Mon, 18 Mar 2019 05:45:14 +0000 (14:45 +0900)]
stream-interaction: Use PA_IDXSET_FOREACH macro to iterate idxset

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
5 years agostream-interaction: Support for triggering ducking/cork by source-output
Sangchul Lee [Mon, 11 Mar 2019 03:00:11 +0000 (12:00 +0900)]
stream-interaction: Support for triggering ducking/cork by source-output

Previously, media.role property of only sink-input is used to
determine to trigger and apply ducking or cork to sink-inputs.

On the other hand, some use cases require that source-output
also need to trigger the effect to sink-inputs. Therefore this
patch adds logic to retrieve source-ouputs to find trigger role
by checking media.role property and apply ducking/cork to sink-
inputs that meet conditions.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
5 years agoi18n: Update Danish translation
scootergrisen [Mon, 25 Mar 2019 16:44:05 +0000 (16:44 +0000)]
i18n: Update Danish translation

5 years agoi18n: Add danish translation
scootergrisen [Mon, 25 Mar 2019 12:47:34 +0000 (13:47 +0100)]
i18n: Add danish translation

5 years agoladspa-sink: Suspend virtual sink when master is suspended
Georg Chini [Tue, 12 Feb 2019 19:38:09 +0000 (20:38 +0100)]
ladspa-sink: Suspend virtual sink when master is suspended

Currently, the ladspa-sink is not suspended when the master sink is suspended.

With this patch, the ladspa-sink will be suspended with suspend cause
PA_SUSPEND_UNAVAILABLE when the master sink is suspended for other reasons
than PA_SUSPEND_IDLE. This fixes issue #15.

5 years agosink, source: Call sink input suspend callback also on suspend cause change
Georg Chini [Tue, 12 Feb 2019 19:21:01 +0000 (20:21 +0100)]
sink, source: Call sink input suspend callback also on suspend cause change

Currently, virtual sinks and sources are not suspended when the master sink
or source is suspended. To implement this, the slave must be able to track
the suspend cause of the master.

With this patch, the sink input suspend callback will not only be called
when the sink or source is changing state, but also when the suspend cause
changes. Similar to the set_state_in_*_thread_cb() functions, the suspend
callback receives a state and a suspend cause as additional arguments.
Because the new state and suspend cause of the sink or source have already
been set, the old values are passed to the callback.

5 years agoalsa: Improve resume logic after alsa suspend
Georg Chini [Sat, 9 Mar 2019 19:19:34 +0000 (20:19 +0100)]
alsa: Improve resume logic after alsa suspend

Currently, when a system is waking up from suspend, the resume process of the
ALSA sink and source is unstable. Sometimes the device needs to be restarted
multiple times and when the system was suspended between snd_pcm_mmap_begin()
and snd_pcm_mmap_commit(), pulseaudio crashes on resume.
Additionally, variables are not reset after the resume, so that sink/source
report wrong latencies.
This patch fixes the issues by closing and re-opening the PCM if recovery
from an error condition is not possible. Additionally, the variables are
reset, so that latencies are reported correctly.

5 years agoloopback: Add option fast_adjust_threshold_msec
Georg Chini [Fri, 1 Mar 2019 19:00:52 +0000 (20:00 +0100)]
loopback: Add option fast_adjust_threshold_msec

After a suspend/resume cycle of a system, it may be possible that module-loopback
accumulates several seconds of audio in the memblockq before the alsa sink becomes
active again. Also it may be possible for other reasons that the actual loopback
latency is too different from the target latency to be adjusted in a reasonable
time by the normal rate controller.
This patch adds the option fast_adjust_threshold_msec to module-loopback. If set,
the latency will be forcefully adjusted to the target latency by dropping or
inserting samples if the actual latency differs more than fast_adjust_threshold_msec
from the target latency.
Also the calculation of the real adjust time would fail when the system was
suspended because that case was not considered. Now the real adjust time
calculation is skipped if the time passed between two calls of adjust_rates()
appears significantly too long.

5 years agoRemove bad characters from Malayalam translation
Piotr Drąg [Sun, 10 Mar 2019 20:03:20 +0000 (21:03 +0100)]
Remove bad characters from Malayalam translation

5 years agoi18n: update Italian translation
Milo Casagrande [Tue, 12 Mar 2019 13:46:43 +0000 (14:46 +0100)]
i18n: update Italian translation

Signed-off-by: Milo Casagrande <milo@milo.name>
5 years agocore-util: Use size_t for out parameter of pa_split_*in_place()
Sangchul Lee [Mon, 18 Mar 2019 07:47:55 +0000 (16:47 +0900)]
core-util: Use size_t for out parameter of pa_split_*in_place()

pa_split_in_place() and pa_split_spaces_in_place() are modifed
to use size_t type instead of integer type.

alsa-ucm.c is revised according to this change.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
5 years agobuild-sys: Lower the minimum gettext version
Tanu Kaskinen [Thu, 14 Mar 2019 19:10:50 +0000 (21:10 +0200)]
build-sys: Lower the minimum gettext version

The old minimum version was set in commit 57e3ccaf51 based on what the
commit author happened to have installed at the time. Russell Treleaven
now confirmed that Debian 8's gettext version, 0.19.3, works fine too,
or at least PulseAudio builds without errors. There might be room to
lower the required version even further, but that requires someone to
test older gettext versions.