platform/upstream/pulseaudio.git
9 years agoalways-sink: Ignore filter sinks
Arun Raghavan [Tue, 9 Jun 2015 06:37:44 +0000 (12:07 +0530)]
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.

9 years agosink,source: Add a helper function to check whether this is a filter
Arun Raghavan [Tue, 9 Jun 2015 06:36:48 +0000 (12:06 +0530)]
sink,source: Add a helper function to check whether this is a filter

9 years agostream: Support extended API with PULSE_LATENCY_MSEC if possible
Arun Raghavan [Thu, 11 Jun 2015 05:31:30 +0000 (11:01 +0530)]
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).

9 years agostream: Check sample spec validity before abiding PULSE_LATENCY_MSEC
David Henningsson [Wed, 10 Jun 2015 15:29:54 +0000 (17:29 +0200)]
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>
9 years agoecho-cancel: Add config.h in adrian-aec.c
David Henningsson [Fri, 12 Jun 2015 06:51:21 +0000 (08:51 +0200)]
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>
9 years agoman: fix reference to --daemonize option
Felipe Sateler [Thu, 11 Jun 2015 00:30:08 +0000 (21:30 -0300)]
man: fix reference to --daemonize option

Even if --daemon is also accepted, --daemonize is the correct name of
the option.

9 years agorescue-streams: Fix a couple of typos
Arun Raghavan [Wed, 10 Jun 2015 11:22:38 +0000 (16:52 +0530)]
rescue-streams: Fix a couple of typos

9 years agorescue-streams: Document a cryptic looking condition
Arun Raghavan [Wed, 10 Jun 2015 11:22:17 +0000 (16:52 +0530)]
rescue-streams: Document a cryptic looking condition

9 years agolfe-filter-test: Use S16NE format
David Henningsson [Tue, 26 May 2015 06:47:46 +0000 (08:47 +0200)]
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>
9 years agobuild-sys: add winerrno.h to libpulsecommon_SOURCES
Tanu Kaskinen [Sat, 30 May 2015 10:19:52 +0000 (13:19 +0300)]
build-sys: add winerrno.h to libpulsecommon_SOURCES

9 years agocore: make sure we use the correct win32 socket errno:s
Pierre Ossman [Fri, 29 May 2015 14:39:45 +0000 (16:39 +0200)]
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>
9 years agocore: Work around -Wlogical-not-parentheses warnings
Peter Meerwald [Tue, 26 May 2015 21:35:10 +0000 (23:35 +0200)]
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>
9 years agopadsp: Fix wrong condition discovered by -Wlogical-not-parentheses warning
Peter Meerwald [Tue, 26 May 2015 21:09:50 +0000 (23:09 +0200)]
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>
9 years agoi18n: add Occitan translation
Cédric Valmary [Wed, 27 May 2015 10:40:59 +0000 (13:40 +0300)]
i18n: add Occitan translation

9 years agobuild-sys: Install bash completion to where bash-completion.pc says
Ville Skyttä [Sun, 25 Jan 2015 11:38:43 +0000 (13:38 +0200)]
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>
9 years agobiquad: Fix warning, gamma shadows global declaration
Peter Meerwald [Wed, 20 May 2015 15:02:13 +0000 (17:02 +0200)]
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>
9 years agobiquad: Make use of M_SQRT2 constant
Peter Meerwald [Wed, 20 May 2015 14:55:31 +0000 (16:55 +0200)]
biquad: Make use of M_SQRT2 constant

should be in math.h, use it

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agocore: Don't export pa_rtpoll_quit(), only used internally
Peter Meerwald [Wed, 20 May 2015 14:12:43 +0000 (16:12 +0200)]
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>
9 years agopulse: Document pa_mainloop_quit()'s retval parameter
Peter Meerwald [Wed, 20 May 2015 13:52:46 +0000 (15:52 +0200)]
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>
9 years agodaemon: Exit with code 0 on SIGINT and SIGTERM
Peter Meerwald [Wed, 20 May 2015 23:31:01 +0000 (01:31 +0200)]
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
9 years agotests: add tolerant variation for comparing the rewind result
Hui Wang [Mon, 25 May 2015 12:05:30 +0000 (20:05 +0800)]
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>
9 years agotests: Remove a redundant mempool_new from resampler-test
Hui Wang [Mon, 25 May 2015 04:49:53 +0000 (12:49 +0800)]
tests: Remove a redundant mempool_new from resampler-test

