platform/upstream/pulseaudio.git
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>
9 years agosocket-server: add tcp support for systemd socket activation
Jaska Uimonen [Thu, 6 Nov 2014 13:52:02 +0000 (15:52 +0200)]
socket-server: add tcp support for systemd socket activation

9 years agoalsa: Don't access pa_sink/source_new_data after done() has been called
Tanu Kaskinen [Wed, 4 Feb 2015 21:50:24 +0000 (23:50 +0200)]
alsa: Don't access pa_sink/source_new_data after done() has been called

This change doesn't affect behaviour, because accessing boolean fields
in the new data was safe even after the done() call, but it was still
bad style.

9 years agoi18n: Updated Turkish translation
Muhammet Kara [Sun, 22 Feb 2015 11:17:14 +0000 (13:17 +0200)]
i18n: Updated Turkish translation

9 years agoalsa: Fix spelling of officially
Peter Meerwald [Thu, 19 Feb 2015 13:23:16 +0000 (14:23 +0100)]
alsa: Fix spelling of officially

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agotagstruct: Refactor writing/reading basic types
Tanu Kaskinen [Tue, 17 Feb 2015 19:40:13 +0000 (21:40 +0200)]
tagstruct: Refactor writing/reading basic types

While adding functions for writing and reading pa_bvolume structs, I
found myself wondering if I could make it simpler to write and read
the basic types that a pa_bvolume consists of, without having to worry
about network byte ordering, remembering to call extend() and getting
the length and read index adjustments just right. This is what I came
up with.

There is a functional change too: previously the
pa_tagstruct_get_foo() functions didn't modify the read index in case
of errors, but now, due to read_tag() modifying the read index at an
early stage, the read index gets modified also in case of errors. I
have checked the call sites, and I believe there's no code that would
rely on the "no read index modification on error" property of the old
functions. If reading anything from a tagstruct fails, the whole
tagstruct is considered invalid (typically resulting in a protocol
error and client connection teardown).

9 years agomodule-loopback: don't use 0 for custom source output message id
Alexander E. Patrakov [Wed, 11 Feb 2015 16:50:47 +0000 (21:50 +0500)]
module-loopback: don't use 0 for custom source output message id

Message id 0 is PA_SOURCE_OUTPUT_MESSAGE_GET_LATENCY. So, every time PulseAudio
sent PA_SOURCE_OUTPUT_MESSAGE_GET_LATENCY message to the loopback source output,
it actually hit the SOURCE_OUTPUT_MESSAGE_LATENCY_SNAPSHOT handler instead. As a
result, the SOURCE_OUTPUT_MESSAGE_LATENCY_SNAPSHOT handler was called when not
intended, the default PA_SOURCE_OUTPUT_MESSAGE_GET_LATENCY handler was not called
at all, and the latency was thus evaluated incorrectly.

Reported-by: Georg Chini <georg@chini.tk>
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
9 years agoalsa-util: Make two of the warnings "debug" instead of "error"
David Henningsson [Mon, 16 Feb 2015 09:41:54 +0000 (10:41 +0100)]
alsa-util: Make two of the warnings "debug" instead of "error"

...because we will later try with plug:* which will probably succeed,
so this is not an error.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoalsa-util: No logging when sound card only supports non-interleaved sample format
Peter Meerwald [Sat, 15 Nov 2014 12:33:19 +0000 (13:33 +0100)]
alsa-util: No logging when sound card only supports non-interleaved sample format

as suggested by
https://bugs.freedesktop.org/show_bug.cgi?id=84804

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agoAdded documentation for soxr resampling methods.
Andrey Semashev [Wed, 14 Jan 2015 19:22:04 +0000 (22:22 +0300)]
Added documentation for soxr resampling methods.

9 years agoAdded libsoxr detection and optional build of soxr resampler backend.
Andrey Semashev [Wed, 14 Jan 2015 19:22:03 +0000 (22:22 +0300)]
Added libsoxr detection and optional build of soxr resampler backend.

9 years agoEnabled libsoxr resampler backend.
Andrey Semashev [Wed, 14 Jan 2015 19:22:02 +0000 (22:22 +0300)]
Enabled libsoxr resampler backend.

Added ID and names for the resampler presets and also updated the working sample rate deduction to take the new resampler into account. The initial libsoxr backend version does not variable rate resampling, so it is disabled in this case.

9 years agoAdded libsoxr resampler backend.
Andrey Semashev [Wed, 14 Jan 2015 19:22:01 +0000 (22:22 +0300)]
Added libsoxr resampler backend.

