platform/upstream/pulseaudio.git
10 years agoFix the WhatIsWrongWithSystemWide URL
Alexander E. Patrakov [Sat, 29 Nov 2014 16:09:30 +0000 (21:09 +0500)]
Fix the WhatIsWrongWithSystemWide URL

Pavel Machek reported in his blog that our message about the system mode
has a dead link in it. And this link is also present in translations.
So, I replaced it in the source and fixed all translations using a script:

for a in po/*.po ; do msgcat --no-wrap $a | sed
's@http://pulseaudio.org/wiki/WhatIsWrongWithSystemMod
@http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode @g' | sed
's@http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode@http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/@g'
| sed 's@/\.@/ .@g' | sed 's@/,@/ ,@g' | msgcat - > $a.new

git add -i  # to filter out formatting changes

The "/." and "/," replacements are needed so that various terminal
emulators don't include the trailing "." or "," into the clickable URL.

The resulting patch is attached, just in case, in order to avoid
damaging non-ASCII characters.

--
Alexander E. Patrakov

>From 7dcd197571840e467d688f0f7354253730bbcc15 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sat, 29 Nov 2014 20:56:27 +0500
Subject: [PATCH] Fix the WhatIsWrongWithSystemWide URL

Reported by Pavel Machek in http://pavelmachek.livejournal.com/126190.html

All translations were also fixed using a script.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
10 years agoFix URLs still pointing to the old wiki
Alexander E. Patrakov [Sat, 29 Nov 2014 16:49:11 +0000 (21:49 +0500)]
Fix URLs still pointing to the old wiki

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
10 years agoRevert "launch: Disable autospawn by default when systemd daemon support is enabled." v5.99.2
David Henningsson [Fri, 19 Dec 2014 12:46:11 +0000 (13:46 +0100)]
Revert "launch: Disable autospawn by default when systemd daemon support is enabled."

This reverts commit 7276faca72e9696d4891daff139aee52509f43bf.

Using the new systemd socket activation for PulseAudio will cause PulseAudio to not
have any connection with D-Bus, breaking device reservation protocol, module-jackdbus-detect
and module-dbus-protocol. Therefore, autospawn is now still enabled by default even if you
build with systemd daemon headers.

10 years agocard-restore: Fix profile restoring with bluetooth
Tanu Kaskinen [Tue, 16 Dec 2014 11:14:41 +0000 (13:14 +0200)]
card-restore: Fix profile restoring with bluetooth

The bluetooth card is created when the first profile becomes
available, which means that the card may have profiles that are not
available when the card is initialized. If module-card-restore tries
to restore such profile, that will fail, and the card will be
initialized with the "off" profile active.

This patch modifies module-card-restore so that if follows the profile
availability status, and when the saved profile becomes available, it
is activated. Additionally, module-card-restore is modified so that it
doesn't even try to restore unavailable profiles, when the necessary
information is available. In practice there are two existing places
where the profile is restored, and only one of those contexts has the
necessary information available. Unfortunately, it's the more
important context (card creation) where the information is not
available. This means that module-card-restore will set the initial
profile of a new card even if the profile is unavailable, and this
will cause an ugly warning in the log, even though there's nothing
abnormal happening.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=87081
10 years agobluez5: Do not suspend on no -> unknown profile transitions
David Henningsson [Fri, 19 Dec 2014 09:24:47 +0000 (10:24 +0100)]
bluez5: Do not suspend on no -> unknown profile transitions

In case a transport is currently disconnected and transitions to
idle, that should not count as a "remote hang up" event.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agointrospect: Minor documentation fix
Arun Raghavan [Tue, 4 Nov 2014 08:46:06 +0000 (14:16 +0530)]
introspect: Minor documentation fix

10 years agomemblock: Initialize mempool object to zero
David Henningsson [Tue, 9 Dec 2014 21:58:36 +0000 (22:58 +0100)]
memblock: Initialize mempool object to zero

This fixes a "use of uninitialised value" error in previous memblock commit.

Reported-by: Alexander Patrakov <patrakov@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agosrbchannel: Check return value of pa_memblock_new_pool
David Henningsson [Thu, 4 Dec 2014 21:06:30 +0000 (22:06 +0100)]
srbchannel: Check return value of pa_memblock_new_pool

In case PA_MEMPOOL_DISABLE is set, pa_memblock_new_pool can return
NULL. It does not make sense to set up a srbchannel without a shared
memory pool, so just fail in this case.

Reported-by: Alexander Patrakov <patrakov@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agoi18n: Add French translation for "Speaker"
Tanu Kaskinen [Mon, 8 Dec 2014 13:04:40 +0000 (15:04 +0200)]
i18n: Add French translation for "Speaker"

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=87073
10 years agoWarn on loading module-dbus-protocol
Alexander E. Patrakov [Thu, 4 Dec 2014 15:34:09 +0000 (20:34 +0500)]
Warn on loading module-dbus-protocol

See also
https://www.mail-archive.com/ubuntu-audio-dev@lists.launchpad.net/msg00268.html

The warning may be useful for users who carried over the module-loading
statement from default configuration files shipped with old PulseAudio
versions.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
10 years agomodule-equalizer-sink: remove erroneous fixme
Jason Newton [Fri, 5 Dec 2014 08:38:31 +0000 (08:38 +0000)]
module-equalizer-sink: remove erroneous fixme

pa_memblockq_drop is guaranteed to drop the chunk we just extracted from the
memblockq which internally unrefs the chunk.

10 years agomodule-equalizer-sink: use fftwf_free in all the right places
Jason Newton [Fri, 5 Dec 2014 08:38:30 +0000 (08:38 +0000)]
module-equalizer-sink: use fftwf_free in all the right places

Several mallocs were made using fftwf_malloc and were erroneously freed by
pa_xfree. This patch corrects these calls of pa_xfree to fftwf_free.

10 years agoWarn on loading module-equalizer-sink
Alexander E. Patrakov [Thu, 4 Dec 2014 15:34:08 +0000 (20:34 +0500)]
Warn on loading module-equalizer-sink

See objections to the code in this email:

http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-March/020174.html
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
10 years agomemblock: Avoid block ID collisions when exporting memory blocks
David Henningsson [Fri, 5 Dec 2014 10:54:39 +0000 (11:54 +0100)]
memblock: Avoid block ID collisions when exporting memory blocks

Every new memexport object now gets an ever increasing base index,
that prevents block ID collisions between different memexport
objects on the same pstream.

In particular, this prevents block ID collision between the srb memblock
(which has its own memexport object) and audio data blocks.

Reported-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agomodule: Fix unsafe iteration
Tanu Kaskinen [Fri, 5 Dec 2014 13:51:35 +0000 (15:51 +0200)]
module: Fix unsafe iteration

This fixes an issue when requesting module unload for
module-bluetooth-discover. When unloading the module, it also unloads
module-bluez4-discover and/or module-bluez5-discover, and that
invalidated the state variable that was used for iterating through the
modules idxset.

The pa_module.unload_requested flag could now otherwise be removed,
but it's still being (ab)used in the bluetooth modules.

10 years agocore-util: Fix build on mingw32
David Henningsson [Wed, 3 Dec 2014 11:46:28 +0000 (12:46 +0100)]
core-util: Fix build on mingw32

mingw32 does not have "getuid", so ifdef it properly.

Reported-by: Michael DePaulo <mikedep333@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agobluez5: Fix free order of adapters and devices
David Henningsson [Fri, 28 Nov 2014 12:43:07 +0000 (13:43 +0100)]
bluez5: Fix free order of adapters and devices

Because the adapters reference the devices hashmap on free, we mush
free the adapters hashmap first and then the devices hashmap.

Reported-by: Alexander Patrakov <patrakov@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agobuild-sys: Don't build srbchannel-test on targets without srbchannel
David Henningsson [Tue, 2 Dec 2014 08:22:47 +0000 (09:22 +0100)]
build-sys: Don't build srbchannel-test on targets without srbchannel

Reported-by: Felipe Sateler <fsateler@debian.org>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agoFix #defines for Debian GNU/kFreeBSD
Felipe Sateler [Sat, 29 Nov 2014 19:54:57 +0000 (16:54 -0300)]
Fix #defines for Debian GNU/kFreeBSD

Because debian does not run with the freebsd libc, but rather uses the
GNU one, it chose to not define __FreeBSD__, but rather __FreeBSD_kernel__.
Use the alternative when the functionality tested is for kernel
features, and keep the __FreeBSD__ one when using freebsd libc
headers.

If this patch is applied, debian could drop all the current patches when
importing 6.0 :)

10 years agoUpdate Ukrainian translation
Yuri Chornoivan [Tue, 25 Nov 2014 08:48:22 +0000 (10:48 +0200)]
Update Ukrainian translation

10 years agoUpdated Polish translation
Piotr Drąg [Sat, 22 Nov 2014 19:14:41 +0000 (20:14 +0100)]
Updated Polish translation

10 years agobuild-sys: Fix the BlueZ 5 native headset backend check
Tanu Kaskinen [Sun, 23 Nov 2014 13:23:39 +0000 (15:23 +0200)]
build-sys: Fix the BlueZ 5 native headset backend check

If the libbluetooth headers aren't available, we shouldn't treat that
as an error unless --enable-bluez5-native-headset has been explicitly
given to configure.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=86582
10 years agobuild-sys: Always define bluetooth related HAVE_* variables
Tanu Kaskinen [Sun, 23 Nov 2014 13:23:38 +0000 (15:23 +0200)]
build-sys: Always define bluetooth related HAVE_* variables

I don't know if it can cause any problems if HAVE_BLUEZ_4,
HAVE_BLUEZ_5, HAVE_BLUEZ, HAVE_BLUEZ_5_OFONO_HEADSET or
HAVE_BLUEZ_5_NATIVE_HEADSET are undefined when the corresponding
features are not enabled, but it certainly won't hurt to define the
variables also when the features are not enabled.

10 years agoNEWS: Zsh completion support isn't new in 6.0
Tanu Kaskinen [Sun, 23 Nov 2014 13:33:02 +0000 (15:33 +0200)]
NEWS: Zsh completion support isn't new in 6.0

There have been several fixes to the Zsh completion during the current
development cycle, but the completion was initially implemented
already in 4.0.

10 years agoi18n: update Chinese (traditional) translation
Cheng-Chia Tseng [Sun, 23 Nov 2014 12:30:14 +0000 (14:30 +0200)]
i18n: update Chinese (traditional) translation

10 years agopo: add pulseaudio.service.in to POTFILES.in v5.99.1
David Henningsson [Fri, 21 Nov 2014 13:36:36 +0000 (14:36 +0100)]
po: add pulseaudio.service.in to POTFILES.in

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agoNEWS: Write entry for 6.0
David Henningsson [Fri, 21 Nov 2014 12:33:30 +0000 (13:33 +0100)]
NEWS: Write entry for 6.0

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agoconfigure: Bump sonames
David Henningsson [Fri, 21 Nov 2014 12:27:31 +0000 (13:27 +0100)]
configure: Bump sonames

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agobluetooth: set gain correctly
Wim Taymans [Fri, 14 Nov 2014 14:01:35 +0000 (15:01 +0100)]
bluetooth: set gain correctly

Send the right command to set the speaker and microphone gain.

Note that setting the volume on the Headset should use the unsolicited
result code. Receiving the volume from the Headset uses the AT
command.

10 years agoraop: Fix a memory leak
Tanu Kaskinen [Wed, 19 Nov 2014 16:43:07 +0000 (18:43 +0200)]
raop: Fix a memory leak

a.path_or_host wasn't freed after calling pa_parse_address().

10 years agoalsa-mixer: Use pa_assert_not_reached()
Peter Meerwald [Sun, 9 Nov 2014 16:38:27 +0000 (17:38 +0100)]
alsa-mixer: Use pa_assert_not_reached()

get rid of the following warning when compiling with NDEBUG:

modules/alsa/alsa-mixer.c: In function 'element_is_subset':
modules/alsa/alsa-mixer.c:3125:18: warning: 'a_limit' may be used uninitialized in this function [-Wmaybe-uninitialized]
             long a_limit;

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agotests: Use pa_assert_se() to get rid of an used variable warning
Peter Meerwald [Sun, 9 Nov 2014 16:33:00 +0000 (17:33 +0100)]
tests: Use pa_assert_se() to get rid of an used variable warning

when compiled with NDEBUG

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agocore: Annotate variables only used within assert()s to be PA_UNUSED
Peter Meerwald [Sun, 9 Nov 2014 16:34:11 +0000 (17:34 +0100)]
core: Annotate variables only used within assert()s to be PA_UNUSED

supresses a warning when compiling with NDEBUG:

pulsecore/aupdate.c: In function 'pa_aupdate_read_end':
pulsecore/aupdate.c:82:14: warning: variable 'n' set but not used [-Wunused-but-set-variable]
     unsigned n;

pulsecore/sink-input.c: In function 'pa_sink_input_unlink':
pulsecore/sink-input.c:648:27: warning: variable 'p' set but not used [-Wunused-but-set-variable]
     pa_source_output *o, *p = NULL;

pulsecore/sink-input.c: In function 'find_filter_sink_input':
pulsecore/sink-input.c:1523:14: warning: unused variable 'i' [-Wunused-variable]
     unsigned i = 0;

pulsecore/sink-input.c: In function 'pa_sink_input_start_move':
pulsecore/sink-input.c:1569:27: warning: variable 'p' set but not used [-Wunused-but-set-variable]
     pa_source_output *o, *p = NULL;

  CC       pulsecore/libpulsecore_5.0_la-sink.lo
pulsecore/sink.c: In function 'pa_sink_unlink':
pulsecore/sink.c:673:24: warning: variable 'j' set but not used [-Wunused-but-set-variable]
     pa_sink_input *i, *j = NULL;

   pulsecore/source-output.c: In function 'find_filter_source_output':
pulsecore/source-output.c:1179:9: warning: unused variable 'i' [-Wunused-variable]
     int i = 0;

  CC       pulsecore/libpulsecore_5.0_la-source.lo
pulsecore/source.c: In function 'pa_source_unlink':
pulsecore/source.c:616:27: warning: variable 'j' set but not used [-Wunused-but-set-variable]
     pa_source_output *o, *j = NULL;

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomacro: Add macro PA_UNUSED
Peter Meerwald [Sun, 9 Nov 2014 16:28:36 +0000 (17:28 +0100)]
macro: Add macro PA_UNUSED

the macro PA_UNUSED may be used to suppress a warning when a variable
is not used, or assigned and never used; this typically happens
when the only use of the variable is within an assert() that can
be optimized away (i.e. with NDEBUG set)

has an effect with GCC only

v2: (thanks to Alexander Patrakov)
* fix patch subject/description

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomacro: Abort() when pa_assert_not_reached() even for NDEBUG
Peter Meerwald [Sun, 9 Nov 2014 15:45:32 +0000 (16:45 +0100)]
macro: Abort() when pa_assert_not_reached() even for NDEBUG

fixes many warnings when compiling with NDEBUG, such as
  CC       pulse/libpulse_la-channelmap.lo
pulse/channelmap.c: In function 'pa_channel_map_init_auto':
pulse/channelmap.c:397:1: warning: control reaches end of non-void function [-Wreturn-type]

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agobuild-sys: Deprecate libsamplerate support
Peter Meerwald [Tue, 11 Nov 2014 14:39:59 +0000 (15:39 +0100)]
build-sys: Deprecate libsamplerate support

output DEPRECATED warnings for libsamplerate in configure and
PA daemon's log

libsamplerate offers no particular advantage over the speex
resampler and is distributed under GPL; support for it will be removed
in one of the next releases

v2: (thanks Arun Raghavan)
* log a warning (instead of info)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoalsa-util: Finish description of pa_alsa_set_hw_params()
Peter Meerwald [Fri, 14 Nov 2014 15:12:12 +0000 (16:12 +0100)]
alsa-util: Finish description of pa_alsa_set_hw_params()

... which stops mid-sentence and logging cleanup

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agodbus-iface: Initialize "new_active" variable to NULL
David Henningsson [Mon, 17 Nov 2014 12:04:32 +0000 (13:04 +0100)]
dbus-iface: Initialize "new_active" variable to NULL

Fixes warning: 'new_active' may be used uninitialized in this function,
and could potentially cause erronous behaviour in case an invalid port
name was specified.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agoAlsa: Correct port availability with multiple jacks
Sjoerd Simons [Sun, 16 Nov 2014 22:15:50 +0000 (23:15 +0100)]
Alsa: Correct port availability with multiple jacks

In case there are two independent jacks for one port (e.g. Dock
Headphone Jack and Headphone Jack), the availability ends up being
incorrect if the first one was _NO (not plugged) and the second gets
_YES (plugged). Also pulse complains about the state being inconsistent
which isn't true.

Fix this by preferring more precise states (yes/no) over unknown and yes
over others. However in case a plugged jack makes the port unavailable
let that overrule everything else.

10 years agodbus: Fix the ActivePort property handler
Tanu Kaskinen [Sun, 2 Nov 2014 18:50:37 +0000 (20:50 +0200)]
dbus: Fix the ActivePort property handler

The old code tried to look up the port object by using an object path,
but the ports hashmap uses port names as keys, so the method failed
always.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=85369
10 years agoshell-completion: zsh: Fix the set-card-profile description
Tanu Kaskinen [Sat, 1 Nov 2014 16:28:43 +0000 (18:28 +0200)]
shell-completion: zsh: Fix the set-card-profile description

10 years agoshell-completion: zsh: Fix set-default-sink/source completion
Tanu Kaskinen [Sat, 1 Nov 2014 16:28:33 +0000 (18:28 +0200)]
shell-completion: zsh: Fix set-default-sink/source completion

The _devices() function didn't recognize the set-default-* commands,
and as a result it didn't generate any completions.

10 years agobluetooth: Select headset backend through module argument
David Henningsson [Mon, 10 Nov 2014 15:13:13 +0000 (16:13 +0100)]
bluetooth: Select headset backend through module argument

This patch adds a module argument "headset=ofono|native|auto" to
module-bluetooth-discover and module-bluez5-discover.

To make Arun's happy, the default is 'native' if compiled in, otherwise
'ofono'. 'Auto' will try to autoswitch depending on whether ofono is
running or not.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agobluez 5: remove null headset backend
David Henningsson [Mon, 3 Nov 2014 11:17:41 +0000 (12:17 +0100)]
bluez 5: remove null headset backend

There is no need to have a "null" backend anymore.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agobluez 5: Fix a debug message
David Henningsson [Mon, 3 Nov 2014 11:16:31 +0000 (12:16 +0100)]
bluez 5: Fix a debug message

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agobluez 5: Load the native headset backend if the oFono one is unavailable
David Henningsson [Mon, 3 Nov 2014 11:13:20 +0000 (12:13 +0100)]
bluez 5: Load the native headset backend if the oFono one is unavailable

This implements some autodetect if both headset backends are compiled in:
First we try to contact the oFono service, if that's not working,
then we start the native backend instead.

Likewise if the oFono service is going offline/online, we load/unload
the native backend accordingly.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agobluez 5: Build both headset backends, if available
David Henningsson [Mon, 3 Nov 2014 10:01:00 +0000 (11:01 +0100)]
bluez 5: Build both headset backends, if available

Enable both ofono and native backends to be built into the same
libbluez5-util. Never build the null backend.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agoresampler: Fix sample_format_more_precise() for the case of comparing against PA_SAMP...
Andrey Semashev [Wed, 12 Nov 2014 20:49:13 +0000 (23:49 +0300)]
resampler: Fix sample_format_more_precise() for the case of comparing against PA_SAMPLE_S32BE

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years ago.gitignore: Add pulseaudio.service
Tanu Kaskinen [Wed, 12 Nov 2014 12:55:45 +0000 (14:55 +0200)]
.gitignore: Add pulseaudio.service

10 years agobuild-sys: Fix a variable value check
Tanu Kaskinen [Wed, 12 Nov 2014 08:53:15 +0000 (10:53 +0200)]
build-sys: Fix a variable value check

10 years agobuild-sys: Fix daemon linking when building with systemd-daemon support
Mauro Guerrera [Mon, 10 Nov 2014 18:15:08 +0000 (18:15 +0000)]
build-sys: Fix daemon linking when building with systemd-daemon support

Seems that after commit 467b4b9be systemd usage has been added into
src/daemon/main.c but there is no link for the corresponding
library in the final pulseaudio binary.

This might be missed in some build systemd due to overlinking,
but it's correct to add this in here explicitly

Signed-off-by: Colin Guthrie <colin@mageia.org>
10 years agortpoll: Fixup pa_rtpoll_run
David Henningsson [Mon, 10 Nov 2014 13:15:39 +0000 (14:15 +0100)]
rtpoll: Fixup pa_rtpoll_run

Commit fa092af59cf64902a5caa99 removed an argument to pa_rtpoll_run, but
forgot to remove that argument for all callers to pa_rtpoll_run.

This commit removes the remaining ones.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agortpoll: Drop extra wait_op argument to pa_rtpoll_run()
Peter Meerwald [Tue, 28 Oct 2014 12:46:37 +0000 (13:46 +0100)]
rtpoll: Drop extra wait_op argument to pa_rtpoll_run()

is always true, not used

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agortpoll: Fix condition for DEBUG_TIMING output
Peter Meerwald [Tue, 28 Oct 2014 12:17:00 +0000 (13:17 +0100)]
rtpoll: Fix condition for DEBUG_TIMING output

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomix: Length over all chunk has already been computed by the caller
Peter Meerwald [Sun, 2 Nov 2014 16:37:04 +0000 (17:37 +0100)]
mix: Length over all chunk has already been computed by the caller

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomix: pa_mix() is always called with more than one steam
Peter Meerwald [Sun, 2 Nov 2014 16:22:19 +0000 (17:22 +0100)]
mix: pa_mix() is always called with more than one steam

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoiochannel: Remove unnecessary zero-initialization
Peter Meerwald [Sun, 2 Nov 2014 22:14:00 +0000 (23:14 +0100)]
iochannel: Remove unnecessary zero-initialization

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoalsa: Precompute maximum frames per block
Peter Meerwald [Tue, 4 Nov 2014 14:10:50 +0000 (15:10 +0100)]
alsa: Precompute maximum frames per block

frames_per_block is the mempool's maximum block size in frames

v2 (thanks David Henningson)
* rename max_frames to frames_per_block

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agocore: Replace assert()s with pa_assert()s
Peter Meerwald [Sun, 9 Nov 2014 16:49:54 +0000 (17:49 +0100)]
core: Replace assert()s with pa_assert()s

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agolog: Cleanup
Peter Meerwald [Sat, 8 Nov 2014 16:36:10 +0000 (17:36 +0100)]
log: Cleanup

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomix: Make use of pa_cvolume_is_norm/muted() macros
Peter Meerwald [Fri, 31 Oct 2014 22:46:33 +0000 (23:46 +0100)]
mix: Make use of pa_cvolume_is_norm/muted() macros

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoalsa-mixer: Add support for "Headphone+LO" and "Speaker+LO"
David Henningsson [Mon, 20 Oct 2014 11:34:49 +0000 (13:34 +0200)]
alsa-mixer: Add support for "Headphone+LO" and "Speaker+LO"

These two control names are currently being added to the HDA driver,
so let's support them in PulseAudio as well.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agopstream: Duplicate assignment, write.data is always NULL
Peter Meerwald [Fri, 24 Oct 2014 10:06:30 +0000 (12:06 +0200)]
pstream: Duplicate assignment, write.data is always NULL

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoasyncmsgq: Drop weird assert
Peter Meerwald [Mon, 3 Nov 2014 14:18:48 +0000 (15:18 +0100)]
asyncmsgq: Drop weird assert

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoresampler: Drop pointless remix variable
Peter Meerwald [Wed, 29 Oct 2014 10:56:59 +0000 (11:56 +0100)]
resampler: Drop pointless remix variable

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agopactl: Remove deprecated 'stat' behaviour
Peter Meerwald [Thu, 30 Oct 2014 15:00:41 +0000 (16:00 +0100)]
pactl: Remove deprecated 'stat' behaviour

the stat command should only output statistics, not info

behaviour was deprecated anno 2011 in 8ace9185 "pactl: Make stat backwards
compatible" -- fix this now

v2: (thanks Tanu Kaskinen):
* adjust shell completion

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agortpoll: typo
Peter Meerwald [Tue, 28 Oct 2014 10:33:18 +0000 (11:33 +0100)]
rtpoll: typo

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agobuild-sys: Minor cosmetic tidyup of configure summary
Colin Guthrie [Sat, 18 Oct 2014 17:33:59 +0000 (19:33 +0200)]
build-sys: Minor cosmetic tidyup of configure summary

10 years agolaunch: Disable autospawn by default when systemd daemon support is enabled.
Colin Guthrie [Fri, 17 Oct 2014 13:37:33 +0000 (15:37 +0200)]
launch: Disable autospawn by default when systemd daemon support is enabled.

When enabled, this method is prefered over pulseaudio's built in
systems so we should try our best to ensure that it cannot be spawned
outside of the mechanisms desired.

Packagers should call 'systemctl --global enable pulseaudio.socket' to
enable the socket for all users, or alternatively ship an enabling
symlink in /usr/lib/systemd/user/sockets.target.wants/ folder. It may
also make sense for distributions to add in a ConditionNNN= line to the
socket unit if they have a downstream mechanism for enabling or
disabling pulseaudio.

If individual users wish to opt out of this vendor (or administrator)
decision, they can call 'systemctl --user mask pulseaudio.socket'

10 years agolaunch: Add systemd units for launching pulseaudio user instances
Colin Guthrie [Fri, 17 Oct 2014 13:10:14 +0000 (15:10 +0200)]
launch: Add systemd units for launching pulseaudio user instances

10 years agolaunch: Avoid specifically starting PA and rely on autospawn/socket activation
Colin Guthrie [Fri, 17 Oct 2014 12:43:18 +0000 (14:43 +0200)]
launch: Avoid specifically starting PA and rely on autospawn/socket activation

This --start is patched out in several downstreams to allow users to easily
disable PA by simply disabling autospawn.

If autospawn is enabled, then the first pactl command will start it and if not
it will fail and the script will exit.

When switching to systemd socket activation, we very much do not want to
start PA manually here. We could replace it with a
  systemctl --user start pulseaudio
but really it just makes sense to rely on the socket activation as this
should apply equally to non-systemd setups which use PA's own autospawn.

10 years agosocket-server: Add support for systemd socket activation.
Colin Guthrie [Thu, 16 Oct 2014 09:05:19 +0000 (10:05 +0100)]
socket-server: Add support for systemd socket activation.

This adds support to module-native-protocol-unix to take over already
listening sockets passed in via socket activation (e.g. from systemd)

Most of the code is isolated to socket-server but some cleanup code also
had to be tweaked to ensure we do not overzealously close open fds.

10 years agobuild-sys: Add support for newer systemd without compatibility libs
Colin Guthrie [Fri, 17 Oct 2014 11:51:25 +0000 (13:51 +0200)]
build-sys: Add support for newer systemd without compatibility libs

In newer versions of systemd some libraries were combined for the sake of
general simplicity.

This change checks against the newer name first and avoids separate pkgconfig
checks if it's found. We probably want to keep support for the older library
names for some time. systemd does allow for the shipping of compatibility
pkgconfig files to not break downstream code like ourselves which is why this
likely hasn't been "fixed" until now.

With this change we no longer rely on systemd having been built with those
compatibility pkgconfig files.

10 years agobuild-sys: Clarify some systemd sub-component variable/define names.
Colin Guthrie [Fri, 17 Oct 2014 11:32:03 +0000 (13:32 +0200)]
build-sys: Clarify some systemd sub-component variable/define names.

We currently use the term SYSTEMD when referring to libsystemd-login
and JOURNAL when referring to libsystemd-journal.

I will be shortly adding support for libsystemd-daemon and in
preparation I figured it would be a good idea to clarify the names
used currently before adding another!

10 years agoman: Fix XDG_RUNTIME_DIR variable reference.
Colin Guthrie [Fri, 17 Oct 2014 11:09:14 +0000 (13:09 +0200)]
man: Fix XDG_RUNTIME_DIR variable reference.

10 years agosocket-server: Improve readability
Tanu Kaskinen [Mon, 3 Nov 2014 09:23:25 +0000 (11:23 +0200)]
socket-server: Improve readability

10 years agoalsa-mixer: Disable line-out if headphone jack is plugged
Sjoerd Simons [Fri, 31 Oct 2014 21:01:28 +0000 (22:01 +0100)]
alsa-mixer: Disable line-out if headphone jack is plugged

Line-out gets muted when headphones are plugged in on HDA cards, encode
this in the line-out path so pulse can match that state.

10 years agoalsa-mixer: Ignore some elements in the analog-output path
Tanu Kaskinen [Mon, 27 Oct 2014 11:00:00 +0000 (13:00 +0200)]
alsa-mixer: Ignore some elements in the analog-output path

The analog-output path should be suppressed when there are more
specific paths available. Currently that usually doesn't happen. The
suppression can be done with the path subset detection, and this patch
makes that work (another approach would be to mark the elements as
required-absent, like analog-input does, but I like the subset
suppression more, because it requires less stuff in the configuration
files). The problem with listing the now-removed elements in
analog-output.conf was that if the sound card had e.g. a Speaker
element, then the switch behaviour was different between analog-output
and analog-output-speakers, so analog-output was not considered a
subset of analog-output-speakers.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=74609
10 years agobluetooth: Fix some native backend command sending
Arun Raghavan [Fri, 31 Oct 2014 04:45:02 +0000 (10:15 +0530)]
bluetooth: Fix some native backend command sending

We weren't writing out one character from the "OK" response, and the
"AT" part of the "+VGS" and "+VGM" commands was missing. Also, the spec
says that the command is terminated by only a CR and not an LF (probably
doesn't hurt, but let's adhere to the spec for now).

10 years agobackend-native: implement volume control
Wim Taymans [Fri, 24 Oct 2014 07:56:52 +0000 (09:56 +0200)]
backend-native: implement volume control

Parse the gain changed AT commands from the headset and fire 2 new
hooks as a result. The device will connect to those hooks and change the
source/sink volumes.

When the source/sink volume changes, set the gain on the microphone or
speaker respectively. Make sure we do nothing if the transport can not
handle the gain changes.

10 years agobackend-native: add a new native headset backend
Wim Taymans [Fri, 24 Oct 2014 07:56:51 +0000 (09:56 +0200)]
backend-native: add a new native headset backend

Add a simple native headset backend that implements support for the
blutooth HSP profile.
This allows pulseaudio to output audio to a Headset using the HSP profile.

Make the native backend the default.

10 years agobluez5-util: add destroy function
Wim Taymans [Fri, 24 Oct 2014 07:56:50 +0000 (09:56 +0200)]
bluez5-util: add destroy function

Add a destroy function to the transport that is called before freeing
the transport. Useful for cleaning up extra userdata.

10 years agobluez5-device: use get_profile_direction
Wim Taymans [Fri, 24 Oct 2014 07:56:49 +0000 (09:56 +0200)]
bluez5-device: use get_profile_direction

Use the get_profile_direction() helper function to decide when to add a
source and a sink instead of enumerating profiles.

10 years agocreds: Rename pa_ancil to pa_cmsg_ancil_data
Arun Raghavan [Wed, 6 Aug 2014 02:18:19 +0000 (07:48 +0530)]
creds: Rename pa_ancil to pa_cmsg_ancil_data

Makes the purpose of the structure clearear.

10 years agotests: Be careful with data types to avoid cast
Peter Meerwald [Thu, 23 Oct 2014 09:35:29 +0000 (11:35 +0200)]
tests: Be careful with data types to avoid cast

use unsigned and size_t for counters and packet length, resp.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agotests: Make global variables static in srbchannel-test
Peter Meerwald [Thu, 23 Oct 2014 09:28:39 +0000 (11:28 +0200)]
tests: Make global variables static in srbchannel-test

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoalsa-sink: Check for after-avail is redundant
Peter Meerwald [Thu, 23 Oct 2014 09:47:44 +0000 (11:47 +0200)]
alsa-sink: Check for after-avail is redundant

after-avail is always false at this point

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Fix )== typos
Peter Meerwald [Thu, 23 Oct 2014 13:40:15 +0000 (15:40 +0200)]
modules: Fix )== typos

add a space between ) and ==

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomainloop: Fix typo
Peter Meerwald [Thu, 23 Oct 2014 12:24:28 +0000 (14:24 +0200)]
mainloop: Fix typo

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoCleanup !! for bool
Peter Meerwald [Thu, 23 Oct 2014 13:00:29 +0000 (15:00 +0200)]
Cleanup !! for bool

!!x makes no sense if x is bool (this is a leftover from the
convertion pa_bool_t -> bool, d806b197)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoRemove link to CIA from README
Peter Meerwald [Thu, 23 Oct 2014 12:57:09 +0000 (14:57 +0200)]
Remove link to CIA from README

cia.navi.cx/stats/project/polypaudio does not exist anymore,
see http://cia.vc/

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agobuild-sys: Alias bash-completion for all PulseAudio commands
Michał Górny [Fri, 17 Oct 2014 18:45:18 +0000 (20:45 +0200)]
build-sys: Alias bash-completion for all PulseAudio commands

Bash-completion 1.90 introduced support for on-demand loading
of completions. Install the completion file as 'pulseaudio' to match
the main command, and create symlinks as aliases for other supported
commands in order to support the new system.

10 years agoalsa-mixer: Merge analog-output-desktop-speaker with analog-output-speaker(-always)
Tanu Kaskinen [Mon, 27 Oct 2014 11:20:01 +0000 (13:20 +0200)]
alsa-mixer: Merge analog-output-desktop-speaker with analog-output-speaker(-always)

According to David[1], it's unlikely that there are any sound cards
that would have separate "speaker" and "desktop speaker" paths, so
let's remove the unnecessary distinction.

[1] http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/20915/focus=21193

10 years agomodule-card/device-restore: Do not legacy load an empty entry
David Henningsson [Mon, 20 Oct 2014 14:19:36 +0000 (16:19 +0200)]
module-card/device-restore: Do not legacy load an empty entry

There is no use in trying to load data in legacy format, if we
already know that there is no data at all.
Also clarify in the debug message whether there is invalid data
or no data at all.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agoshell-completion: zsh: Rework pactl completion
Tanu Kaskinen [Sat, 18 Oct 2014 18:10:41 +0000 (21:10 +0300)]
shell-completion: zsh: Rework pactl completion

So far the command name has been figured out by looking one or two
items back in the $words array, but I needed a way to figure out the
command given an arbitrary number of parameters. I was implementing
a command for removing devices from the device-manager database, and
the command would take a list of devices. Since the number of devices
that need to be completed can be arbitrarily large, the previous "look
one or two words back" approach didn't work.

This new approach is more verbose, but I think it's also easier to
follow. There's some duplication that would be easy to avoid by
merging some of the commands, but I decided to not do that, to make
it more obvious what the code does.

10 years agoshell-completion: zsh: Mark a variable as local
Tanu Kaskinen [Sat, 18 Oct 2014 18:10:40 +0000 (21:10 +0300)]
shell-completion: zsh: Mark a variable as local

Variables are global by default, and we certainly don't want
_pactl_commands to be a global variable.

10 years agopstream-util: Fix build on freebsd
David Henningsson [Fri, 29 Aug 2014 12:54:19 +0000 (14:54 +0200)]
pstream-util: Fix build on freebsd

The previous fix was not entirely complete.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agoconfigure: Remove "WIBBLE" test
David Henningsson [Wed, 15 Oct 2014 07:10:02 +0000 (09:10 +0200)]
configure: Remove "WIBBLE" test

Apparently "WIBBLE" is just a test, and maybe the test was "How
long does it take until somebody notices a strange row in configure.ac
and tries to remove it", if so, the test result is "a little over
three years". :-)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agoprotocol-native: Fail if trying to push unaligned memblock into queue
David Henningsson [Thu, 16 Oct 2014 09:41:19 +0000 (11:41 +0200)]
protocol-native: Fail if trying to push unaligned memblock into queue

We will just ignore the memblock if this happens. We already have
a check for this in the client library, so this one is just for
security reasons.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agostream: Fail on client submitting non-frame-aligned memblocks
David Henningsson [Thu, 16 Oct 2014 09:41:18 +0000 (11:41 +0200)]
stream: Fail on client submitting non-frame-aligned memblocks

If somebody tries to push a non-frame-aligned memblock onto the
memblockq, then we should fail the write. Otherwise the daemon will
crash, see https://bugs.freedesktop.org/show_bug.cgi?id=77595

Signed-off-by: David Henningsson <david.henningsson@canonical.com>