Signed-off-by: Hui Wang <hui.wang@canonical.com>
9 years agoi18n: update Slovak translation
Dušan Kazik [Fri, 22 May 2015 11:10:01 +0000 (14:10 +0300)]
i18n: update Slovak translation

9 years agoRevert "Warn on loading module-dbus-protocol"
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:59 +0000 (13:50 +0200)]
Revert "Warn on loading module-dbus-protocol"

This reverts commit e2a433b222e2d4b6e85062b979e8ed3dae113aca.

Events are now handled using hooks instead of asynchronous subscription
system.

9 years agodbus: Use hooks for module proplist changes
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:58 +0000 (13:50 +0200)]
dbus: Use hooks for module proplist changes

9 years agodbus: Use hooks for module new and removed events
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:57 +0000 (13:50 +0200)]
dbus: Use hooks for module new and removed events

9 years agodbus: Use hook for sample cache proplist changes
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:56 +0000 (13:50 +0200)]
dbus: Use hook for sample cache proplist changes

9 years agodbus: Use hooks for sample cache new and removed events
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:55 +0000 (13:50 +0200)]
dbus: Use hooks for sample cache new and removed events

9 years agocore, core-scache: Fire hooks for new, changed and removed events
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:54 +0000 (13:50 +0200)]
core, core-scache: Fire hooks for new, changed and removed events

(Refactored by David Henningsson)

9 years agomodule: Fire hooks for new, proplist changed and removed
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:52 +0000 (13:50 +0200)]
module: Fire hooks for new, proplist changed and removed

(Unlink callback moved by David Henningsson)

9 years agocore: Add core hooks for module changes
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:51 +0000 (13:50 +0200)]
core: Add core hooks for module changes

(Name adjusted by David Henningsson)

9 years agoprotocol-native: Fix source latency calculation in ADJUST_LATENCY mode
Arun Raghavan [Mon, 13 Apr 2015 09:23:45 +0000 (14:53 +0530)]
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.

9 years agolfe-filter: Use length modifier `z` for type `size_t`
Paul Menzel [Sun, 3 May 2015 10:52:22 +0000 (12:52 +0200)]
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",
             ^

9 years agoman: Document .ifexists CLI meta command
Peter Meerwald [Mon, 4 May 2015 21:48:20 +0000 (23:48 +0200)]
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>
9 years agoman: Fix typos in pulse-cli-syntax.5
Peter Meerwald [Mon, 4 May 2015 21:05:43 +0000 (23:05 +0200)]
man: Fix typos in pulse-cli-syntax.5

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agoalsa-mixer: Make line out path unavailable when "Front Headphone" is plugged in
David Henningsson [Tue, 5 May 2015 07:43:32 +0000 (09:43 +0200)]
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>
9 years agoAdd a .travis.yml for Travis CI
Felipe Sateler [Thu, 30 Apr 2015 00:22:56 +0000 (21:22 -0300)]
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.

9 years agooss: Use the correct fd when interacting with the mixer
Tanu Kaskinen [Thu, 30 Apr 2015 10:21:02 +0000 (13:21 +0300)]
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

9 years agocore-util: Make pa_parse_volume() more strict
Tanu Kaskinen [Mon, 27 Apr 2015 11:34:03 +0000 (14:34 +0300)]
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.

9 years agoi18n: Update Ukrainian translation
Yuri Chornoivan [Mon, 20 Apr 2015 12:55:14 +0000 (15:55 +0300)]
i18n: Update Ukrainian translation

