Commit graph

8120 commits

Author SHA1 Message Date
Arun Raghavan
3e7b6e8cb5 build-sys: Fix distcheck for systemd user unit dir 2015-07-28 09:31:48 +05:30
Tanu Kaskinen
4604af7198 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
2015-07-21 20:05:13 +03:00
Deepak Srivastava
8b3b39c7d8 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>
2015-07-21 16:44:26 +02:00
Manish Sogi
dd084acb28 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>
2015-07-21 16:40:03 +02:00
David Henningsson
8f12ef901c 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>
2015-06-18 11:01:24 +02:00
Arun Raghavan
aafb56d902 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
2015-06-12 12:43:18 +05:30
Arun Raghavan
bf7bc1a55f 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
2015-06-12 12:43:18 +05:30
Arun Raghavan
ceae6b1e61 always-sink: Ignore filter sinks
We don't want to count filter sinks towards the list of actual sinks,
since those also need a real underlying sink to exist.
2015-06-12 12:43:18 +05:30
Arun Raghavan
81f7589a3f sink,source: Add a helper function to check whether this is a filter 2015-06-12 12:43:18 +05:30
Arun Raghavan
5adb126259 stream: Support extended API with PULSE_LATENCY_MSEC if possible
This only works in the single-format case (i.e. we know the format
up-front and we're not negotiating).
2015-06-12 12:43:18 +05:30
David Henningsson
a1c4a6916f stream: Check sample spec validity before abiding PULSE_LATENCY_MSEC
In case the sample spec is not known, as can be the case when
pa_stream_new_extended is used, we cannot satisfy the PULSE_LATENCY_MSEC
request.

As a workaround disable being able to use PULSE_LATENCY_MSEC in this case.

Reported-by: Fritsch <fritsch@xbmc.org>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-06-12 12:43:14 +05:30
David Henningsson
cbc0d5ffcb echo-cancel: Add config.h in adrian-aec.c
This fixes a compiler warning on some platform.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90881
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-06-12 12:42:59 +05:30
Felipe Sateler
cdf847f2f1 man: fix reference to --daemonize option
Even if --daemon is also accepted, --daemonize is the correct name of
the option.
2015-06-11 11:44:19 +05:30
Arun Raghavan
1beec62c2d rescue-streams: Fix a couple of typos 2015-06-10 16:53:07 +05:30
Arun Raghavan
21b912dd2b rescue-streams: Document a cryptic looking condition 2015-06-10 16:53:07 +05:30
David Henningsson
733e4bce5b lfe-filter-test: Use S16NE format
...otherwise this code will fail on big-endian architectures.

Cc: Hui Wang <hui.wang@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-06-01 11:05:24 +02:00
Tanu Kaskinen
53b6b9df19 build-sys: add winerrno.h to libpulsecommon_SOURCES 2015-05-30 13:19:52 +03:00
Pierre Ossman
d284d90d5f core: make sure we use the correct win32 socket errno:s
Modern versions of MinGW and Visual Studio provide socket errno
defines that make no sense (no API sets them). Make sure we
continue to use the old WSAE ones that are actually returned by
Windows' socket API.

Signed-off-by: Pierre Ossman <ossman@cendio.se>
2015-05-30 13:14:11 +03:00
Peter Meerwald
1db12f5010 core: Work around -Wlogical-not-parentheses warnings
pulsecore/sink.c: In function 'pa_sink_put':
pulsecore/sink.c:648:53: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
     pa_assert(!(s->flags & PA_SINK_DYNAMIC_LATENCY) == (s->thread_info.fixed_latency != 0));
                                                     ^

pulsecore/source.c: In function 'pa_source_put':
pulsecore/source.c:599:55: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
     pa_assert(!(s->flags & PA_SOURCE_DYNAMIC_LATENCY) == (s->thread_info.fixed_latency != 0));
                                                       ^
rewrite expression to suppress warning:
!(x & MASK) == (y != 0)
<->
!(x & MASK) == !(y == 0)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-05-27 19:16:38 +02:00
Peter Meerwald
6942e13a36 padsp: Fix wrong condition discovered by -Wlogical-not-parentheses warning
warnings emited by gcc 5.1:

utils/padsp.c: In function 'dsp_trigger':
utils/padsp.c:1902:39: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
     while (!pa_operation_get_state(o) != PA_OPERATION_DONE) {
                                       ^
utils/padsp.c: In function 'dsp_cork':
utils/padsp.c:1937:39: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
     while (!pa_operation_get_state(o) != PA_OPERATION_DONE) {
                                       ^
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-05-27 19:16:38 +02:00
Cédric Valmary
f81e97ad05 i18n: add Occitan translation 2015-05-27 13:40:59 +03:00
Ville Skyttä
84dff820ed build-sys: Install bash completion to where bash-completion.pc says
Fall back to the previous /etc/bash_completion.d dir on failures
(either old bash completion or not installed).

changes over Ville Skyttä's patch:
define PKG_CHECK_VAR macro which became available only in pkg-config 0.28

see https://bugs.freedesktop.org/show_bug.cgi?id=88782 and
https://bugs.freedesktop.org/show_bug.cgi?id=89540

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-05-25 16:20:43 +02:00
Peter Meerwald
a26defed9e biquad: Fix warning, gamma shadows global declaration
pulsecore/filter/biquad.c: In function 'biquad_lowpass':
pulsecore/filter/biquad.c:52:10: warning: declaration of 'gamma' shadows a global declaration [-Wshadow]
pulsecore/filter/biquad.c: In function 'biquad_highpass':
pulsecore/filter/biquad.c:86:10: warning: declaration of 'gamma' shadows a global declaration [-Wshadow]

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-05-25 16:17:14 +02:00
Peter Meerwald
815c67f8d7 biquad: Make use of M_SQRT2 constant
should be in math.h, use it

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-05-25 16:17:01 +02:00
Peter Meerwald
07c7295b92 core: Don't export pa_rtpoll_quit(), only used internally
see https://bugs.freedesktop.org/show_bug.cgi?id=89539

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-05-25 15:28:27 +02:00
Peter Meerwald
34d80f9a01 pulse: Document pa_mainloop_quit()'s retval parameter
the argument's name in the header changed to retval to match the implementation

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-05-25 15:27:05 +02:00
Peter Meerwald
cf0cd5fe18 daemon: Exit with code 0 on SIGINT and SIGTERM
see https://bugs.freedesktop.org/show_bug.cgi?id=86818

an exit code of 1 makes systemd believe that the service failed;
better return 0 to denote that PA sucessfully stopped on the user's
request

sidenote: systemd's SuccessExitStatus= could be used to turn code 1 into a
code denoting success

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: jan.steffens@gmail.com
2015-05-25 15:21:50 +02:00
Hui Wang
a7d41ef043 tests: add tolerant variation for comparing the rewind result
On 32bits OS, this test case fails. The reason is when rewinding to
the middle of a block, some of float parameters in the saved_state
are stored in the memory from FPU registers, and those parameters will
be used for next time to process data with lfe. Here if FPU register
is over 32bits, the storing from FPU register to memory will introduce
some variation, and this small variation will introduce small
variation to the rewinding result.

So adding the tolerant variation for comparing the rewind result, make
this test case can work on both 64bits OS and 32bits OS.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2015-05-25 14:35:34 +02:00
Hui Wang
fec553170a tests: Remove a redundant mempool_new from resampler-test
Signed-off-by: Hui Wang <hui.wang@canonical.com>
2015-05-25 08:44:11 +02:00
Dušan Kazik
7aa422359d i18n: update Slovak translation 2015-05-22 14:11:10 +03:00
Juho Hämäläinen
2a33abb156 Revert "Warn on loading module-dbus-protocol"
This reverts commit e2a433b222.

Events are now handled using hooks instead of asynchronous subscription
system.
2015-05-21 10:25:29 +02:00
Juho Hämäläinen
43f5a00fcb dbus: Use hooks for module proplist changes 2015-05-21 10:24:52 +02:00
Juho Hämäläinen
ae415b07a0 dbus: Use hooks for module new and removed events 2015-05-21 10:24:16 +02:00
Juho Hämäläinen
7e0d0b8b00 dbus: Use hook for sample cache proplist changes 2015-05-21 10:20:35 +02:00
Juho Hämäläinen
4e8a62c3c2 dbus: Use hooks for sample cache new and removed events 2015-05-21 10:17:26 +02:00
Juho Hämäläinen
7a3ed4af12 core, core-scache: Fire hooks for new, changed and removed events
(Refactored by David Henningsson)
2015-05-21 10:06:11 +02:00
Juho Hämäläinen
e0b8966954 module: Fire hooks for new, proplist changed and removed
(Unlink callback moved by David Henningsson)
2015-05-21 09:05:03 +02:00
Juho Hämäläinen
f5340b90d9 core: Add core hooks for module changes
(Name adjusted by David Henningsson)
2015-05-21 08:50:15 +02:00
Arun Raghavan
e490a900e2 protocol-native: Fix source latency calculation in ADJUST_LATENCY mode
This fixes buffer attr calculation so that we set the source latency to
the requested latency. This makes sense because the intermediate
delay_memblockq is just a mechanism to send data to the client. It
should not actually add to the total latency over what the source
already provides.

With this, the meaning of fragsize and maxlength become more
meaningful/accurate with regards to ADJUST_LATENCY mode -- fragsize
becomes the latency the source is configured for (which is then
approximately the total latency until the buffer reaches the client).
Maxlength, as before, continues to be the maximum amount of data we
might hold for the client before overrunning.
2015-05-12 19:49:05 +07:00
Paul Menzel
7922851152 lfe-filter: Use length modifier z for type size_t
Fix the following warnings.

          CC       pulsecore/filter/libpulsecore_6.0_la-lfe-filter.lo
        pulsecore/filter/lfe-filter.c: In function 'pa_lfe_filter_rewind':
        pulsecore/filter/lfe-filter.c:179:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' [-Wformat=]
                 pa_log_debug("Rewinding LFE filter %lu samples to position %lli. No saved state found", samples, (long long) f->index);
                 ^
        pulsecore/filter/lfe-filter.c:183:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' [-Wformat=]
             pa_log_debug("Rewinding LFE filter %lu samples to position %lli. Found saved state at position %lli",
             ^
          CC       pulsecore/filter/libpulsecore_6.0_la-biquad.lo  CC       pulsecore/filter/libpulsecore_6.0_la-lfe-filter.lo
        pulsecore/filter/lfe-filter.c: In function 'pa_lfe_filter_rewind':
        pulsecore/filter/lfe-filter.c:179:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' [-Wformat=]
                 pa_log_debug("Rewinding LFE filter %lu samples to position %lli. No saved state found", samples, (long long) f->index);
                 ^
        pulsecore/filter/lfe-filter.c:183:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' [-Wformat=]
             pa_log_debug("Rewinding LFE filter %lu samples to position %lli. Found saved state at position %lli",
             ^
2015-05-08 12:16:50 +03:00
Peter Meerwald
75dd22ce2e man: Document .ifexists CLI meta command
v2 (thanks Tanu)
* describe purpose and file search

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
2015-05-06 11:32:38 +02:00
Peter Meerwald
1edb696c46 man: Fix typos in pulse-cli-syntax.5
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-05-05 18:55:08 +02:00
David Henningsson
5598923b8e alsa-mixer: Make line out path unavailable when "Front Headphone" is plugged in
This case was apparently overlooked.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-05-05 16:48:11 +02:00
Felipe Sateler
b620fb444c Add a .travis.yml for Travis CI
Installs all the build dependencies, and runs make check and
check-daemon.

V1: Based on Arun Raghavan's travis file. Added trusty repositories to get
newer libs.

V2: Explicitly list all dependencies instead of relying on the Ubuntu
package Build-Dependencies. Send notifications to pulseaudio-discuss

V3: Install libsystemd-daemon-dev, libsystemd-id128-dev,
libsystemd-journal-dev, and libsystemd-login-dev. Send notifications to
pulseaudio-commits. Drop libjson0-dev, libjson-c-dev is the package to
depend on.
2015-05-05 16:41:13 +05:30
Tanu Kaskinen
2737985f27 oss: Use the correct fd when interacting with the mixer
Adapted from a FreeBSD patch:
http://svnweb.freebsd.org/ports/head/audio/pulseaudio/files/patch-src_modules_oss_module-oss.c?revision=372768&view=markup
2015-04-30 13:21:02 +03:00
Tanu Kaskinen
bae15c420a core-util: Make pa_parse_volume() more strict
Previously pa_parse_volume() clamped the value to fit in the valid
range, but I think it's better to reject values outside the valid
range.

This also changes the percentage parsing to allow non-integer values.
2015-04-29 18:14:27 +03:00
Yuri Chornoivan
f73de5608d i18n: Update Ukrainian translation 2015-04-21 10:56:27 +03:00
David Henningsson
17e939dc15 core-util, pactl: Make one localised and one non-localised version of pa_yes_no
We currently use pa_yes_no to write module arguments, so they can not be
localised. Instead add a new pa_yes_no_localised function and use it in pactl
(and thus, revert all other places to use the non-localised version).

BugLink: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1445358
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-20 17:36:53 +02:00
Wim Taymans
b5ee6280d6 Add korean translation 2015-04-13 17:08:42 +03:00
Arun Raghavan
3f0ab4522a udev: Deal with unavailable bus property
Fixes a compiler warning:

../../src/modules/udev-util.c: In function 'pa_udev_get_info':
../../src/modules/udev-util.c:228:443: warning: 'bus' may be used uninitialized in this function [-Wmaybe-uninitialized]
         if (!pa_streq(bus, "firewire") && (v = udev_device_get_property_value(card, "ID_MODEL_FROM_DATABASE")) && *v)
2015-04-13 08:35:53 +05:30