The new backend supports 3 quality levels: mq, hq and vhq; 16-bit integer and 32-bit float samples. Discussion and quality assessment are here:

http://comments.gmane.org/gmane.comp.audio.pulseaudio.general/22158

9 years agopacat: State purpose of program depending how it was invoked
Peter Meerwald [Mon, 17 Nov 2014 10:34:59 +0000 (11:34 +0100)]
pacat: State purpose of program depending how it was invoked

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

state purpose of paplay/parec/pamon/parecord/pacat when invoked with -h

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agoman: Install man page symlinks to pacat for paplay, parec, parecord, pamon
Peter Meerwald [Mon, 17 Nov 2014 10:02:25 +0000 (11:02 +0100)]
man: Install man page symlinks to pacat for paplay, parec, parecord, pamon

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

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agoman: Drop separate paplay man page, move info to pacat man page
Peter Meerwald [Mon, 17 Nov 2014 09:44:31 +0000 (10:44 +0100)]
man: Drop separate paplay man page, move info to pacat man page

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

pacat and paplay man pages both claim to describe the paplay program
(which is actually a symlink to pacat) -- this is inconsistent and
redundant, so drop the paplay man page

a follow-up patch will add man page symlink for all programs
implemented by pacat, not just paplay

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agoman: Describe optional prefix {string} in server address
Peter Meerwald [Sat, 15 Nov 2014 15:06:22 +0000 (16:06 +0100)]
man: Describe optional prefix {string} in server address

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

v2: (thanks Tanu Kaskinen)
* fix wording wrt machine id

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agocontext: pa_context_connect() with PA_CONTEXT_NOFAIL should return 0 when waiting...
Peter Meerwald [Sat, 15 Nov 2014 14:24:22 +0000 (15:24 +0100)]
context: pa_context_connect() with PA_CONTEXT_NOFAIL should return 0 when waiting for PA on D-Dus

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

in case NOAUTOSPAWN is set and no server has been specified, PA starts listening on DBUS
for a new server, and the state is PA_CONTEXT_CONNECTING, but pa_context_connect()
returns -1; it should return 0.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
9 years agodynarray: Add PA_DYNARRAY_FOREACH
Tanu Kaskinen [Wed, 7 Jan 2015 14:56:50 +0000 (16:56 +0200)]
dynarray: Add PA_DYNARRAY_FOREACH

The PA_DYNARRAY_FOREACH macro requires that pa_dynarray_get() returns
NULL if the index is out of bounds.

9 years agodynarray: Add pa_dynarray_remove_by_data()
Tanu Kaskinen [Wed, 7 Jan 2015 14:56:49 +0000 (16:56 +0200)]
dynarray: Add pa_dynarray_remove_by_data()

9 years agodynarray: Add pa_dynarray_remove_by_index()
Tanu Kaskinen [Wed, 7 Jan 2015 14:56:48 +0000 (16:56 +0200)]
dynarray: Add pa_dynarray_remove_by_index()

Also, remove the talk about "fast" variants of functions that remove
entries from an array. Currently there's no need for order-preserving
functions, so all functions are "fast".

9 years agodynarray: Add pa_dynarray_last()
Tanu Kaskinen [Wed, 7 Jan 2015 14:56:47 +0000 (16:56 +0200)]
dynarray: Add pa_dynarray_last()

9 years agoMake pa_socket_server_new static
Alexander E. Patrakov [Wed, 31 Dec 2014 07:28:03 +0000 (12:28 +0500)]
Make pa_socket_server_new static

While at it, also remove SOCKET_SERVER_GENERIC, because it is always
being overwritten with a specific socket type.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
9 years agosocket-server: pa_socket_server_new() can't fail, so don't check its return value
Tanu Kaskinen [Mon, 3 Nov 2014 09:47:58 +0000 (11:47 +0200)]
socket-server: pa_socket_server_new() can't fail, so don't check its return value

An assertion was already used in pa_socket_server_new_unix(), this
makes the TCP variants consistent with that.

Even if pa_socket_server_new() could fail, the error handling wasn't
good, because there was no "goto fail", meaning that the fd would have
been leaked.

9 years agoUpdate NEWS file v6.0
David Henningsson [Thu, 12 Feb 2015 14:09:38 +0000 (15:09 +0100)]
Update NEWS file

Some more contributors during the RC cycle.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoalsa: Don't try to use ELD controls with UCM
Tanu Kaskinen [Fri, 6 Feb 2015 22:15:34 +0000 (00:15 +0200)]
alsa: Don't try to use ELD controls with UCM