9 years agocore-util, pactl: Make one localised and one non-localised version of pa_yes_no
David Henningsson [Mon, 20 Apr 2015 15:36:53 +0000 (17:36 +0200)]
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>
9 years agoAdd korean translation
Wim Taymans [Tue, 7 Apr 2015 14:06:51 +0000 (16:06 +0200)]
Add korean translation

9 years agoudev: Deal with unavailable bus property
Arun Raghavan [Mon, 13 Apr 2015 03:04:54 +0000 (08:34 +0530)]
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)

9 years agodetect: Fix OSS device detection with long names
Andrey Zholos [Mon, 13 Apr 2015 03:00:46 +0000 (08:30 +0530)]
detect: Fix OSS device detection with long names

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

9 years agoalsa-mixer: Add paths/ports for multichannel profile
David Henningsson [Tue, 31 Mar 2015 12:38:04 +0000 (14:38 +0200)]
alsa-mixer: Add paths/ports for multichannel profile

This makes the GUIs (e g gnome/unity-control-center) look more consistent
with other inputs/outputs that also have ports.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoalsa-mixer: Use separate profiles for Multichannel Input/Output
David Henningsson [Tue, 31 Mar 2015 12:38:03 +0000 (14:38 +0200)]
alsa-mixer: Use separate profiles for Multichannel Input/Output

This works around bug 80850: a mapping can only have one channel map,
and in case of a 6-out 10-in device, the mapping will be adjusted to
have both 10 and 6 channels, which does not work.

Reported-by: Benjamin Tegge <benjaminosm@googlemail.com>
Suggested-by: Raymond Yau <superquad.vortex2@gmail.com>
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=80850
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoudev: use ID_MODEL/ID_VENDOR to give friendly name for FireWire devices
Takashi Sakamoto [Tue, 31 Mar 2015 12:38:02 +0000 (14:38 +0200)]
udev: use ID_MODEL/ID_VENDOR to give friendly name for FireWire devices

For recently supported FireWire sound devices, udev's database assign
the name of IEEE 1394 Phy/Link chipset to ID_XXX_FROM_DATABASE. This is
not friently names to users.

This commit applies a workaround to skip ID_XXX_FROM_DATABASE for any
FireWire devices.

[Fixed up by David Henningsson <david.henningsson@canonical.com>]

Reported-by: Andras Muranyi <muranyia@gmail.com>
Reference: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1381475
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agocore-util: Filter out not-a-numbers in pa_atod()
Tanu Kaskinen [Fri, 10 Apr 2015 09:44:02 +0000 (12:44 +0300)]
core-util: Filter out not-a-numbers in pa_atod()

We don't and probably never will have any pa_atod() callers that would
require "NaN" to be accepted, so let's filter those out in pa_atod(),
instead of requiring the callers to handle not-a-numbers appropriately
(which they generally forget to do).

9 years agopactl: Fix relative volume parsing
Tanu Kaskinen [Wed, 1 Apr 2015 16:40:28 +0000 (19:40 +0300)]
pactl: Fix relative volume parsing

The recent change to reject leading '+' in pa_atod() broke the
relative volume parsing in pactl. This fixes that.

9 years agomodule-switch-*: use pa_module_hook_connect
David Henningsson [Fri, 27 Mar 2015 10:20:16 +0000 (11:20 +0100)]
module-switch-*: use pa_module_hook_connect

Refactoring, no functional change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agomodule-filter-*: use pa_module_hook_connect
David Henningsson [Fri, 27 Mar 2015 10:20:15 +0000 (11:20 +0100)]
module-filter-*: use pa_module_hook_connect

Refactoring, no functional change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agomodule-alsa-card: use pa_module_hook_connect
David Henningsson [Fri, 27 Mar 2015 10:20:14 +0000 (11:20 +0100)]
module-alsa-card: use pa_module_hook_connect

Refactoring, no functional change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agomodule-suspend-on-idle: use pa_module_hook_connect
David Henningsson [Fri, 27 Mar 2015 10:20:13 +0000 (11:20 +0100)]
module-suspend-on-idle: use pa_module_hook_connect

