platform/upstream/pulseaudio.git
8 years agomodule-switch-on-port-available: Route to preferred profile
David Henningsson [Tue, 17 Nov 2015 14:10:35 +0000 (15:10 +0100)]
module-switch-on-port-available: Route to preferred profile

This makes the routing slightly more aggressive:

 * It will try to route to another profile, if such a profile
   is preferred by the port.

 * It will allow changing profiles on transitions both to
   PA_AVAILABLE_YES and PA_AVAILABLE_NO

To accommodate there is also some refactoring.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agomodule-switch-on-port-available: Use input and output names
David Henningsson [Tue, 17 Nov 2015 14:10:34 +0000 (15:10 +0100)]
module-switch-on-port-available: Use input and output names

In case input or output names are filled in, we can use this to
get a better match in the profile_good_for_input/output functions
instead of guessing based on number of sources and channels.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agocard-restore: Save and restore "preferred profile" of port
David Henningsson [Tue, 17 Nov 2015 14:10:33 +0000 (15:10 +0100)]
card-restore: Save and restore "preferred profile" of port

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agocard: Update preferred_profile for ports when profile changes
David Henningsson [Tue, 17 Nov 2015 14:10:32 +0000 (15:10 +0100)]
card: Update preferred_profile for ports when profile changes

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agodevice-port: Add preferred_profile field to pa_device_port
David Henningsson [Tue, 17 Nov 2015 14:10:31 +0000 (15:10 +0100)]
device-port: Add preferred_profile field to pa_device_port

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoalsa-mixer: Fill in input and output names
David Henningsson [Tue, 17 Nov 2015 14:10:30 +0000 (15:10 +0100)]
alsa-mixer: Fill in input and output names

Fill in input_name and output_name to make routing easier for
routing modules.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agocard: Add variables for splitting up a profile
David Henningsson [Tue, 17 Nov 2015 14:10:29 +0000 (15:10 +0100)]
card: Add variables for splitting up a profile

It can be useful for routing modules to know a profile's input
and output parts, in order to e g change output profile
while keeping the input profile unchanged.

For now filling in these fields is optional and a routing module
must be able to handle NULL in these fields.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agotests: Make echo-cancel-test not crash
Arun Raghavan [Wed, 21 Oct 2015 06:15:32 +0000 (11:45 +0530)]
tests: Make echo-cancel-test not crash

Adding AGC broke this test, so we hard-disable the volume code in test
mode. This is probably okay for now, since at least with analog AGC, the
source volume changes and the data we get is going to be with AGC
applied, but digital gain won't be encapsulated here.

Long term, we might need to figure out how to deal with this properly.

8 years agoalsa: Use helper function for byte conversion across sample specs
Arun Raghavan [Mon, 16 Nov 2015 14:07:20 +0000 (19:37 +0530)]
alsa: Use helper function for byte conversion across sample specs

8 years agosource: Deal with filter having more channels than the master
Arun Raghavan [Tue, 3 Nov 2015 17:12:08 +0000 (22:42 +0530)]
source: Deal with filter having more channels than the master

Without this, we hit an assert because the channel count in
new_reference (which was inherited from the master) is lower than the
channel count of the filter.

8 years agopulsecore/packet: avoid redefinition of pa_packet structure
Thomas Petazzoni [Tue, 17 Nov 2015 11:06:36 +0000 (12:06 +0100)]
pulsecore/packet: avoid redefinition of pa_packet structure

packet.h defines:

  typedef struct pa_packet pa_packet;

and packet.c defines:

  typedef struct pa_packet {
    ...
  } pa_packet;

With old versions of gcc (such as gcc 4.5) this causes a redefinition
error at compile time:

pulsecore/packet.c:43:3: error: redefinition of typedef 'pa_packet'
pulsecore/packet.h:26:26: note: previous declaration of 'pa_packet' was here

In order to fix this, this commit changes the definition in packet.c
to just:

  struct pa_packet {
    ...
  };

This way, the contents of the structure remain opaque to users of
pa_packet outside packet.c, and the 'pa_packet' type remains usable.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91334

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8 years agosink: Make early drain reporting propagate down to filters
Arun Raghavan [Mon, 16 Nov 2015 14:13:18 +0000 (19:43 +0530)]
sink: Make early drain reporting propagate down to filters

The drain reporting improvements that were added to alsa-sink were only
being applied to directly connected sink inputs. This patch makes the
same logic also recurse down the filter hierarchy, so drains are
acknowledged more accurately (and not late) even if there is a filter
sink in between.

Also does some minor reorganisation of the code and sprinkles in some
comments as documentation.

8 years agoalsa-mixer: Return early in case of no mixer poll descriptors
David Henningsson [Fri, 6 Nov 2015 11:31:32 +0000 (12:31 +0100)]
alsa-mixer: Return early in case of no mixer poll descriptors

We encountered an alsa plugin a while ago (not sure if the source
can be shared) which had mixer controls, but no descriptors to
poll for changes.

Quit early to avoid latter assertion failures.