This fixes a crash that occurred when trying to access non-existent
port data. Doing this:

    pa_alsa_port_data *data = PA_DEVICE_PORT_DATA(port);

is not a good idea when using UCM, because in the UCM mode ports don't
have any data, so the data pointer points to some random memory.

9 years agoshell-completion: bash: Fix pactl list source-outputs
Arun Raghavan [Tue, 3 Feb 2015 06:02:57 +0000 (11:32 +0530)]
shell-completion: bash: Fix pactl list source-outputs

9 years agoloopback: Don't push zero-sized block to memblockq
Georg Chini [Sat, 31 Jan 2015 21:05:27 +0000 (22:05 +0100)]
loopback: Don't push zero-sized block to memblockq

During my work on module-loopback I found a bug that sometimes crashes pulse when
module-loopback is loaded due to pushing a zero-length block into the memblockq.
As there is a one-line fix I thought you might want it for 6.0.

9 years agobuild-sys: libwebrtc-util needs libpulsecore
Arun Raghavan [Sat, 31 Jan 2015 05:04:48 +0000 (10:34 +0530)]
build-sys: libwebrtc-util needs libpulsecore

9 years agoalsa-mixer: Make speaker unavailable when Line Out is plugged in
David Henningsson [Thu, 29 Jan 2015 15:24:35 +0000 (10:24 -0500)]
alsa-mixer: Make speaker unavailable when Line Out is plugged in

ALSA mutes speaker when Line Out is plugged in by default, so
we should follow that convention.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoalsa-mixer: Add lineout to surround21 mappings
Tanu Kaskinen [Thu, 29 Jan 2015 11:53:08 +0000 (13:53 +0200)]
alsa-mixer: Add lineout to surround21 mappings

This makes the analog-surround-21 mapping consistent with other
surround mappings. I'm not sure if this makes any practical
difference, though.

9 years agomodule-device-restore: Fix memory leak in read_sink_format_reply
David Henningsson [Wed, 28 Jan 2015 20:10:55 +0000 (15:10 -0500)]
module-device-restore: Fix memory leak in read_sink_format_reply

This function could sometimes leak a perportentry.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoprotocol-native: Disable srbchannel by default v5.99.3
David Henningsson [Wed, 21 Jan 2015 14:06:53 +0000 (15:06 +0100)]
protocol-native: Disable srbchannel by default

Recent testing has shown some srbchannel related bugs that
indicates that the srbchannel feature is not ready to be enabled
by default.

Therefore, temporary disable it for the 6.0 release and re-enable
it in git master once 6.0 is released.

Bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=88452
https://bugs.freedesktop.org/show_bug.cgi?id=88167

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoupdate FSF addresses to FSF web page
Ondrej Holecek [Wed, 26 Nov 2014 13:14:51 +0000 (14:14 +0100)]
update FSF addresses to FSF web page

FSF addresses used in PA sources are no longer valid and rpmlint
generates numerous warnings during packaging because of this.
This patch changes all FSF addresses to FSF web page according to
the GPL how-to: https://www.gnu.org/licenses/gpl-howto.en.html

Done automatically by sed-ing through sources.

9 years agoi18n: Fix up the Turkish translation
Tanu Kaskinen [Tue, 13 Jan 2015 20:36:17 +0000 (22:36 +0200)]
i18n: Fix up the Turkish translation

The translation was not added to LINGUAS and there was this error from
msgfmt:

tr.po:2801: 'msgid' and 'msgstr' entries do not both begin with '\n'

9 years agoi18n: Add Turkish translation
kozdincer [Mon, 12 Jan 2015 14:17:11 +0000 (16:17 +0200)]
i18n: Add Turkish translation

9 years agoalsa-mixer: Mute headphones and speakers on line out path
David Henningsson [Tue, 13 Jan 2015 10:28:16 +0000 (11:28 +0100)]
alsa-mixer: Mute headphones and speakers on line out path

When line out path is active, we want to mute speakers for obvious
reasons, and headphones to avoid volume spikes.

Reported-by: TienFu Chen <tienfu.chen@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agopacmd: add missing 'else' keyword
Boris Egorov [Mon, 12 Jan 2015 17:52:12 +0000 (23:52 +0600)]
pacmd: add missing 'else' keyword

See code above for proper behavior.

Issue detected by PVS Studio

