Commit graph

8099 commits

Author SHA1 Message Date
David Henningsson
a6bc996dc1 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>
2015-11-06 15:30:30 +01:00
Arun Raghavan
3033fec287 build: Add IRC notifications to Travis 2015-11-06 19:50:08 +05:30
Arun Raghavan
3e0c30622b 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).
2015-11-06 17:58:50 +05:30
Arun Raghavan
daf326a9e4 resampler: Don't expose soxr methods if they are not supported
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92780
2015-11-06 17:40:29 +05:30
Lev Melnikovsky
9d2b763e29 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
2015-11-04 12:45:21 +02:00
Andrey Semashev
8fe9847706 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.
2015-11-03 06:39:50 +01:00
Ahmed S. Darwish
4bda712ee1 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>
2015-10-31 15:29:48 +02:00
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