BugLink: https://bugs.launchpad.net/bugs/1092377
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoalsa-sink: Avoid unloading alsa-sink module before calling try_recover()
Zbigniew Kempczyński [Tue, 10 Nov 2015 06:51:46 +0000 (07:51 +0100)]
alsa-sink: Avoid unloading alsa-sink module before calling try_recover()

This fixes rare condition when pulseaudio client tries to rewind,
but a device previously reached underrun and was changed to XRUN state.

8 years agoalsa-mixer: Add "Front Headphone" to headset mic path
David Henningsson [Thu, 29 Oct 2015 14:13:17 +0000 (15:13 +0100)]
alsa-mixer: Add "Front Headphone" to headset mic path

The combination "Front Headphone" + "Headset Mic Phantom"
was found on one the machines we enable. Without this patch,
the headset mic appeared plugged in when nothing was plugged
into the jack.

BugLink: https://bugs.launchpad.net/bugs/1513384
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agobuild: Add IRC notifications to Travis
Arun Raghavan [Fri, 6 Nov 2015 14:19:14 +0000 (19:49 +0530)]
build: Add IRC notifications to Travis

8 years agotests: Set appropriate timeouts for a couple of tests
Arun Raghavan [Mon, 2 Nov 2015 06:16:46 +0000 (11:46 +0530)]
tests: Set appropriate timeouts for a couple of tests

sync-playback just had a much longer timeout than it should have, and
extended-test was using the default. We set the expected amount of time,
so the test is more correct (if it takes longer than this, something
probably actually broke).

8 years agoresampler: Don't expose soxr methods if they are not supported
Arun Raghavan [Fri, 6 Nov 2015 10:24:55 +0000 (15:54 +0530)]
resampler: Don't expose soxr methods if they are not supported

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92780

8 years agortp: fix non null terminated string / non portable sscanf
Lev Melnikovsky [Wed, 4 Nov 2015 10:42:21 +0000 (12:42 +0200)]
rtp: fix non null terminated string / non portable sscanf

In rtp.c:

if (sscanf(t+9, "%i %64c", &_payload, c) == 2)

the string c seems to be non-null terminated. It is later used as
following:

c[strcspn(c, "\n")] = 0;

The same piece of code is responsible for the inability of pulseaudio
on OpenWRT to handle RTP stream at the rate 48000 from another
machine:

[pulseaudio] sdp.c: Failed to parse SDP data: missing data.

It turns out that uClibc does not agree with glibc about "%64c", see
http://git.uclibc.org/uClibc/tree/docs/Glibc_vs_uClibc_Differences.txt

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=92568
8 years agosoxr: Use soxr_clear() if libsoxr version is 0.1.2 or later.
Andrey Semashev [Sat, 31 Oct 2015 15:59:46 +0000 (18:59 +0300)]
soxr: Use soxr_clear() if libsoxr version is 0.1.2 or later.

The 0.1.2 version of libsoxr fixes soxr_process() crash after soxr_clear() is used, so check the library version at compile time and use soxr_clear() if possible.

8 years agoscripts: Plot memory benchmarks using gnuplot
Ahmed S. Darwish [Wed, 23 Sep 2015 16:33:05 +0000 (18:33 +0200)]
scripts: Plot memory benchmarks using gnuplot

Now that we have memory usage benchmarks collected at our disposal,
introduce a gnuplot script to plot the newest version.

To avoid scaling issues, memory is plotted in a "double y axis" form,
with VM usage on the left, and dirty RSS memory usage on the right.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
8 years agoscripts: Introduce benchmark_memory_usage.sh
Ahmed S. Darwish [Wed, 23 Sep 2015 16:30:16 +0000 (18:30 +0200)]
scripts: Introduce benchmark_memory_usage.sh

Add shell script to sample PulseAudio memory usage while increasing
the number of connected 'paplay' clients over time.

Linux kernel /proc/$PID/smaps Private and Shared_Dirty fields are used
to accurately measure the total size of used dirty pages over time.
This shall be useful for benchmarking the PA daemon's memory while
introducing new features like per-client SHM access and memfds.

Also add an empty benchmarks-collection directory 'benchmarks/'. All
output from the benchmarking tools shall be saved in this place, with
timestamps and symbolic links to the newest versions.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
8 years agopacmd: Fix typo in set-default-* help
Peter Mattern [Wed, 14 Oct 2015 16:39:50 +0000 (18:39 +0200)]
pacmd: Fix typo in set-default-* help

which was causing faulty output when running 'pacmd --help' on the shell

8 years agovolume: Add LFE balance API
David Henningsson [Tue, 27 Oct 2015 08:54:39 +0000 (09:54 +0100)]
volume: Add LFE balance API

The gnome/unity-control-center UIs have a master volume slider, and
three sub-sliders: balance, fade, and subwoofer. Balance and fade
use PA's set_balance and set_fade APIs accordingly, but the subwoofer
slider sometimes does unintuitive things.

In order to make that slider behave better, let's add a LFE balance
API that these volume control UIs can use instead. With this API,
the UI can balance between "no subwoofer" and "only subwoofer" with
"equal balance" in the middle, which would make it more consistent
with the behaviour of the other sliders.

BugLink: https://bugzilla.gnome.org/show_bug.cgi?id=753847
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agovolume: Refactor get/set balance/fade
David Henningsson [Tue, 27 Oct 2015 08:54:38 +0000 (09:54 +0100)]
volume: Refactor get/set balance/fade