Refactoring, no functional change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agomodule-*-restore: use pa_module_hook_connect
David Henningsson [Fri, 27 Mar 2015 10:20:12 +0000 (11:20 +0100)]
module-*-restore: use pa_module_hook_connect

Refactoring, no functional change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agomodule: Add hook dynarray
David Henningsson [Fri, 27 Mar 2015 10:20:11 +0000 (11:20 +0100)]
module: Add hook dynarray

This small helper will simplify code in many modules.
The hooks added through pa_module_hook_connect will be freed just
before pa__done is called (so trying to add hooks during pa__done
will result in assertion failure).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agosink-input: Clarify the meaning of rewrite and flush a bit in rewinds
Arun Raghavan [Mon, 30 Mar 2015 05:57:46 +0000 (11:27 +0530)]
sink-input: Clarify the meaning of rewrite and flush a bit in rewinds

9 years agodbus: Use hooks for default sink and source changes
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:50 +0000 (13:50 +0200)]
dbus: Use hooks for default sink and source changes

[Fixes by David Henningsson <david.henningsson@canonical.com>]

9 years agodbus: Use hooks for put and unlink
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:47 +0000 (13:50 +0200)]
dbus: Use hooks for put and unlink

Use hooks for all events that have core hooks defined. Some events
handled in iface-core don't have hooks so leave those for later.

9 years agonamereg: Fire hooks for default sink and source changes
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:49 +0000 (13:50 +0200)]
namereg: Fire hooks for default sink and source changes

9 years agocore: Add hooks for default sink and source changes
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:48 +0000 (13:50 +0200)]
core: Add hooks for default sink and source changes

9 years agodbus: Use state changed hook for sink-input and source-output rate changes
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:46 +0000 (13:50 +0200)]
dbus: Use state changed hook for sink-input and source-output rate changes

9 years agodbus: Use hooks for sink-input and source-output events
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:45 +0000 (13:50 +0200)]
dbus: Use hooks for sink-input and source-output events

9 years agodbus: Use hooks for sink and source events
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:44 +0000 (13:50 +0200)]
dbus: Use hooks for sink and source events

9 years agodbus: Use hooks for client proplist changes
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:43 +0000 (13:50 +0200)]
dbus: Use hooks for client proplist changes

9 years agodbus: Use hooks for card profile events
Juho Hämäläinen [Thu, 19 Mar 2015 11:50:42 +0000 (13:50 +0200)]
dbus: Use hooks for card profile events

9 years agoUpdate Italian translation.
Milo Casagrande [Thu, 26 Mar 2015 08:36:40 +0000 (09:36 +0100)]
Update Italian translation.

9 years agocoreaudio: Change error type to OSStatus
René J. V. Bertin [Wed, 1 Apr 2015 07:43:05 +0000 (09:43 +0200)]
coreaudio: Change error type to OSStatus

CoreAudio routines that return an error status do so with the
OSStatus type, which is not a UInt32: typical OS X errors are
negative numbers.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agosink, source: Fix a volume change leak
Tanu Kaskinen [Tue, 31 Mar 2015 09:39:53 +0000 (12:39 +0300)]
sink, source: Fix a volume change leak

When a sink or source is freed, there may be pending volume changes that
didn't get applied before the IO thread got torn down. Those pending
changes need to be freed.

The memory leak was reported here:
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23162/focus=23169

Reported-by: Alexander E. Patrakov <patrakov@gmail.com>
9 years ago.gitignore: Add lfe-filter-test
Tanu Kaskinen [Tue, 31 Mar 2015 09:40:50 +0000 (12:40 +0300)]
.gitignore: Add lfe-filter-test

9 years agoresampler: Rename "lfe_filter_required" to "lfe_remixed"
David Henningsson [Mon, 30 Mar 2015 13:12:53 +0000 (15:12 +0200)]
resampler: Rename "lfe_filter_required" to "lfe_remixed"

Just refactoring to make the variable name better.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoresampler: Allow disabling the LFE filter by setting crossover to 0
David Henningsson [Mon, 30 Mar 2015 09:10:56 +0000 (11:10 +0200)]
resampler: Allow disabling the LFE filter by setting crossover to 0

