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

9 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().

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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.

9 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
9 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

9 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.

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 years ago.gitignore: Add pulseaudio.service
Tanu Kaskinen [Wed, 12 Nov 2014 12:55:45 +0000 (14:55 +0200)]
.gitignore: Add pulseaudio.service

9 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

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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

9 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'

9 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

9 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.

9 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.

9 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.

9 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!

9 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.

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

9 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.

9 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
9 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).

9 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.

9 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.

9 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.

9 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.

9 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.

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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.

9 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

9 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>
9 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.

9 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.

9 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>
9 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>
9 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>
9 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>
9 years agomemblockq: Do not allow non-frame indices in the memblock queue
David Henningsson [Thu, 16 Oct 2014 09:41:17 +0000 (11:41 +0200)]
memblockq: Do not allow non-frame indices in the memblock queue

Since we don't allow lengths that are not frame aligned,
it does not make sense to allow indices that are not frame aligned
either.
Also, allowing such a thing to be added causes the daemon to crash
later instead (see https://bugs.freedesktop.org/show_bug.cgi?id=77595 ).

Also drop _se from assert (there is no side effect).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agotunnel-sink-new: Fix requested latency check
Tanu Kaskinen [Tue, 7 Oct 2014 13:56:55 +0000 (16:56 +0300)]
tunnel-sink-new: Fix requested latency check

This fixes a bug in latency configuration. The wrong type in the cast
caused UINT64_MAX being not treated as special, so the configured
latency was set to UINT64_MAX usecs, which of course is absurdly huge
latency.

9 years agobluetooth: Move stuff to pa_bluetooth_transport_put/unlink()
Tanu Kaskinen [Tue, 7 Oct 2014 11:50:21 +0000 (14:50 +0300)]
bluetooth: Move stuff to pa_bluetooth_transport_put/unlink()

This should not have any effect on behaviour. The goal is to align
with the pattern that I think we should follow:

Object initialization:
 - put() is the place to create references from other objects to the
   newly created object. In this case, adding the transport to
   discovery->transports was moved from new() to put, and adding the
   transport to device->transports was moved from set_state() to
   put().

Object destruction:
 - unlink() undoes put() and removes all references from other objects
   to the object being unlinked. In this case setting the
   device->transports pointer to NULL was moved from set_state() to
   unlink(), and setting the discovery->transports pointer to NULL was
   moved from free() to unlink().
 - free() undoes new(), but also calls unlink() so that object owners
   don't need to remember to call unlink() before free().

9 years agovala: adding missing fields for sink_input/source_output info struct
Ricardo Salveti de Araujo [Wed, 1 Oct 2014 23:08:33 +0000 (20:08 -0300)]
vala: adding missing fields for sink_input/source_output info struct

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
9 years agopulse: Initalise pa_threaded_mainloop with zeroes
Arun Raghavan [Thu, 16 Oct 2014 15:09:22 +0000 (17:09 +0200)]
pulse: Initalise pa_threaded_mainloop with zeroes

9 years agoutil: Try finding out application name using dladdr if available
Felipe Sateler [Sat, 11 Oct 2014 04:34:23 +0000 (01:34 -0300)]
util: Try finding out application name using dladdr if available

This fixes getting the binary name in the Hurd, or any other port using
the GNU C library, but only in the case where the library is directly
linked to. Opening with dlopen will not work.

Change in v3: reorder header includes and definitions
Change in v2: use a weak reference to main, so that we
don't crash when main cannot be found.

9 years agoconnect-stress-test: Fix number of streams per sink to "20"
David Henningsson [Thu, 16 Oct 2014 10:24:19 +0000 (12:24 +0200)]
connect-stress-test: Fix number of streams per sink to "20"

This test broke when PA_MAX_INPUTS_PER_SINK was increased from 32 to 256.
Because we currently don't have time to figure out why, let's just set
NSTREAMS to 20 in the meantime.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agotunnel-sink-new: Limit the maximum latency to 200 ms
Tanu Kaskinen [Tue, 7 Oct 2014 13:55:47 +0000 (16:55 +0300)]
tunnel-sink-new: Limit the maximum latency to 200 ms

The default maximum latency is 10 seconds, which is not good,
especially since the tunnel sink doesn't support rewinding. Due to the
lack of rewinding, e.g. volume changes take a long time with large
latencies.

9 years agomodule-stream-restore: use entry_write when filling up the database
Ricardo Salveti de Araujo [Wed, 1 Oct 2014 23:07:04 +0000 (20:07 -0300)]
module-stream-restore: use entry_write when filling up the database

It seems at some point the code migrated to use the entry_write calls,
but fill_db is still using the old syntax, causing the entry to be
invalid.

The crash happens when clean_up_db gets called, which then calls
entry_read, causing the crash.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
9 years agoswitch-on-connect: Initialize userdata contents to zero
Tanu Kaskinen [Mon, 6 Oct 2014 10:30:35 +0000 (13:30 +0300)]
switch-on-connect: Initialize userdata contents to zero

This fixes userdata.only_from_unavailable being uninitialized in case
the user doesn't give the value in modargs.

9 years agoi18n: Update the Slovak translation
Dušan Kazik [Mon, 6 Oct 2014 10:19:19 +0000 (13:19 +0300)]
i18n: Update the Slovak translation

9 years agomodule-mmkbd-evdev: Don't crash on failure to close fd
David Henningsson [Fri, 12 Sep 2014 08:01:24 +0000 (10:01 +0200)]
module-mmkbd-evdev: Don't crash on failure to close fd

If the keyboard is unplugged, it looks like the kernel is reporting
back -ENODEV when trying to close the fd. This is probably a kernel
error, but still, it's better to complain than to crash.

Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=80867
Reported-by: Stelios Bounanos
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agocore-util: Add pa_unset_env()
Tanu Kaskinen [Thu, 2 Oct 2014 09:14:09 +0000 (12:14 +0300)]
core-util: Add pa_unset_env()

Since we already have pa_set_env(), it's nice to also have a
corresponding function for unsetting environment variables.

9 years agomodule-switch-on-port-available: make the output more accurate
Hui Wang [Fri, 26 Sep 2014 03:34:28 +0000 (11:34 +0800)]
module-switch-on-port-available: make the output more accurate

It is possible that the chosen active_port doesn't equal
new_data->active_port, using p->name is more accurate.

Please refer to sink_new_hook_callback()

Signed-off-by: Hui Wang <hui.wang@canonical.com>
9 years agobluetooth: bluez4: Add profile name to sinks and sources
Pali Rohár [Thu, 25 Sep 2014 13:27:58 +0000 (15:27 +0200)]
bluetooth: bluez4: Add profile name to sinks and sources

Now a2dp and hsp sinks and sources will have different names which means that
applications and other modules can use sink/source to distinguish selected
profile.

Module module-device-restore uses sink/source name and port name as identifier,
so if different profiles have different names module-device-restore can store
volume settings for each profile.

So with this patch it is possible to configure different volume settings for
a2dp and hsp profiles.

This patch does not change port names so gnome applications will be happy.

Note that similar patch is needed also for bluez5, but I'm not using bluez5
so I cannot write or test it.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
9 years agomodule-switch-on-connect: add an argument for conditionally connecting
Hui Wang [Mon, 22 Sep 2014 03:50:49 +0000 (11:50 +0800)]
module-switch-on-connect: add an argument for conditionally connecting

On a machine without fixed connecting audio devices like internal
microphone or internal speaker, and when there is no external audio
devices plugging in, the default source/sink is alsa_input/alsa_output
and there is no input devices/output devices listed in the gnome
sound-setting.

Under this situation, if we connect a bluetooth headset, the gnome
sound-setting will list bluez input/output devices, but they are not
active devices by default. This looks very weird that sound-setting
lists only one input device and one output device, but they are not
active. To change this situation, we add an argument, the policy is
if a new source/sink is connected and current default source/sink's
active_port is AVAILABLE_NO, we let the new added one switch to
default one.

BugLink: http://bugs.launchpad.net/bugs/1369476
Signed-off-by: Hui Wang <hui.wang@canonical.com>
9 years agoAdd a Valgrind suppression file
Tanu Kaskinen [Fri, 19 Sep 2014 11:39:50 +0000 (14:39 +0300)]
Add a Valgrind suppression file

9 years agosrbchannel: Defer reading when setting up read callback
David Henningsson [Wed, 17 Sep 2014 06:56:51 +0000 (08:56 +0200)]
srbchannel: Defer reading when setting up read callback

Calling the callback while setting it up can make things
complicated for clients, as the callback can do arbitrarily
things.

In this case, a protocol error caused the srbchannel to be
owned by both the pstream and the native connection.

Now the read callback is deferred, making sure the callback
is called from a cleaner context where errors are handled
appropriately.

Reported-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoalsa-time-test: Make constants for channels and rate
David Henningsson [Wed, 10 Sep 2014 12:52:01 +0000 (14:52 +0200)]
alsa-time-test: Make constants for channels and rate

Hard-coding constants on several places is bad coding practice.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoalsa-time-test: Do not use Lennart's card by default
David Henningsson [Wed, 10 Sep 2014 12:45:01 +0000 (14:45 +0200)]
alsa-time-test: Do not use Lennart's card by default

Lennart probably had a card with a specific name. It is not a
common name anymore.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoalsa-time-test: Add fillrate parameter
David Henningsson [Wed, 10 Sep 2014 12:43:19 +0000 (14:43 +0200)]
alsa-time-test: Add fillrate parameter

As a third parameter, add the number of samples to read/write in
every iteration. This will help slow CPUs.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agobluetooth: Allow policy module to pick 'off' profile
Luiz Augusto von Dentz [Wed, 17 Sep 2014 10:05:00 +0000 (13:05 +0300)]
bluetooth: Allow policy module to pick 'off' profile

This allow 'off' profile to be choosen when no other profile is available
which is considered better since it requires less resources than other
profiles.

9 years agobluetooth: Switch transport state to idle in case of HUP
João Paulo Rechi Vita [Wed, 17 Sep 2014 10:04:59 +0000 (13:04 +0300)]
bluetooth: Switch transport state to idle in case of HUP

In case the socket HUP the transport state should be set to idle which
will indicate the profile is no longer available.

9 years agobluetooth: Implement org.ofono.HandsfreeAudioAgent.NewConnection()
João Paulo Rechi Vita [Mon, 15 Sep 2014 10:02:02 +0000 (13:02 +0300)]
bluetooth: Implement org.ofono.HandsfreeAudioAgent.NewConnection()

9 years agoi18n: Add Slovak translation
Dusan Kazik [Tue, 16 Sep 2014 11:30:31 +0000 (14:30 +0300)]
i18n: Add Slovak translation

9 years agoalsa: Remove unnecessary hctl handles being passed around
David Henningsson [Mon, 1 Sep 2014 13:58:22 +0000 (15:58 +0200)]
alsa: Remove unnecessary hctl handles being passed around

Now that we have switched to using the mixer handle only,
there is no use for sending hctl handles around.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoalsa-mixer/card: Move to use the new mixer interface
David Henningsson [Mon, 1 Sep 2014 13:41:39 +0000 (15:41 +0200)]
alsa-mixer/card: Move to use the new mixer interface

Use the new mixer API to get callbacks, instead of using the hctl
API. Using the hctl API caused a memory leak, because alsa-lib itself
used the hctl callbacks, which we were previously overriding.

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