Commit graph

8092 commits

Author SHA1 Message Date
Ahmed S. Darwish
c0f2e7d36a 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>
2015-10-31 15:29:48 +02:00
Peter Mattern
01aec46fb4 pacmd: Fix typo in set-default-* help
which was causing faulty output when running 'pacmd --help' on the shell
2015-10-30 18:47:16 +05:30
David Henningsson
9fecb6eb32 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>
2015-10-30 09:13:10 +02:00
David Henningsson
387a244cd9 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>
2015-10-30 09:13:07 +02:00
Tanu Kaskinen
69af1a713d 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.
2015-10-26 10:14:57 +01:00
Georg Chini
2902cdc4ca 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
2015-10-25 16:36:51 +02:00
David Henningsson
fcbbe34e00 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>
2015-10-23 14:40:55 +03:00
Julien Isorce
9817f396d5 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>
2015-10-21 09:45:26 +05:30
Ross Burton
c25b06577c 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
2015-10-20 16:55:23 +02:00
David Henningsson
f277f2c509 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>
2015-10-20 16:53:32 +02:00
David Henningsson
91313e60a8 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>
2015-10-20 13:13:03 +03:00
John Horan
f8cd444de0 make availability of ports visible over dbus 2015-10-19 11:02:44 +02:00
Juho Hämäläinen
2261567758 dbus: Add card profile availability info to API
[diwic: Profile availability to boolean bug fixed]
2015-10-19 10:57:35 +02:00
Julien Isorce
c021bfc6e0 core-util: avoid calling fchmod if already right mode
fchmod is denied in chromium sandbox.
2015-10-19 08:53:40 +05:30
David Henningsson
336a2cc6f0 card: Use pa_xmalloc0 when creating card profiles
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-10-16 22:05:55 +03:00
David Henningsson
12a93495b9 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>
2015-09-28 15:41:15 +02:00
David Henningsson
586ea6fcba card: Use pa_xnew0 when creating a card
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-09-28 14:37:49 +02:00
David Henningsson
0284363aa1 client: Use pa_xnew0 when creating a client
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-09-28 14:36:23 +02:00
Tanu Kaskinen
772d655de6 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.
2015-09-27 17:02:17 +03:00
Ahmed S. Darwish
08959f83d0 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>
2015-09-25 15:05:43 +03:00
Tanu Kaskinen
e061f9afd2 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.
2015-09-25 15:05:43 +03:00
Takashi Iwai
4a9916ba15 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>
2015-09-25 15:05:43 +03:00
Manish Sogi
ff24ea7695 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>
2015-09-25 15:05:43 +03:00
David Henningsson
4a8bf9ab30 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>
2015-09-25 15:05:43 +03:00
Ahmed S. Darwish
5d4905ec31 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>
2015-09-25 15:05:43 +03:00
Ahmed S. Darwish
ac5b7b8d5c 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>
2015-09-25 17:29:03 +05:30
Felipe Sateler
c93903d99a pulseaudio.1: document that systemd notification only works without daemonization 2015-09-25 17:29:03 +05:30
Felipe Sateler
ad047c2c79 daemon: Use Type=notify for systemd service
This ensures systemd knows when pulseaudio finishes loading, thus never
marking pulseaudio as active if startup fails.
2015-09-25 17:29:02 +05:30
Deepak Srivastava
2d5eec2d2c 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>
2015-09-25 17:29:02 +05:30
Peter Meerwald
bb88d90950 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>
2015-09-25 17:29:02 +05:30
Shawn Walker
b727dd540b 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
2015-09-25 17:29:02 +05:30
Arun Raghavan
69a5d4913c Update NEWS for 7.0 release 2015-09-24 08:57:04 +05:30
Dušan Kazik
6003f3a471 i18n: Update Slovak translation 2015-09-23 13:21:41 +05:30
Michael Cree
392060d0fc 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
2015-09-17 08:12:49 +02:00
Arun Raghavan
76e2cec9a2 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
2015-09-17 08:10:44 +02:00
Peter Meerwald
3193f6a2c4 modules: Fix entry leak in module-card-restore
CID 1323585

entry_read() allocates an entry which must be freed
2015-09-16 08:10:35 +02:00
Peter Meerwald
d36baaf81e core: Add missing return on protocol error
CID 1323582

when a protocol error occors, better bail out :)
2015-09-16 08:05:52 +02:00
Peter Meerwald
cadbb2b315 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
2015-09-16 08:03:48 +02:00
Alexander E. Patrakov
c7310f8e37 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.
2015-09-13 19:24:10 +03:00
Tanu Kaskinen
11d22f97cf build-sys: add sb-omni-surround-5.1.conf to Makefile.am
This is needed to get the file included in the release tarballs.
2015-09-12 16:42:43 +03:00
Tanu Kaskinen
4c964d8074 build-sys: bump sonames
There were a couple of bug fixes to libpulse since 6.99.1.
2015-09-12 16:23:03 +03:00
Felipe Sateler
2a1d876b1c sink, source: Do not dereference freed memory when freeing the next events
Coverity IDs: 1138197, 1138196
2015-09-12 16:09:24 +03:00
Felipe Sateler
b42575e183 util: pa_get_fqdn: always free addrinfo
Also fix the return error code check of getaddrinfo call

Coverity ID: 1323587
2015-09-12 16:04:20 +03:00
Piotr Drąg
195960859c i18n: Update Polish translation 2015-09-12 15:52:59 +03:00
Felipe Sateler
c49c9bd3aa Fix return code check of pa_append_to_home_dir
It returns negative on error, zero on success.

Found by coverity
2015-09-11 14:22:15 +03:00
Zavadovsky Yan
5271f28145 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>
2015-09-10 16:09:55 +03:00
David Henningsson
a527711528 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>
2015-09-07 14:59:57 +02:00
Tanu Kaskinen
83de5a0995 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
2015-09-07 14:54:31 +02:00
Tanu Kaskinen
27d71c00d8 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.
2015-09-07 14:54:27 +02:00
Tanu Kaskinen
031ca87821 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
2015-08-28 08:27:03 +03:00