When crossover_freq is set to 0, this restores the old behaviour
of letting the LFE channel be the average of the source channels,
without additional processing. This can be useful e g in case the
user already has a hardware crossover.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agodaemon-conf: enable the lfe remixing by default
Hui Wang [Tue, 24 Mar 2015 09:29:15 +0000 (10:29 +0100)]
daemon-conf: enable the lfe remixing by default

Since we have a workable lfe filter, it is time to enable the lfe
remixing by default.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
9 years agotests: adding lfe-filter-test
Hui Wang [Tue, 24 Mar 2015 09:29:19 +0000 (10:29 +0100)]
tests: adding lfe-filter-test

so far, this test only includes rewind test, it works as below:
let lfe-filter process 2 blocks mono lfe channel audio samples, the
sample format is PA_SAMPLE_S16LE, save the processed data to the temp
buffer, then rewind the lfe-filter back 1 block and 1.5 blocks
respectively, reprocess the audio samples from the rewind position,
then comparing the output data with previously saved data.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
9 years agoresampler: Make some basic functions for rewinding
David Henningsson [Tue, 24 Mar 2015 09:29:18 +0000 (10:29 +0100)]
resampler: Make some basic functions for rewinding

The resampler framework just forwards the request to the lfe filter.
There are no resampler impl that can rewind yet, so just reset the
resampler impl instead of properly rewinding yet.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agolfe-filter: Add rewind support
David Henningsson [Tue, 24 Mar 2015 09:29:17 +0000 (10:29 +0100)]
lfe-filter: Add rewind support

Store current filter state at every normal block process.
When a rewind happens, rewind back to the nearest saved state,
then calculate forward to the actual sample position.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agomemblock: Change pa_memblock_new_malloced to an inline function
David Henningsson [Wed, 25 Mar 2015 09:13:13 +0000 (10:13 +0100)]
memblock: Change pa_memblock_new_malloced to an inline function

To avoid the macro trap: I call pa_memblock_new_malloced with
"pa_xmemdup" as data parameter, and that would expand to *two*
calls to pa_xmemdup in case that remains a macro, which is clearly
not intended.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agolfe-filter: change the crossover frequency as a parameter
Hui Wang [Tue, 24 Mar 2015 09:29:16 +0000 (10:29 +0100)]
lfe-filter: change the crossover frequency as a parameter

Add a user defined parameter lfe-crossover-freq for the lfe-filter,
to pass this parameter to the lfe-filter, we need to change the
pa_resampler_new() API as well.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
9 years agolfe-filter: Cleanup and refactor
David Henningsson [Tue, 24 Mar 2015 09:29:14 +0000 (10:29 +0100)]
lfe-filter: Cleanup and refactor

 - Remove imported dead code
 - Fix compiler warnings
 - Fix non-GCC compiler compilation (use more portable macros)
 - Change lr4 struct to include a biquad struct

Thanks to Alexander Patrakov for suggesting many of these changes.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agolfe-filter: Enable LFE filter in the resampler
David Henningsson [Tue, 24 Mar 2015 09:29:13 +0000 (10:29 +0100)]
lfe-filter: Enable LFE filter in the resampler

When enable-lfe-remixing is set, an LFE channel is present in the
resampler's destination channel map but not in the source channel map,
we insert a low-pass filter instead of just averaging the channels.
Other channels will get a high-pass filter.

In this patch, the crossover frequency is hardcoded to 120Hz (to be fixed
in later patches).

Note that in current state the LFE filter is
 - not very optimised
 - not rewind friendly (rewinding can cause audible artifacts)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agolfe-filter: Import code from the Chrome OS audio server
David Henningsson [Tue, 24 Mar 2015 09:29:12 +0000 (10:29 +0100)]
lfe-filter: Import code from the Chrome OS audio server

The chrome OS audio server has some already existing code, which
has been made available under a BSD-style license, which should be
safe to import by us.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoFix: Prevent calling pa_rtpoll_free() for a NULL rtpoll
Sagar Nageshmurthy [Tue, 24 Mar 2015 11:47:03 +0000 (17:17 +0530)]
Fix: Prevent calling pa_rtpoll_free() for a NULL rtpoll