get/set balance and fade use very similar code, so refactor out
common parts.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoalsa-ucm: fix pa_device_port.profiles leak
Tanu Kaskinen [Fri, 23 Oct 2015 10:56:40 +0000 (13:56 +0300)]
alsa-ucm: fix pa_device_port.profiles leak

pa_device_port.profiles is initialized in pa_device_port_new(), so no
need to do that in alsa-ucm.c.

8 years agonull-sink: correct update of timestamp when state changes to RUNNING or IDLE
Georg Chini [Sat, 24 Oct 2015 11:00:39 +0000 (13:00 +0200)]
null-sink: correct update of timestamp when state changes to RUNNING or IDLE

u->timestamp should be reset to "now" when the sink state changes from
INIT or SUSPENDED to IDLE or RUNNING.
Thanks to Olivier Delbeke for reporting the bug and testing the patch.
Bug report is here:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-October/024553.html

8 years agoalsa-mixer: Ignore volume with unexpected number of channels
David Henningsson [Mon, 19 Oct 2015 09:16:37 +0000 (11:16 +0200)]
alsa-mixer: Ignore volume with unexpected number of channels

We currently only support one and two channels for volumes, and
bail out otherwise. This makes Xonar users unhappy because they
have a volume with eight channels, and bailing out means they
don't have a path/port at all.

This way they will at least have a port, which will in turn make
the gnome/unity UI behave better.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=84983
BugLink: https://bugzilla.gnome.org/show_bug.cgi?id=745017
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agothread-mainloop: keep SIGSYS unblocked if currently trapped
Julien Isorce [Mon, 19 Oct 2015 22:29:53 +0000 (23:29 +0100)]
thread-mainloop: keep SIGSYS unblocked if currently trapped

Seccomp-BPF uses SIGSYS signal to trigger
the trap handler attached to sys_open.
If the signal is blocked then the kernel kills
the process whenever pulse audio calls 'open'.
The result backtrace is terminating in sys_open.

That's why it is required to keep SIGSYS unblocked
if it is currently unblocked and trapped.

This patch allows to have pulse audio working
in the Chromium sandbox.

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Signed-off-by: Arun Raghavan <git@arunraghavan.net>
8 years agogit-version-gen: Avoid further processing when tarball-version is present
Ross Burton [Tue, 20 Oct 2015 14:55:23 +0000 (16:55 +0200)]
git-version-gen: Avoid further processing when tarball-version is present

In case a tarball-version file is present, use that and quit.

Otherwise git will continue looking for directories, potentially
finding .git directories which are dirty and mark the version as such.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90936
8 years agopstream: Fix use-after-free in srb_callback
David Henningsson [Fri, 16 Oct 2015 20:12:32 +0000 (22:12 +0200)]
pstream: Fix use-after-free in srb_callback

We need to guard the pstream with an extra ref to ensure
it is not destroyed at the time we check whether or not the
srbchannel is destroyed.

Reported-by: Takashi Iwai <tiwai@suse.de>
BugLink: http://bugzilla.opensuse.org/show_bug.cgi?id=950487
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agomodule-alsa-card: Report available ports before unavailable ones
David Henningsson [Tue, 5 May 2015 15:01:13 +0000 (17:01 +0200)]
module-alsa-card: Report available ports before unavailable ones

In case the same jack causes one port to become available and another
one unavailable, the available should be reported first.

This is to avoid unnecessary changes: e g, consider a 'Headphone Jack'
making 'Headphone' available and 'Speaker' unavailable. In case the
unavailable change triggers first, and there is also a currently available
third port (e g 'Digital out'), the routing system might choose to route
to this port because neither of the 'Speaker' and 'Headphone' ports are
available.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agomake availability of ports visible over dbus
John Horan [Sun, 19 Apr 2015 14:29:27 +0000 (15:29 +0100)]
make availability of ports visible over dbus

8 years agodbus: Add card profile availability info to API
Juho Hämäläinen [Thu, 19 Mar 2015 11:51:00 +0000 (13:51 +0200)]
dbus: Add card profile availability info to API

[diwic: Profile availability to boolean bug fixed]

8 years agocore-util: avoid calling fchmod if already right mode
Julien Isorce [Sat, 10 Oct 2015 19:11:21 +0000 (20:11 +0100)]
core-util: avoid calling fchmod if already right mode

fchmod is denied in chromium sandbox.

8 years agocard: Use pa_xmalloc0 when creating card profiles
David Henningsson [Tue, 5 May 2015 15:01:07 +0000 (17:01 +0200)]
card: Use pa_xmalloc0 when creating card profiles

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoshm: Warn on not being able to open shm files
David Henningsson [Mon, 28 Sep 2015 13:41:15 +0000 (15:41 +0200)]
shm: Warn on not being able to open shm files