9 years agotunnel: use proper value for pa_source_state switch
Boris Egorov [Mon, 12 Jan 2015 17:52:11 +0000 (23:52 +0600)]
tunnel: use proper value for pa_source_state switch

pa_source_state_t can have value PA_SOURCE_INVALID_STATE, not
PA_SINK_INVALID_STATE. It happens to be the same here, but it can break
sometimes.

Issue detected by PVS Studio.

9 years agoalsa-util: fix parenthesis position in err assignment
Boris Egorov [Mon, 12 Jan 2015 17:52:10 +0000 (23:52 +0600)]
alsa-util: fix parenthesis position in err assignment

Issue detected by CppCheck and PVS Studio

9 years agosvolume.orc: avoid parameter loading undefined behaviour
Wim Taymans [Wed, 7 Jan 2015 10:20:01 +0000 (11:20 +0100)]
svolume.orc: avoid parameter loading undefined behaviour

In some cases, depending on the instruction that performs the load, orc
ignores the size of the parameter when loading it for the first time.
Explicitly load the parameter into a temp to make sure it is loaded
correctly, like we do for the 2ch case.

See https://bugzilla.gnome.org/show_bug.cgi?id=742271

9 years agomemblock: Fix more block ID collisions
David Henningsson [Thu, 8 Jan 2015 12:11:17 +0000 (13:11 +0100)]
memblock: Fix more block ID collisions

Since the srb memblock and the audio data were coming from separate
pools, and the base index was per pool, they could actually still
collide.

This patch changes the base index to be global and atomically
incremented.

Reported-by: Arun Raghavan <arun@accosted.net>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agopactl: fix getopt indexing for set-*-volume
Felipe Sateler [Thu, 8 Jan 2015 00:01:14 +0000 (21:01 -0300)]
pactl: fix getopt indexing for set-*-volume

When pactl is invoked with any options or the -- specifier, optind will
be > 1. Therefore using a static 3 value is wrong. Use optind+2 as both
offset and count difference.

Bug-Debian: http://bugs.debian.org/774810

9 years agobuild-sys: Don't enable libsamplerate by default
Tanu Kaskinen [Mon, 5 Jan 2015 13:44:15 +0000 (15:44 +0200)]
build-sys: Don't enable libsamplerate by default

The libsamplerate based resamplers have been deprecated, so it's best
to not build them by default.

9 years agotunnel-sink-new: Fix stale audio on resume
Tanu Kaskinen [Mon, 29 Dec 2014 22:33:05 +0000 (00:33 +0200)]
tunnel-sink-new: Fix stale audio on resume

I noticed that when resuming the tunnel sink, there was a small amount
of previously played audio before the new audio started to play.
Normally that probably wouldn't be noticeable, because there would be
a few seconds of silence played before suspending the sink due to
inactivity, so the unwanted old audio would be just silence, but in my
configuration sinks are suspended immediately when there's nothing
playing to them, so the glitch becomes audible.

9 years agoi18n: Update the Swedish translation
Josef Andersson [Mon, 29 Dec 2014 14:01:26 +0000 (16:01 +0200)]
i18n: Update the Swedish translation

9 years agoFix the WhatIsWrongWithSystemWide URL
Alexander E. Patrakov [Sat, 29 Nov 2014 16:09:30 +0000 (21:09 +0500)]
Fix the WhatIsWrongWithSystemWide URL

Pavel Machek reported in his blog that our message about the system mode
has a dead link in it. And this link is also present in translations.
So, I replaced it in the source and fixed all translations using a script:

for a in po/*.po ; do msgcat --no-wrap $a | sed
's@http://pulseaudio.org/wiki/WhatIsWrongWithSystemMod
@http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode @g' | sed
's@http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode@http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/@g'
| sed 's@/\.@/ .@g' | sed 's@/,@/ ,@g' | msgcat - > $a.new

git add -i  # to filter out formatting changes

The "/." and "/," replacements are needed so that various terminal
emulators don't include the trailing "." or "," into the clickable URL.

The resulting patch is attached, just in case, in order to avoid
damaging non-ASCII characters.

--
Alexander E. Patrakov

>From 7dcd197571840e467d688f0f7354253730bbcc15 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sat, 29 Nov 2014 20:56:27 +0500
Subject: [PATCH] Fix the WhatIsWrongWithSystemWide URL

Reported by Pavel Machek in http://pavelmachek.livejournal.com/126190.html

All translations were also fixed using a script.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
9 years agoFix URLs still pointing to the old wiki
Alexander E. Patrakov [Sat, 29 Nov 2014 16:49:11 +0000 (21:49 +0500)]
Fix URLs still pointing to the old wiki

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
9 years agoRevert "launch: Disable autospawn by default when systemd daemon support is enabled." v5.99.2
David Henningsson [Fri, 19 Dec 2014 12:46:11 +0000 (13:46 +0100)]
Revert "launch: Disable autospawn by default when systemd daemon support is enabled."

This reverts commit 7276faca72e9696d4891daff139aee52509f43bf.

Using the new systemd socket activation for PulseAudio will cause PulseAudio to not
have any connection with D-Bus, breaking device reservation protocol, module-jackdbus-detect
and module-dbus-protocol. Therefore, autospawn is now still enabled by default even if you
build with systemd daemon headers.

9 years agocard-restore: Fix profile restoring with bluetooth
Tanu Kaskinen [Tue, 16 Dec 2014 11:14:41 +0000 (13:14 +0200)]
card-restore: Fix profile restoring with bluetooth

The bluetooth card is created when the first profile becomes
available, which means that the card may have profiles that are not
available when the card is initialized. If module-card-restore tries
to restore such profile, that will fail, and the card will be
initialized with the "off" profile active.

This patch modifies module-card-restore so that if follows the profile
availability status, and when the saved profile becomes available, it
is activated. Additionally, module-card-restore is modified so that it
doesn't even try to restore unavailable profiles, when the necessary
information is available. In practice there are two existing places
where the profile is restored, and only one of those contexts has the
necessary information available. Unfortunately, it's the more
important context (card creation) where the information is not
available. This means that module-card-restore will set the initial
profile of a new card even if the profile is unavailable, and this
will cause an ugly warning in the log, even though there's nothing
abnormal happening.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=87081
9 years agobluez5: Do not suspend on no -> unknown profile transitions
David Henningsson [Fri, 19 Dec 2014 09:24:47 +0000 (10:24 +0100)]
bluez5: Do not suspend on no -> unknown profile transitions

In case a transport is currently disconnected and transitions to
idle, that should not count as a "remote hang up" event.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agointrospect: Minor documentation fix
Arun Raghavan [Tue, 4 Nov 2014 08:46:06 +0000 (14:16 +0530)]
introspect: Minor documentation fix

9 years agomemblock: Initialize mempool object to zero
David Henningsson [Tue, 9 Dec 2014 21:58:36 +0000 (22:58 +0100)]
memblock: Initialize mempool object to zero

This fixes a "use of uninitialised value" error in previous memblock commit.

Reported-by: Alexander Patrakov <patrakov@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agosrbchannel: Check return value of pa_memblock_new_pool
David Henningsson [Thu, 4 Dec 2014 21:06:30 +0000 (22:06 +0100)]
srbchannel: Check return value of pa_memblock_new_pool

In case PA_MEMPOOL_DISABLE is set, pa_memblock_new_pool can return
NULL. It does not make sense to set up a srbchannel without a shared
memory pool, so just fail in this case.

Reported-by: Alexander Patrakov <patrakov@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoi18n: Add French translation for "Speaker"
Tanu Kaskinen [Mon, 8 Dec 2014 13:04:40 +0000 (15:04 +0200)]
i18n: Add French translation for "Speaker"

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=87073
9 years agoWarn on loading module-dbus-protocol
Alexander E. Patrakov [Thu, 4 Dec 2014 15:34:09 +0000 (20:34 +0500)]
Warn on loading module-dbus-protocol

See also
https://www.mail-archive.com/ubuntu-audio-dev@lists.launchpad.net/msg00268.html

The warning may be useful for users who carried over the module-loading
statement from default configuration files shipped with old PulseAudio
versions.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
9 years agomodule-equalizer-sink: remove erroneous fixme
Jason Newton [Fri, 5 Dec 2014 08:38:31 +0000 (08:38 +0000)]
module-equalizer-sink: remove erroneous fixme

pa_memblockq_drop is guaranteed to drop the chunk we just extracted from the
memblockq which internally unrefs the chunk.

9 years agomodule-equalizer-sink: use fftwf_free in all the right places
Jason Newton [Fri, 5 Dec 2014 08:38:30 +0000 (08:38 +0000)]
module-equalizer-sink: use fftwf_free in all the right places

Several mallocs were made using fftwf_malloc and were erroneously freed by
pa_xfree. This patch corrects these calls of pa_xfree to fftwf_free.

9 years agoWarn on loading module-equalizer-sink
Alexander E. Patrakov [Thu, 4 Dec 2014 15:34:08 +0000 (20:34 +0500)]
Warn on loading module-equalizer-sink

See objections to the code in this email:

http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-March/020174.html
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
9 years agomemblock: Avoid block ID collisions when exporting memory blocks
David Henningsson [Fri, 5 Dec 2014 10:54:39 +0000 (11:54 +0100)]
memblock: Avoid block ID collisions when exporting memory blocks

Every new memexport object now gets an ever increasing base index,
that prevents block ID collisions between different memexport
objects on the same pstream.

In particular, this prevents block ID collision between the srb memblock
(which has its own memexport object) and audio data blocks.

Reported-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agomodule: Fix unsafe iteration
Tanu Kaskinen [Fri, 5 Dec 2014 13:51:35 +0000 (15:51 +0200)]
module: Fix unsafe iteration

This fixes an issue when requesting module unload for
module-bluetooth-discover. When unloading the module, it also unloads
module-bluez4-discover and/or module-bluez5-discover, and that
invalidated the state variable that was used for iterating through the
modules idxset.

The pa_module.unload_requested flag could now otherwise be removed,
but it's still being (ab)used in the bluetooth modules.

9 years agocore-util: Fix build on mingw32
David Henningsson [Wed, 3 Dec 2014 11:46:28 +0000 (12:46 +0100)]
core-util: Fix build on mingw32

mingw32 does not have "getuid", so ifdef it properly.

Reported-by: Michael DePaulo <mikedep333@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agobluez5: Fix free order of adapters and devices
David Henningsson [Fri, 28 Nov 2014 12:43:07 +0000 (13:43 +0100)]
bluez5: Fix free order of adapters and devices

Because the adapters reference the devices hashmap on free, we mush
free the adapters hashmap first and then the devices hashmap.

Reported-by: Alexander Patrakov <patrakov@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agobuild-sys: Don't build srbchannel-test on targets without srbchannel
David Henningsson [Tue, 2 Dec 2014 08:22:47 +0000 (09:22 +0100)]
build-sys: Don't build srbchannel-test on targets without srbchannel

Reported-by: Felipe Sateler <fsateler@debian.org>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
9 years agoFix #defines for Debian GNU/kFreeBSD
Felipe Sateler [Sat, 29 Nov 2014 19:54:57 +0000 (16:54 -0300)]
Fix #defines for Debian GNU/kFreeBSD

Because debian does not run with the freebsd libc, but rather uses the
GNU one, it chose to not define __FreeBSD__, but rather __FreeBSD_kernel__.
Use the alternative when the functionality tested is for kernel
features, and keep the __FreeBSD__ one when using freebsd libc
headers.

If this patch is applied, debian could drop all the current patches when
importing 6.0 :)

9 years agoUpdate Ukrainian translation
Yuri Chornoivan [Tue, 25 Nov 2014 08:48:22 +0000 (10:48 +0200)]
Update Ukrainian translation

9 years agoUpdated Polish translation
Piotr Drąg [Sat, 22 Nov 2014 19:14:41 +0000 (20:14 +0100)]
Updated Polish translation

9 years agobuild-sys: Fix the BlueZ 5 native headset backend check
Tanu Kaskinen [Sun, 23 Nov 2014 13:23:39 +0000 (15:23 +0200)]
build-sys: Fix the BlueZ 5 native headset backend check

If the libbluetooth headers aren't available, we shouldn't treat that
as an error unless --enable-bluez5-native-headset has been explicitly
given to configure.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=86582
9 years agobuild-sys: Always define bluetooth related HAVE_* variables
Tanu Kaskinen [Sun, 23 Nov 2014 13:23:38 +0000 (15:23 +0200)]
build-sys: Always define bluetooth related HAVE_* variables

I don't know if it can cause any problems if HAVE_BLUEZ_4,
HAVE_BLUEZ_5, HAVE_BLUEZ, HAVE_BLUEZ_5_OFONO_HEADSET or
HAVE_BLUEZ_5_NATIVE_HEADSET are undefined when the corresponding
features are not enabled, but it certainly won't hurt to define the
variables also when the features are not enabled.

9 years agoNEWS: Zsh completion support isn't new in 6.0
Tanu Kaskinen [Sun, 23 Nov 2014 13:33:02 +0000 (15:33 +0200)]
NEWS: Zsh completion support isn't new in 6.0

There have been several fixes to the Zsh completion during the current
development cycle, but the completion was initially implemented
already in 4.0.