Flushing the asyncmsgq can cause arbitrarily callbacks to run, potentially
causing recursion into pa_thread_mq_done again. Because of this; rtpoll which
is cleared in the second iteration is tried to free once again by the first
iteration leading to PA crash.

9 years agothread-mq: Make pa_thread_mq_done more robust
David Henningsson [Mon, 23 Mar 2015 13:39:52 +0000 (14:39 +0100)]
thread-mq: Make pa_thread_mq_done more robust

While investigating bug 89672 it was found that pa_thread_mq_done
was called recursively. Regardless of whether the recursion should
be stopped by other means, it seems to make sense to make
pa_thread_mq_done more robust so that it can be called twice
(and even recursively) without harm.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=89672
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoucm: Add support for "JackControl"
Tanu Kaskinen [Thu, 12 Feb 2015 13:11:52 +0000 (15:11 +0200)]
ucm: Add support for "JackControl"

JackControl is used to indicate the kcontrol name for jack detection.

9 years agocpu-arm: Fix memory leak in pa_cpu_get_arm_flags()
Sukesh Adiga [Tue, 17 Mar 2015 17:21:52 +0000 (22:51 +0530)]
cpu-arm: Fix memory leak in pa_cpu_get_arm_flags()

9 years agocore-util: Make number parsing stricter
Tanu Kaskinen [Wed, 25 Feb 2015 09:56:47 +0000 (11:56 +0200)]
core-util: Make number parsing stricter

pa_atou(), pa_atol() and pa_atod() are stricter than the libc
counterparts (the PA functions reject strings that have trailing extra
stuff in them). I have been under the impression that the PA functions
only accept "obviously valid numbers", that is, I have assumed that
these would be rejected: " 42" (leading whitespace), "" (empty
string) and "-18446744073709551615" in case of pa_atou().

I noticed that empty strings are accepted, however, and on closer
inspection I found that leading whitespace is accepted too, and even
that pa_atou() thinks that "-18446744073709551615" is the same thing
as "1"! This patch makes the parsing functions more strict, so that
they indeed only accept "obviously valid numbers". I decided to also
disallow leading plus signs, just because I don't like them.

9 years agocore-util: Fix set_nice() to use private bus connections
David Herrmann [Thu, 12 Mar 2015 12:42:46 +0000 (13:42 +0100)]
core-util: Fix set_nice() to use private bus connections