With the exception of when trying to clean up shm files,
it's useful to warn if opening them fails, regardless of reason.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agocard: Use pa_xnew0 when creating a card
David Henningsson [Mon, 28 Sep 2015 12:37:49 +0000 (14:37 +0200)]
card: Use pa_xnew0 when creating a card

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoclient: Use pa_xnew0 when creating a client
David Henningsson [Mon, 28 Sep 2015 12:36:23 +0000 (14:36 +0200)]
client: Use pa_xnew0 when creating a client

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agobuild-sys: fix the default bash completion directory
Tanu Kaskinen [Sun, 27 Sep 2015 13:48:18 +0000 (16:48 +0300)]
build-sys: fix the default bash completion directory

If bashcompletiondir was empty, the check didn't catch that. As
a result, the symlinks that were supposed to be generated in the
completion directory were created in the root directory.

8 years agobuild-sys: bootstrap.sh: Do a make only if configure has succeeded
Ahmed S. Darwish [Fri, 18 Sep 2015 23:59:02 +0000 (01:59 +0200)]
build-sys: bootstrap.sh: Do a make only if configure has succeeded

Otherwise the important configure script error messages get buried
by the "make clean" output.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
8 years agoalsa-mixer: Add "Dock Line Out" jack handling to analog-output-speaker-always
Tanu Kaskinen [Fri, 18 Sep 2015 06:59:45 +0000 (09:59 +0300)]
alsa-mixer: Add "Dock Line Out" jack handling to analog-output-speaker-always

The jack is already in analog-output-speaker, so let's have the same
handling in analog-output-speaker-always too.

8 years agoalsa-mixer: Recognize "Dock Line Out" jack
Takashi Iwai [Mon, 15 Jun 2015 15:06:41 +0000 (17:06 +0200)]
alsa-mixer: Recognize "Dock Line Out" jack

Some machines provide "Dock Line Out Jack" control that should be
handled like a normal line out.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agobluetooth: bluez4: Remove the unused "auto_connect" parameter as it is not used in...
Manish Sogi [Mon, 15 Jun 2015 12:16:05 +0000 (17:46 +0530)]
bluetooth: bluez4: Remove the unused "auto_connect" parameter as it is not used in bluez4

<EP-F69A421D31544C56BDE97C590307C014>
Signed-off-by: Manish Sogi <manish.sogi@samsung.com>
8 years agoalsa-mixer: Add "Mic Boost" and "Line Boost" to analog-input.conf
David Henningsson [Tue, 15 Sep 2015 11:09:14 +0000 (13:09 +0200)]
alsa-mixer: Add "Mic Boost" and "Line Boost" to analog-input.conf

I'm not sure how much they are needed nowadays with the latest
changes to the subset elimination (I found this while
researching a bug on an older PA version), but I guess they could
be added for consistency at least.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agolog: Fix compilation error on non-systemd systems
Ahmed S. Darwish [Wed, 16 Sep 2015 21:38:38 +0000 (23:38 +0200)]
log: Fix compilation error on non-systemd systems

Commit 262bdae0330e used symbols which are only available if systemd
support was compiled in. Fix by using the appropriate #ifdef guards.

Also document the resulting PULSE_LOG_JOURNAL environment variable
behavior if systemd journal support was not compiled in.

[Diwic: changed wording slightly.]

Reported-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
8 years agolog: Introduce PULSE_LOG_JOURNAL environment variable
Ahmed S. Darwish [Fri, 14 Aug 2015 16:47:32 +0000 (18:47 +0200)]
log: Introduce PULSE_LOG_JOURNAL environment variable

By introducing such an environment variable, applications using the
PA client libraries can configure these libraries to send their logs
directly to the journal.

While client libraries journal logging can be indirectly achieved
using PULSE_LOG_SYSLOG, this pollutes the journal. Meta data gets
replicated twice: once in the journal meta fields and once in the
syslog(3) plain-text message itself.

For attaching any backtraces, also introduce the PA-specific journal
meta field PULSE_BACKTRACE. This is the recommend journal practice
instead of appending any furuther data to the logging message itself.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
8 years agopulseaudio.1: document that systemd notification only works without daemonization
Felipe Sateler [Thu, 13 Aug 2015 22:58:28 +0000 (19:58 -0300)]
pulseaudio.1: document that systemd notification only works without daemonization

8 years agodaemon: Use Type=notify for systemd service
Felipe Sateler [Thu, 13 Aug 2015 22:58:27 +0000 (19:58 -0300)]
daemon: Use Type=notify for systemd service

This ensures systemd knows when pulseaudio finishes loading, thus never
marking pulseaudio as active if startup fails.

8 years agoRename functions with "tostring" in the name to one with "to_string" to conform with...
Deepak Srivastava [Fri, 12 Jun 2015 12:47:07 +0000 (18:17 +0530)]
Rename functions with "tostring" in the name to one with "to_string" to conform with the convention.

component: core

<EP-E358F00C1D9A449EAE69225B9D2530F8>
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88833
Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
8 years agocore: Fallbacks for machine-id in filesystem
Peter Meerwald [Tue, 9 Jun 2015 19:56:36 +0000 (21:56 +0200)]
core: Fallbacks for machine-id in filesystem

see https://bugs.freedesktop.org/show_bug.cgi?id=88834

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
8 years agobuild-sys: don't use the nodelete linker flag on executables
Shawn Walker [Tue, 11 Aug 2015 14:22:37 +0000 (16:22 +0200)]
build-sys: don't use the nodelete linker flag on executables