In src/pulsecore/core-util.c:set_nice() we currently use a temporary
dbus-connection to set the nice-level via rtkit. However, we never
close that connection. This is fine, as the connection is shared and
dbus-core will manage it. But no other part of pulseaudio (except
set_scheduler()) uses the libdbus1 managed connections. Therefore,
we effectively end up with an unused dbus-connection that is not
integrated into any main-loop. dbus-daemon will send bus-notifications
to the connection (as libdbus1 installs matches for those by default
(it has to!)) until the outgoing queue is full. Thus, we waste several
KBs (or MBs? I didn't look it up) of memory for a message queue that
is never dispatched.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agopstream: Remove unnecessary if condition
David Henningsson [Thu, 5 Mar 2015 13:55:53 +0000 (14:55 +0100)]
pstream: Remove unnecessary if condition

Without split packets, the if condition can now be removed.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoprotocol-native: Re-enable srbchannel
David Henningsson [Thu, 5 Mar 2015 13:55:52 +0000 (14:55 +0100)]
protocol-native: Re-enable srbchannel

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agopstream: Don't split (non-SHM) memblocks
David Henningsson [Thu, 5 Mar 2015 13:55:51 +0000 (14:55 +0100)]
pstream: Don't split (non-SHM) memblocks

In case SHM is full or disabled, audio data is sent through the
io/srbchannel. When this channel in turn gets full, memblocks
could previously be split up. This could lead to crashes in case
the split was on non-frame boundaries (in combination with full
memblock queues).

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88452
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agopacat: Fix comment wording
Peter Meerwald [Thu, 26 Feb 2015 19:47:58 +0000 (20:47 +0100)]
pacat: Fix comment wording

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agopacket: Use flist to save calls to malloc()/free()
Peter Meerwald [Thu, 23 Oct 2014 12:19:44 +0000 (14:19 +0200)]
packet: Use flist to save calls to malloc()/free()

a separate free-list is used to recycle memory of fixed-sized packets
with up to MAX_APPENDED_SIZE of data

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agopacket: Introduce pa_packet_new_data() to copy data into a newly created packet
Peter Meerwald [Thu, 23 Oct 2014 14:51:08 +0000 (16:51 +0200)]
packet: Introduce pa_packet_new_data() to copy data into a newly created packet

v2: (thanks Alexander Patrakov)
* turn check in pa_packet_new() into assert()

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agopacket: Make pa_packet_new() create fixed-size packets
Peter Meerwald [Thu, 23 Oct 2014 11:48:21 +0000 (13:48 +0200)]
packet: Make pa_packet_new() create fixed-size packets

if length exceeds maximum appended size, create a packet of
type dynamic instead of type appended

this is a preparation to use a separate free-list for packets

document semantics of pa_packet_new_*() functions

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agopacket: Hide internals of pa_packet, introduce pa_packet_data()
Peter Meerwald [Thu, 23 Oct 2014 09:43:04 +0000 (11:43 +0200)]
packet: Hide internals of pa_packet, introduce pa_packet_data()

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agotagstruct: Use flist to potentially save calls to malloc()/free()
Peter Meerwald [Thu, 23 Oct 2014 09:52:43 +0000 (11:52 +0200)]
tagstruct: Use flist to potentially save calls to malloc()/free()

v2: (thanks David Henningson)
* fix double assignment of data in pa_tagstruct_new_fixed(), two statements on one line

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agotagstruct: Add type _APPENDED
Peter Meerwald [Wed, 22 Oct 2014 12:59:11 +0000 (14:59 +0200)]
tagstruct: Add type _APPENDED

add 128 bytes of storage in each tagstruct that will initially
be used; if this storage is exceeded the type changes to _DYNAMIC

v3: (thanks David Henningson)
* add comments explaining how memory is handled by different tagstruct types
v2: (thanks Alexander Patrakov)
* replace constant 100 with GROW_TAG_SIZE (the increment in with a dynamic tagstruct grows when extend()ed)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agotagstruct: Get rid of pa_tagstruct_free_data()
Peter Meerwald [Thu, 23 Oct 2014 14:42:58 +0000 (16:42 +0200)]
tagstruct: Get rid of pa_tagstruct_free_data()

pa_tagstruct_free_data() is used in only one place
to pass data from a tagstruct to a packet

this patch is a temporary solution which introduces an extra
malloc(); will be resolved shortly...

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agotagstruct: Replace dynamic flag with type
Peter Meerwald [Wed, 22 Oct 2014 12:52:23 +0000 (14:52 +0200)]
tagstruct: Replace dynamic flag with type

... in order to prepare for a new type _APPENDED

remove the assert() for dynamic in pa_tagstruct_data() as
the function makes sense for all tagstruct types (and the returned pointer
is const)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agotagstruct: Distinguish pa_tagstruct_new() use cases
Peter Meerwald [Thu, 23 Oct 2014 14:09:45 +0000 (16:09 +0200)]
tagstruct: Distinguish pa_tagstruct_new() use cases

pa_tagstruct_new() is called either with no data, i.e. (NULL, 0)
to create a dynamic tagstruct or with a pointer to fixed data

introduce a new function pa_tagstruct_new_fixed() for the latter case

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agoecho-cancel: fix the obviously-wrong "buffer+=buffer" logic
Alexander E. Patrakov [Sun, 22 Feb 2015 11:39:14 +0000 (16:39 +0500)]
echo-cancel: fix the obviously-wrong "buffer+=buffer" logic

Same bug as in module-loopback, pointed out by Georg Chini in a private
email.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>