The nodelete flag indicates that we don't want our libraries to be
unloaded. It's only relevant on libraries, so let's not use it for
executables. Trying to use it on executables breaks things on some
platforms.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90878
8 years agoUpdate NEWS for 7.0 release v7.0
Arun Raghavan [Thu, 24 Sep 2015 03:23:06 +0000 (08:53 +0530)]
Update NEWS for 7.0 release

8 years agoi18n: Update Slovak translation
Dušan Kazik [Wed, 23 Sep 2015 07:49:25 +0000 (13:19 +0530)]
i18n: Update Slovak translation

8 years agotests: Fix test-suite failure on Alpha
Michael Cree [Tue, 15 Sep 2015 04:38:41 +0000 (10:08 +0530)]
tests: Fix test-suite failure on Alpha

Pulseaudio fails to build on the Alpha architecture due to a failure
in the volume-test of the test suite.  I had reported this to the
Debian bug tracker [1] but the maintainer has asked that I forward the
patch to this mail list.  The failure in volume-test occurs because it
is compiled with -ffast-math which implies -ffinite-math-only of which
the gcc manual states that it optimizes for floating-point arithmetic
with the assumption that arguments and results are not NaNs or
+/-infinity, and futher notes that it may result in incorrect output.
On the Alpha platform that is somewhat an understatement as the use of
non-finite floating-point arithmetic with -ffinite-math-only results in
a floating-point exception and the termination of the program.

The volume-test converts volumes into decibels (so a zero volume
becomes a negative infinity) and proceeds to add two volumes (in
decibels), thus does arithmetic with non-finite floating point numbers
despite being compiled with -ffast-math!

I attach a patch that protects against the arithmetic with non-finite
numbers for your consideration.  With that patch the test-suite passes
on Alpha.

Cheers
Michael.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798248

8 years agolfe-filter: Deal with empty input chunks
Arun Raghavan [Thu, 17 Sep 2015 04:14:49 +0000 (09:44 +0530)]
lfe-filter: Deal with empty input chunks

It is possible that we get a zero-length memchunk to work with.
Specifically, this happens the resampler (which is called before the
lfe-filter) consumes all the input data, but does not (yet) produce any
output data.

Reproduced using:

  pulseaudio --resample-method=soxr-mq
  pactl load-module module-null-sink sink_name=lfe_test channels=3 channel_map=front-left,front-right,lfe
  paplay --raw /dev/zero --rate=48000 -d lfe_test

Thanks to the original reporter for the backtrace:

Bug: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1496577

8 years agomodules: Fix entry leak in module-card-restore
Peter Meerwald [Mon, 14 Sep 2015 15:23:29 +0000 (17:23 +0200)]
modules: Fix entry leak in module-card-restore

CID 1323585

entry_read() allocates an entry which must be freed

8 years agocore: Add missing return on protocol error
Peter Meerwald [Mon, 14 Sep 2015 15:50:36 +0000 (17:50 +0200)]
core: Add missing return on protocol error

CID 1323582

when a protocol error occors, better bail out :)

8 years agodaemon: No need to check optarg, -p requires argument
Peter Meerwald [Mon, 14 Sep 2015 14:54:59 +0000 (16:54 +0200)]
daemon: No need to check optarg, -p requires argument

CID 1323589

getopt() makes sure that we have an argument for -p
remove the broken check for optarg being set

8 years agoloopback: Fix the obviously-wrong "buffer+=buffer" logic
Alexander E. Patrakov [Sat, 12 Sep 2015 14:27:56 +0000 (19:27 +0500)]
loopback: Fix the obviously-wrong "buffer+=buffer" logic

Originally pointed out by Georg Chini.

Calculating buffer = buffer + (send_counter - recv_counter)
in one branch and buffer = 2 * buffer - (recv_counter - send_counter)
looks very obviously wrong. In other words, before the patch, the
contribution from the previous lines was double-counted.

8 years agobuild-sys: add sb-omni-surround-5.1.conf to Makefile.am v6.99.2
Tanu Kaskinen [Sat, 12 Sep 2015 13:42:43 +0000 (16:42 +0300)]
build-sys: add sb-omni-surround-5.1.conf to Makefile.am

This is needed to get the file included in the release tarballs.

8 years agobuild-sys: bump sonames
Tanu Kaskinen [Sat, 12 Sep 2015 13:23:03 +0000 (16:23 +0300)]
build-sys: bump sonames

There were a couple of bug fixes to libpulse since 6.99.1.

8 years agosink, source: Do not dereference freed memory when freeing the next events
Felipe Sateler [Fri, 11 Sep 2015 23:15:21 +0000 (20:15 -0300)]
sink, source: Do not dereference freed memory when freeing the next events

Coverity IDs: 1138197, 1138196

8 years agoutil: pa_get_fqdn: always free addrinfo
Felipe Sateler [Fri, 11 Sep 2015 23:15:20 +0000 (20:15 -0300)]
util: pa_get_fqdn: always free addrinfo

Also fix the return error code check of getaddrinfo call

Coverity ID: 1323587

8 years agoi18n: Update Polish translation
Piotr Drąg [Fri, 28 Aug 2015 14:29:58 +0000 (16:29 +0200)]
i18n: Update Polish translation

8 years agoFix return code check of pa_append_to_home_dir
Felipe Sateler [Fri, 11 Sep 2015 00:42:48 +0000 (21:42 -0300)]
Fix return code check of pa_append_to_home_dir

It returns negative on error, zero on success.

Found by coverity

8 years agobuild-sys: fix order of libraries installation
Zavadovsky Yan [Thu, 27 Aug 2015 20:56:23 +0000 (23:56 +0300)]
build-sys: fix order of libraries installation

Libraries from modlibexec_LTLIBRARIES list require
not only libpulsecommon but also libpulse and
libpulsecore from lib_LTLIBRARIES list.

This patch fix race in 'make -j X install' (with X is 2 and more)
when building/installing inside chroot placed on RAM-disk(tmpfs).

Signed-off-by: Zavadovsky Yan <zavadovsky.yan@gmail.com>
8 years agomodule: Always remove freed module from modules_pending_unload
David Henningsson [Thu, 3 Sep 2015 07:43:01 +0000 (09:43 +0200)]
module: Always remove freed module from modules_pending_unload

pa_module_free is called from more than one place, not all of
these places correctly removed the module from the
modules_pending_unload array, potentially causing a dangling pointer
in that array.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agocore-util: include xlocale.h when using strtod_l()
Tanu Kaskinen [Wed, 20 May 2015 19:35:28 +0000 (22:35 +0300)]
core-util: include xlocale.h when using strtod_l()

Based on some googling, strtod_l() is defined in xlocale.h on BSD.
Glibc seems to define it in stdlib.h, but only if GNU extensions are
enabled (otherwise the function won't be available). So, this patch
should fix the use of strtod_l() on BSDs, but on other systems things
may or may not be still broken.

The original patch author is Jakob Fink <jfink@gmx.at>. He sent this
patch to the freebsd-gnome mailing list:
http://lists.freebsd.org/pipermail/freebsd-gnome/2015-April/032138.html

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90285
8 years agobuild-sys: check strtod_l instead of strtof_l
Tanu Kaskinen [Wed, 20 May 2015 19:35:27 +0000 (22:35 +0300)]
build-sys: check strtod_l instead of strtof_l

We have no strtof_l calls in the code, so it doesn't make sense to
check that function's availability. We have one strtod_l call, so
let's check that instead.

I don't know if this change makes any practical difference. I just
wondered why we had HAVE_STRTOF_L ifdefs in core-util.c for code that
didn't use strtof_l.

8 years agoalsa-mixer: sb-omni-surround-5.1.conf: remove analog-surround-40 mapping
Tanu Kaskinen [Mon, 10 Aug 2015 15:22:38 +0000 (17:22 +0200)]
alsa-mixer: sb-omni-surround-5.1.conf: remove analog-surround-40 mapping

It was reported that the 4.0 mode doesn't work properly:
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23677/focus=23904

8 years agoalsa-mixer: sb-omni-surround-5.1.conf: rename analog-stereo to analog-stereo-output
Tanu Kaskinen [Thu, 6 Aug 2015 10:13:54 +0000 (12:13 +0200)]
alsa-mixer: sb-omni-surround-5.1.conf: rename analog-stereo to analog-stereo-output

The mapping is only useful for output, and this renaming makes the
name symmetric with the input mapping.

8 years agoalsa-mixer: Add support for Creative SoundBlaster Omni Surround 5.1 USB sound card
Nazar Mokrynskyi [Wed, 3 Jun 2015 15:32:09 +0000 (17:32 +0200)]
alsa-mixer: Add support for Creative SoundBlaster Omni Surround 5.1 USB sound card

Mic and Line in inputs were not working at all, since they use the
hw:x,1,0 device, which is not supported in the default configuration.

8 years agoupdate NEWS for 7.0 v6.99.1
Tanu Kaskinen [Thu, 27 Aug 2015 16:16:46 +0000 (19:16 +0300)]
update NEWS for 7.0

8 years agobuild-sys: bump sonames
Tanu Kaskinen [Thu, 27 Aug 2015 16:02:23 +0000 (19:02 +0300)]
build-sys: bump sonames

In this release cycle, libpulse had some internal code changes, but no ABI
changes.

libpulse-simple and libpulse-mainloop-glib had no changes whatsoever.

8 years agoalsa: Clarify potentially confusing device port data field
Arun Raghavan [Tue, 25 Aug 2015 15:42:05 +0000 (21:12 +0530)]
alsa: Clarify potentially confusing device port data field

The meaning of the code is unchanged here, but it is clearer that the
PA_DEVICE_PORT_DATA field is a struct ucm_port pointer.

8 years agoalsa-mixer: Drop redundant conditional frees
Arun Raghavan [Tue, 25 Aug 2015 13:57:24 +0000 (19:27 +0530)]
alsa-mixer: Drop redundant conditional frees

The dynarrays are allocated unconditionally, so the free need not be
conditional.

8 years agoucm: Add support for "JackHWMute"
Tanu Kaskinen [Mon, 4 May 2015 18:03:45 +0000 (21:03 +0300)]
ucm: Add support for "JackHWMute"

JackHWMute is used to list devices that get forcibly muted by
a particular jack. We mark ports unavailable based on that
information.

8 years agoucm: Create only one jack object per kcontrol
Tanu Kaskinen [Mon, 4 May 2015 18:03:44 +0000 (21:03 +0300)]
ucm: Create only one jack object per kcontrol

Previously the UCM code created one jack object per device name (which
is not the same thing as creating one jack object per device, because
the UCM device namespace is scoped on per-verb basis, so devices in
different verbs may have the same name). I think it's conceptually
cleaner to create one jack object per alsa kcontrol. I plan to do
similar refactoring on the traditional mixer code later.

8 years agoalsa: Move UCM port availability updating to the mixer code
Tanu Kaskinen [Mon, 4 May 2015 18:03:43 +0000 (21:03 +0300)]
alsa: Move UCM port availability updating to the mixer code

Previously module-alsa-card assigned to pa_alsa_jack.plugged_in
directly, and then did the port availability updating manually. The
idea of pa_alsa_jack_set_plugged_in() is to move the availability
updating to the mixer infrastructure, where it really belongs.

Similarly, pa_alsa_jack.has_control was previously modified directly
from several places. The has_control field affects the port
availability, and pa_alsa_jack_set_has_control() takes care of
updating the availability.

For now, pa_alsa_jack_set_plugged_in() and
pa_alsa_jack_set_has_control() only update the port availability
when using UCM. My plan is to adapt the traditional mixer code later.

8 years agoalsa: Add associations between jacks, UCM devices and UCM ports
Tanu Kaskinen [Mon, 4 May 2015 18:03:42 +0000 (21:03 +0300)]
alsa: Add associations between jacks, UCM devices and UCM ports

These associations will be used by subsequent UCM jack detection
refactoring work.

8 years agoucm: Don't create separate input and output jacks
Tanu Kaskinen [Mon, 4 May 2015 18:03:41 +0000 (21:03 +0300)]
ucm: Don't create separate input and output jacks

The UCM spec doesn't support separate input and output jacks, so it's
redundant to have separate input and output jacks in
pa_alsa_ucm_device.

8 years agoalsa: Add pa_alsa_jack_new() and pa_alsa_jack_free()
Tanu Kaskinen [Mon, 4 May 2015 18:03:40 +0000 (21:03 +0300)]
alsa: Add pa_alsa_jack_new() and pa_alsa_jack_free()

This reduces code duplication in alsa-mixer.c and alsa-ucm.c. No
functional changes.

8 years agoalsa-mixer: Add "Front Line Out" and "Rear Line Out"
David Henningsson [Fri, 21 Aug 2015 06:46:21 +0000 (08:46 +0200)]
alsa-mixer: Add "Front Line Out" and "Rear Line Out"

"Front Line Out" was found in the wild on one of the machines we enable.
I figured I could just as well add "Rear Line Out" too, because that's
just as likely to show up.

As a reminder, "Front Line Out" means "a line out jack physically located
on the front side", where as "Line Out Front" means "a line out jack
playing back front left and front right channels in a channel map".

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agobuild-sys: make error message visible
Tanu Kaskinen [Mon, 10 Aug 2015 15:44:53 +0000 (17:44 +0200)]
build-sys: make error message visible

This helps figuring out why bootstrap.sh is failing...

Directing the error message to /dev/null was very strange. I don't
know what the original motivation might have been. My guess is that
it was added unintentionally.

8 years agoalsa-mixer: Add descriptions for analog-stereo-input and analog-stereo-output mappings
Tanu Kaskinen [Thu, 6 Aug 2015 10:19:12 +0000 (12:19 +0200)]
alsa-mixer: Add descriptions for analog-stereo-input and analog-stereo-output mappings

These mapping names are used in sb-omni-surround-5.1.conf, which needs
to use separate mappings for input and output, since they are
associated with different alsa devices.

8 years agopulse: Document client libraries logging behavior
Ahmed S. Darwish [Fri, 14 Aug 2015 14:35:18 +0000 (16:35 +0200)]
pulse: Document client libraries logging behavior

Document how to modify the client libraries logging behvaior
using any of the PA-specific environment variables.

Using the PULSE_LOG_* environment variables makes debugging
and tracing PA applications quite easy, thus the need for an
official documentation text.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
8 years agoRemoved exclamation marks from user-visible messages.
Deepak Srivastava [Mon, 15 Jun 2015 12:04:07 +0000 (17:34 +0530)]
Removed exclamation marks from user-visible messages.

<EP-E358F00C1D9A449EAE69225B9D2530F8>
According to rationale-"http://techbase.kde.org/Projects/Usability/HIG/Exclamation_points" as suggested in reported bug.
Component: misc

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=78563
Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
8 years agopatcl: Error msg from pactl not quite accurate for 'mute' commands
Deepak Srivastava [Thu, 11 Jun 2015 06:43:20 +0000 (12:13 +0530)]
patcl: Error msg from pactl not quite accurate for 'mute' commands

<EP-E358F00C1D9A449EAE69225B9D2530F8>
Updated the error string for mute commands in pactl. If someone forget to specify
the parameter on the commandline the resulting error message isn't quite right.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90117
Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
8 years agopacmd: Placeholders describing command line options should not have spaces
Manish Sogi [Thu, 11 Jun 2015 06:16:54 +0000 (11:46 +0530)]
pacmd: Placeholders describing command line options should not have spaces

<EP-F69A421D31544C56BDE97C590307C014>
Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=78565
Signed-off-by: Manish Sogi <manish.sogi@samsung.com>
8 years agomodules: Fix struct namespace collision on Solaris
Shawn Walker [Wed, 29 Jul 2015 02:39:41 +0000 (08:09 +0530)]
modules: Fix struct namespace collision on Solaris

8 years agobuild-sys: Fix up setting the bash completion dir
Arun Raghavan [Tue, 28 Jul 2015 04:39:20 +0000 (10:09 +0530)]
build-sys: Fix up setting the bash completion dir

This makes setting up the bash completion dir consistent with the other
cases that we need to deal with, and also handles distcheck correctly.

8 years agobuild-sys: Make echo-cancel use speex cflags/libs conditionally
Arun Raghavan [Tue, 28 Jul 2015 04:02:25 +0000 (09:32 +0530)]
build-sys: Make echo-cancel use speex cflags/libs conditionally

8 years agobuild-sys: Fix distcheck for systemd user unit dir
Arun Raghavan [Tue, 28 Jul 2015 04:01:48 +0000 (09:31 +0530)]
build-sys: Fix distcheck for systemd user unit dir

9 years agocombine-sink: Fix unsafe message handling
Tanu Kaskinen [Sat, 27 Jun 2015 15:36:35 +0000 (18:36 +0300)]
combine-sink: Fix unsafe message handling

This fixes a crash. sink_input_pop_cb() drains the message queue that receives
memchunks from the combine sink thread to avoid requesting more audio too soon.
The same message queue received also SET_REQUESTED_LATENCY messages, which
generate rewind requests. Rewind requests shouldn't be issued in the pop()
callback, doing so results in an assertion error. Therefore, it was not safe to
drain the message queue in the pop() callback, but usually the queue is empty,
so this bug was not immediately detected.

This patch splits the message queue into two queues: audio_inq and control_inq.
audio_inq receives only messages containing memchunks, and control_inq receives
only the SET_REQUESTED_LATENCY messages. The pop() callback only drains the
audio queue, which avoids the rewind requests in the pop() callback.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90489
9 years agopadsp: Avoid possible deadlock. Unlocked i->mainloop before returning from default...
Deepak Srivastava [Thu, 2 Jul 2015 05:15:09 +0000 (10:45 +0530)]
padsp: Avoid possible deadlock. Unlocked i->mainloop before returning from default case.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=91184
Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agoxen: Resource leak in local function alloc_gref() - alloc_fd and dev_fd
Manish Sogi [Thu, 2 Jul 2015 04:24:19 +0000 (09:54 +0530)]
xen: Resource leak in local function alloc_gref() - alloc_fd and dev_fd

The file descriptors need to be closed in failure cases otherwise resource
leak is there.

Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=91174#c0
Signed-off-by: Manish Sogi <manish.sogi@samsung.com>
9 years agomodule: Warn about modules loaded after unload
David Henningsson [Thu, 11 Jun 2015 12:00:08 +0000 (14:00 +0200)]
module: Warn about modules loaded after unload

We have crashes related to modules loaded after unload. This added
warning can provide some information about what that module is,
which in turn can help us solve the crashes, hopefully.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90108
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoequalizer: Handle underlying sink going away better when autoloaded
Arun Raghavan [Tue, 9 Jun 2015 07:01:12 +0000 (12:31 +0530)]
equalizer: Handle underlying sink going away better when autoloaded

Detailed description in fix for module-echo-cancel.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90416

9 years agoecho-cancel: Handle underlying sink going away better when autoloaded
Arun Raghavan [Tue, 9 Jun 2015 06:40:01 +0000 (12:10 +0530)]
echo-cancel: Handle underlying sink going away better when autoloaded

When we the underlying sink/source goes away, there is an intermediate
state where the asyncmsgqs that we were using for the sink-input and
source-output go away. This is usually okay if the sink-input and
source-output are moved to another device, but can be problematic if we
don't support moving (which is the case when the filter is autoloaded).

This becomes a problem because of the following chain of events:

  * The underlying sink goes away

  * Moving the filter sink-input fails (because it is autloaded)
    * At this point the sink-input has no underlying sink, and thus
      no underlying asyncmsgq
    * This also applies to all sink-inputs connected to the echo-cancel
      module

  * The sink-input is killed, triggering a module unload

  * On unlink, module-rescue-streams tries to move sink-inputs to
    another sink, starting with a START_MOVE message

  * There is no asyncmsgq for the message, so we crash
    * We can't just perform a NULL check for the asyncmsgq, since there
      are state changes we need to effect during the move

To fix this, we pretend to allow the move to the new sink, and then
unlink ourselves *after* the move is complete. This ensures that we
never find ourselves in a position where we need the underlying
sink/asyncmsgq to be present when it is not.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90416