platform/upstream/pulseaudio.git
10 years agobuild-sys: Add -fdiagnostics-color=auto to CFLAGS
Javier Jardón [Sat, 26 Oct 2013 22:26:13 +0000 (23:26 +0100)]
build-sys: Add -fdiagnostics-color=auto to CFLAGS

As a way to highlight warnings and errors in GCC output
This will be available in GCC 4.9, but some distros backported
the feature to lower versions

http://gcc.gnu.org/gcc-4.9/changes.html

10 years agobuild-sys: Use AM_CPPFLAGS instead of AM_CFLAGS for preprocessor arguments
Javier Jardón [Sat, 26 Oct 2013 22:26:12 +0000 (23:26 +0100)]
build-sys: Use AM_CPPFLAGS instead of AM_CFLAGS for preprocessor arguments

As the automake documentation says:

AM_CPPFLAGS: The contents of this variable are passed to every compilation
    that invokes the C preprocessor; it is a list of arguments to the preprocessor.
    For instance, -I and -D options should be listed here

AM_CFLAGS: This is the variable the Makefile.am author can use to pass in
    additional C compiler flags.

http://www.gnu.org/software/automake/manual/html_node/Program-Variables.html

10 years agoUpdate Ukrainian translation
Yuri Chornoivan [Mon, 23 Jun 2014 18:29:23 +0000 (21:29 +0300)]
Update Ukrainian translation

10 years agobluetooth: Refactor POLLHUP handling
Tanu Kaskinen [Sun, 1 Jun 2014 11:55:02 +0000 (14:55 +0300)]
bluetooth: Refactor POLLHUP handling

The code in the "io_fail" section was only used for HUP handling, but
there were jumps to there also from places where reading or writing
failed, because the read/write failure could have been caused by HUP.
This patch simplifies things by checking for HUP condition before
trying to read or write. Now if reading or writing fails, we will
jump to "fail" directly instead of going via the "io_fail" label. As
a result, the "io_fail" label isn't needed any more.

10 years agoauthkey: Use the config home dir for relative paths
Tanu Kaskinen [Sun, 8 Jun 2014 13:33:01 +0000 (16:33 +0300)]
authkey: Use the config home dir for relative paths

Previously relative cookie paths were searched from the home
directory, now they are searched from the config home directory. This
fixes the problem that XDG_CONFIG_HOME didn't have effect on cookie
paths.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=75006
10 years agocore-util: Add pa_append_to_config_home_dir()
Tanu Kaskinen [Sun, 8 Jun 2014 13:33:00 +0000 (16:33 +0300)]
core-util: Add pa_append_to_config_home_dir()

10 years agocore-util: Add pa_get_config_home_dir()
Tanu Kaskinen [Sun, 8 Jun 2014 13:32:59 +0000 (16:32 +0300)]
core-util: Add pa_get_config_home_dir()

10 years agoesound, native: Pass an absolute path to pa_authkey_load() when using a file in the...
Tanu Kaskinen [Sun, 8 Jun 2014 13:32:58 +0000 (16:32 +0300)]
esound, native: Pass an absolute path to pa_authkey_load() when using a file in the home directory

If a relative path is passed to pa_authkey_load(), it will interpret
the path as relative to the home directory. This is wrong, because
relative paths should be interpreted to be relative to the config home
directory. Before fixing pa_authkey_load(), this patch prepares for
the change by using absolute paths when the file actually needs to be
in the home directory (i.e. the fallback cookie path for the native
protocol and the default cookie path for the esound protocol).

10 years agocore-util: Add pa_append_to_home_dir()
Tanu Kaskinen [Sun, 8 Jun 2014 13:32:57 +0000 (16:32 +0300)]
core-util: Add pa_append_to_home_dir()

10 years agoauthkey: Rename pa_authkey_load_auto() to pa_authkey_load()
Tanu Kaskinen [Sun, 8 Jun 2014 13:32:56 +0000 (16:32 +0300)]
authkey: Rename pa_authkey_load_auto() to pa_authkey_load()

pa_authkey_load() was removed earlier, so the _auto suffix isn't
necessary any more.

10 years agoauthkey: Remove pa_authkey_load(), it's redundant
Tanu Kaskinen [Sun, 8 Jun 2014 13:32:55 +0000 (16:32 +0300)]
authkey: Remove pa_authkey_load(), it's redundant

The only place where pa_authkey_load() was called was in
pa_authkey_load_auto(), and the only functionality that
pa_authkey_load() was to log a warning if load() fails. That log
message is now in pa_authkey_load_auto(), so pa_authkey_load() has no
use any more.

10 years agoclient-conf: Move x11 and env loading to pa_client_conf_load()
Tanu Kaskinen [Sun, 8 Jun 2014 13:32:54 +0000 (16:32 +0300)]
client-conf: Move x11 and env loading to pa_client_conf_load()

This simplifies the code a bit.

10 years agoclient-conf: Don't report failure from pa_client_conf_load()
Tanu Kaskinen [Sun, 8 Jun 2014 13:32:53 +0000 (16:32 +0300)]
client-conf: Don't report failure from pa_client_conf_load()

pa_context already ignored the return value of pa_client_conf_load(),
so the only places where the return value was not ignored were the
D-Bus server lookup thing and pax11publish. I don't think those cases
are negatively affected if they ignore errors in opening or parsing
client.conf.

pa_client_conf_env() never failed anyway, so returning int was
obviously redundant.

10 years agocombine-sink: Rearrange block_usec initialization
Tanu Kaskinen [Tue, 17 Jun 2014 11:13:21 +0000 (14:13 +0300)]
combine-sink: Rearrange block_usec initialization

block_usec should be determined by the sink max latency, not the other
way around. This change doesn't cause any change in behaviour, but
makes the code more logical. Further updates to block_usec are already
done correctly, so this is the only place that needs modification.

10 years agocombine-sink: Fix the initial requested latency of new outputs
Tanu Kaskinen [Tue, 17 Jun 2014 11:04:43 +0000 (14:04 +0300)]
combine-sink: Fix the initial requested latency of new outputs

If the combine-sink is running with low latency, and a new output is
added, the new output was not configured with low latency.

10 years agocombine-sink: Add a convenience variable
Tanu Kaskinen [Tue, 17 Jun 2014 11:01:15 +0000 (14:01 +0300)]
combine-sink: Add a convenience variable

10 years agocombine-sink: Make the latency range calculation easier to read
Tanu Kaskinen [Tue, 17 Jun 2014 09:17:58 +0000 (12:17 +0300)]
combine-sink: Make the latency range calculation easier to read

I think this is much easier to understand. This should not result in
any functional change.

10 years agocombine-sink: add support for DYNAMIC_LATENCY
Wim Taymans [Tue, 10 Jun 2014 19:38:28 +0000 (21:38 +0200)]
combine-sink: add support for DYNAMIC_LATENCY

Mark the sink as DYNAMIC_LATENCY and implement update_sink_latency_range
on its sink-input to collect the combined latency range of all sinks.

Implement update_requested_latency on the sink to configure the final
latency by combining the sink-input requested latencies. This makes us
honour the client latency request.

Also add more debug log.

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

10 years agomodule-rescue-streams: Fixup previous patch w r t fallback sink/sources
David Henningsson [Tue, 10 Jun 2014 06:30:05 +0000 (08:30 +0200)]
module-rescue-streams: Fixup previous patch w r t fallback sink/sources

 - Make sure "no evacuation sink/source found" is not printed when
   fallback source/sink is selected
 - Restore previous behaviour of fallback sink/source selected
   (first one instead of last one)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agorescue-streams: try to find best one using availability and priority
Hui Wang [Thu, 5 Jun 2014 09:27:51 +0000 (17:27 +0800)]
rescue-streams: try to find best one using availability and priority

Recently met a problem: when I disconnect the bluetooth headset, the
pulseaudio automatically switch the sound to sink of HDMI output
instead of the sink of internal speaker even though there is no HDMI
cable connected.

To fix this problem, I want to change the rule of selecting the target
sink if the default sink is not available. (same rules apply to the
source selecting):
construct a new hashmap with all ports (of all relevant sinks) and
then call find_best on the new hashmap to find the best port, finally
find the corresponding sink using the best port.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
10 years agodaemon: get rid of win32 message timer
Pierre Ossman [Fri, 20 Sep 2013 08:28:20 +0000 (10:28 +0200)]
daemon: get rid of win32 message timer

We don't need a timer to check for Windows messages anymore
now that our fancy new poll() implementation does that for us.

10 years agopoll: don't let select() block on Windows
Pierre Ossman [Mon, 23 Sep 2013 12:56:38 +0000 (14:56 +0200)]
poll: don't let select() block on Windows

We cannot let select() block as we won't wake up on the other
things that MsgWaitForMultipleObjects() can monitor.

10 years agopoll: don't use shared event in Windows pa_poll()
Pierre Ossman [Mon, 23 Sep 2013 12:53:02 +0000 (14:53 +0200)]
poll: don't use shared event in Windows pa_poll()

We call pa_poll concurrently from multiple threads, so we cannot
have an event object that is reused.

10 years agomainloop: avoid race-y double wakeup status
Pierre Ossman [Fri, 20 Sep 2013 08:26:30 +0000 (10:26 +0200)]
mainloop: avoid race-y double wakeup status

Having an extra variable that tracks the wakeup status introduces a
race where the variable is set but the data has yet to propagate from
the write end of the pipe to the read end. When this happens the
system goes into a tight loop as select() always returns immediately.

10 years agobuild-sys: don't build raop modules on win32 as they need librtp
Pierre Ossman [Fri, 20 Sep 2013 08:02:53 +0000 (10:02 +0200)]
build-sys: don't build raop modules on win32 as they need librtp

librtp is very posix-y and cannot currently be built for Windows.
So avoid trying to build any modules that depend on it.

10 years agobluetooth: Refactor device validity management
Tanu Kaskinen [Sat, 24 May 2014 09:56:35 +0000 (12:56 +0300)]
bluetooth: Refactor device validity management

There are several intertwined changes that I couldn't separate into
nicer commits. This is mostly just refactoring, but this also fixes
a bug: the old code set the device valid in parse_device_properties()
even if the device's adapter was invalid (had NULL address).

To improve the clarity of the code, I split the device_info_valid
variable into two booleans: properties_received and valid.

I added function device_update_valid() that checks all conditions that
affect the device validity. The function can then be called from any
place where something changes that potentially affects the device
validity. However, currently the only validity-affecting thing that
can change is the device adapter, so device_update_valid() is only
called from set_device_adapter().

I added the aforementioned set_device_adapter() function so that
whenever the adapter is set, the device validity gets updated
automatically.

The new properties_received variable allowed me to remove the
is_property_update function parameters.

10 years agobluetooth: Add "valid" flag to pa_bluetooth_adapter
Tanu Kaskinen [Sat, 24 May 2014 09:56:34 +0000 (12:56 +0300)]
bluetooth: Add "valid" flag to pa_bluetooth_adapter

This is a cosmetic change. There are a couple of places where we check
whether the adapter object is valid, and while checking whether the
address property is set works just fine, I find it nicer to have a
dedicated flag for the object validity. This improves maintainability
too, because if there will ever be more adapter properties that affect
the adapter validity, the places that check if the adapter is valid
don't need to be updated.

10 years agortp-recv: fix crash on empty UDP packets (CVE-2014-3970)
Alexander E. Patrakov [Thu, 5 Jun 2014 16:29:25 +0000 (22:29 +0600)]
rtp-recv: fix crash on empty UDP packets (CVE-2014-3970)

On FIONREAD returning 0 bytes, we cannot return success, as the caller
(rtpoll_work_cb in module-rtp-recv.c) would then try to
pa_memblock_unref(chunk.memblock) and, because memblock is NULL, trigger
an assertion.

Also we have to read out the possible empty packet from the socket, so
that the kernel doesn't tell us again and again about it.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
10 years agosource, sink: Support weird sample rates
Alexander E. Patrakov [Mon, 2 Jun 2014 16:45:31 +0000 (22:45 +0600)]
source, sink: Support weird sample rates

This fixes assertion failures that manifest themselves with cards that
support only weird rates such as 37286Hz. Tested with snd-pcsp.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=48109
10 years agocombine-sink: rework output add/remove
Wim Taymans [Tue, 27 May 2014 19:37:02 +0000 (21:37 +0200)]
combine-sink: rework output add/remove

Add the output from its sink-input attached callback and remove it
again from the detach callback. This simplifies some output_enable
and we can also avoid posting 2 messages for the sink.

10 years agobluetooth: Notify the main thread of a stream fd HUP
João Paulo Rechi Vita [Tue, 4 Feb 2014 22:04:05 +0000 (19:04 -0300)]
bluetooth: Notify the main thread of a stream fd HUP

10 years agobluetooth: Rename variable to improve code readability
João Paulo Rechi Vita [Tue, 4 Feb 2014 22:04:04 +0000 (19:04 -0300)]
bluetooth: Rename variable to improve code readability

The label 'u' is used throughout the code to name pointers to the struct
userdata.

10 years agopo: Add two files to POTFILES.in
David Henningsson [Fri, 30 May 2014 10:12:14 +0000 (12:12 +0200)]
po: Add two files to POTFILES.in

Translations were recently to these to files.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agoalsa-mixer: Add surround 2.1 profile
David Henningsson [Fri, 23 May 2014 12:21:27 +0000 (14:21 +0200)]
alsa-mixer: Add surround 2.1 profile

Surround 2.1 is one of the more common surround profiles these days,
so it's about time we support it.

The "surround21" was added to alsa-lib a few months ago, and there
hasn't yet been an alsa-lib release since, but I doubt it will change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agochannelmap: Add 2.1 surround
David Henningsson [Fri, 23 May 2014 12:20:16 +0000 (14:20 +0200)]
channelmap: Add 2.1 surround

Add surround-21 as a alias to set up a 2.1 channel map.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agocore: Initialize ARM NEON remapping code if available
Peter Meerwald [Thu, 12 Jan 2012 12:18:11 +0000 (13:18 +0100)]
core: Initialize ARM NEON remapping code if available

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
10 years agoremap: Add ARM NEON optimized remapping and rearrange code
Peter Meerwald [Wed, 16 Apr 2014 17:49:35 +0000 (19:49 +0200)]
remap: Add ARM NEON optimized remapping and rearrange code

v7:
* cleanups and reduce code; add 4->4 channels mappings, add rearrange code
v6:
* rename mono_to_stereo_float_neon_a9() to mono_to_stereo_float_arm_generic(); note that
Cortex-A8 and -A9/A15 are different, later chips do not benefit from NEON memory transfers
v5:
* 4-channel remapping
* use vrhadd instruction, fix int16 overflow for to-mono case
v4:
* fix for sample length < 4
v3:
* fix test code: init float and int map_table
* different code path for Cortex-A8 and later (-A9, A15, unknown)
* convert from intrinsics to inline assembly
v2:
* add ARM NEON stereo-to-mono remapping code
* static __attribute__ ((noinline)) is necessary to prevent inlining and
  work around gcc 4.6 ICE, see https://bugs.launchpad.net/bugs/936863
* call test code, the reference implementation is obtained using
  pa_get_init_remap_func()
* remove check for NEON flags
v1:
* ARM NEON mono-to-stereo remapping code

note that orig is the time of the special-case C implementation where available, not
the generic matric remapping implementation

on ARM Cortex-A8 (TI OMAP3 DM3730 @ 1GHz) (Linaro GCC 4.6):

Checking NEON remap (float, mono->stereo)
func: 757474 usec (avg: 7574.74, min = 6165, max = 11963, stddev = 1479.71).
orig: 784882 usec (avg: 7848.82, min = 6835, max = 17639, stddev = 1656.01).
Checking NEON remap (float, mono->4-channel)
func: 1545507 usec (avg: 15455.1, min = 6531, max = 30609, stddev = 2689.6).
orig: 2601413 usec (avg: 26014.1, min = 22796, max = 52979, stddev = 3281.84).
Checking NEON remap (s16, mono->stereo)
func: 343844 usec (avg: 3438.44, min = 1709, max = 8880, stddev = 1180.1).
orig: 474460 usec (avg: 4744.6, min = 4212, max = 7751, stddev = 1069.29).
Checking NEON remap (s16, mono->4-channel)
func: 736574 usec (avg: 7365.74, min = 3784, max = 11902, stddev = 1637.79).
orig: 1062772 usec (avg: 10627.7, min = 7630, max = 17517, stddev = 3011.44).
Checking NEON remap (float, stereo->mono)
func: 571412 usec (avg: 5714.12, min = 4608, max = 15808, stddev = 2131.7).
orig: 4356630 usec (avg: 43566.3, min = 41596, max = 52430, stddev = 2056.79).
Checking NEON remap (float, 4-channel->mono)
func: 1443202 usec (avg: 14432, min = 12298, max = 32349, stddev = 3300).
orig: 9273410 usec (avg: 92734.1, min = 81940, max = 184265, stddev = 23310).
Checking NEON remap (s16, stereo->mono)
func: 185761 usec (avg: 1857.61, min = 1556, max = 4975, stddev = 743.681).
orig: 1204776 usec (avg: 12047.8, min = 10711, max = 16022, stddev = 1596.88).
Checking NEON remap (s16, 4-channel->mono)
func: 482912 usec (avg: 4829.12, min = 4241, max = 9980, stddev = 1270.8).
orig: 1692050 usec (avg: 16920.5, min = 14679, max = 30060, stddev = 2760.7).
Checking NEON remap (float, 4-channel->4-channel)
func: 5324471 usec (avg: 53244.7, min = 49774, max = 87036, stddev = 4255.47).
orig: 73674628 usec (avg: 736746, min = 720338, max = 824128, stddev = 18361.8).
Checking NEON remap (s16, 4-channel->4-channel)
func: 5321320 usec (avg: 53213.2, min = 49591, max = 84443, stddev = 3931.49).
orig: 24122021 usec (avg: 241220, min = 233337, max = 291687, stddev = 9064.31).

Checking NEON remap (float, stereo rearrange)
func: 1116547 usec (avg: 11165.5, min = 9124, max = 27496, stddev = 3345.63).
orig: 1385011 usec (avg: 13850.1, min = 12237, max = 18005, stddev = 1793.05).
Checking NEON remap (s16, stereo rearrange)
func: 517027 usec (avg: 5170.27, min = 4577, max = 9735, stddev = 1215.23).
orig: 1208435 usec (avg: 12084.4, min = 10406, max = 25299, stddev = 2512.02).
Checking NEON remap (float, 4-channel rearrange)
func: 1564667 usec (avg: 15646.7, min = 13855, max = 20172, stddev = 1766.48).
orig: 2970000 usec (avg: 29700, min = 26215, max = 45654, stddev = 2351.07).
Checking NEON remap (s16, 4-channel rearrange)
func: 1088808 usec (avg: 10888.1, min = 9064, max = 23407, stddev = 2465.82).
orig: 1908416 usec (avg: 19084.2, min = 16968, max = 22705, stddev = 1637.46).

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agocore: Distinguish Cortex processors: A8 vs later (A9, A15)
Peter Meerwald [Thu, 5 Jul 2012 12:32:59 +0000 (14:32 +0200)]
core: Distinguish Cortex processors: A8 vs later (A9, A15)

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
10 years agomix: Add special-case ARM NEON code for s16 mixing
Peter Meerwald [Tue, 15 Apr 2014 22:47:50 +0000 (00:47 +0200)]
mix: Add special-case ARM NEON code for s16 mixing

note that orig is the time of the special-case C implementation where available, not
the generic matric remapping implementation

on ARM Cortex-A8 (TI OMAP3 DM3730 @ 1GHz) (Linaro GCC 4.6):

Checking NEON mix (s16, stereo)
func: 2096927 usec (avg: 20969.3, min = 18646, max = 24475, stddev = 1647.36).
orig: 7113956 usec (avg: 71139.6, min = 65705, max = 102601, stddev = 4475.93).
Checking NEON mix (s16, 4-channel)
func: 4093053 usec (avg: 40930.5, min = 39093, max = 48217, stddev = 1862.16).
orig: 15664104 usec (avg: 156641, min = 149781, max = 218598, stddev = 8819.22).
Checking NEON mix (s16, mono)
func: 1139558 usec (avg: 11395.6, min = 9826, max = 25299, stddev = 2495.29).
orig: 3219118 usec (avg: 32191.2, min = 28412, max = 46509, stddev = 2095.34).

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agobluetooth: Change BlueZ 5 card profile name from a2dp to a2dp_sink
João Paulo Rechi Vita [Tue, 4 Feb 2014 22:03:47 +0000 (19:03 -0300)]
bluetooth: Change BlueZ 5 card profile name from a2dp to a2dp_sink

This name is more acurate with regards of what role we're currently
playing and we've already been using it in
pa_bluetooth_profile_to_string() since 449d6cb.

10 years agobluetooth: Fix lines going over column 128
João Paulo Rechi Vita [Tue, 4 Feb 2014 22:03:46 +0000 (19:03 -0300)]
bluetooth: Fix lines going over column 128

10 years agoshell-completion: Add completion for parec
Tanu Kaskinen [Sat, 24 May 2014 10:05:52 +0000 (13:05 +0300)]
shell-completion: Add completion for parec

Thanks to Damir Jelić for fixes in the zsh completion.

10 years agoresampler: Remove prefix from static functions
Tanu Kaskinen [Sat, 24 May 2014 10:15:39 +0000 (13:15 +0300)]
resampler: Remove prefix from static functions

10 years agoi18n: Update Russian translation
Alexander Potashev [Sun, 11 May 2014 22:38:00 +0000 (02:38 +0400)]
i18n: Update Russian translation

Translated in sync with the guidelines at
http://l10n.lrn.ru/wiki/Pulseaudio

10 years agoprotocol-native: Early request bandaid for high latency sink/source
Pierre Ossman [Fri, 23 May 2014 12:43:32 +0000 (14:43 +0200)]
protocol-native: Early request bandaid for high latency sink/source

As it is implemented, the early request mode can in some cases be counter-productive. The mode is designed to give the client a steady request/report rate of small-ish chunks (A somewhat silly client requirement but at least Flash and Firefox break horribly when you break this.).

Unfortunately PulseAudio does not have any mechanism for telling a sink/source how often it should request/report data. So a more blunt hack was applied where the entire latency is restricted to the fragment size.

So far so good, but where the current code breaks down is when the sink cannot satisfy this tiny latency request. We then "report" to the client what we can guarantee by setting the fragment size to the sink's/source's full buffer size/latency.

This severely changes the resulting buffer attributes from what the client requested, and in practice breaks applications. The most prominent user of this feature is the ALSA plugin, and it doesn't even have a mechanism of adapting to the server giving back something different than what was requested.

So long term, the whole early request mode needs to be implemented in a better way. Either the sink's/source's need to grow the ability to control request/report rate. Or we put some form of timer based emulation in front of them on behalf of these clients.

Short term, we should change the behaviour of what happens when we cannot guarantee a fragment rate. Instead of giving the client really shitty buffering parameters as a result, we should just keep the requested attributes and do things on a best-effort basic. Basically how things would behave if the client didn't have the early request bit at all.

The attached patch does just that, as well as expand on the comment about how the early request thing is implemented.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=66962
10 years agoresampler: Support speex resampler compiled with FIXED_POINT
Alexander E. Patrakov [Tue, 13 May 2014 15:50:52 +0000 (21:50 +0600)]
resampler: Support speex resampler compiled with FIXED_POINT

speex_resample_float() does not work with speex compiled with
--enable-fixed-point, because speex expects its float input
to be normalized to ±32768 instead of the more usual ±1.

It is possible to fix speex_resample_float(), as demonstrated at
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-May/020617.html
However, a better idea is to avoid using the speex-float resampler and
the associated s16 <-> float conversions that speex will immediately undo
internally if it is known that speex has been compiled with FIXED_POINT.
So, transparently change speex-float-* to speex-fixed-* in that case.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Reported-by: Fahad Arslan <fahad_arslan@mentor.com>
Cc: Damir Jelić <poljarinho@gmail.com>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
FIXED_POINT detection is based on code by Peter Meerwald.

10 years agobuild-sys: Eliminate _FORTIFY_SOURCE warnings
Alexander E. Patrakov [Fri, 9 May 2014 17:48:55 +0000 (23:48 +0600)]
build-sys: Eliminate _FORTIFY_SOURCE warnings

The warnings were produced because the command-line flag redefined the
value of _FORTIFY_SOURCE coming from the specs on some distributions,
including Gentoo. So, undefine this macro before defining it.

10 years agoi18n: Update Greek translation
Dimitris Spingos [Fri, 9 May 2014 12:02:30 +0000 (15:02 +0300)]
i18n: Update Greek translation

10 years agobluetooth: Fix a copy-paste error in log message
Tanu Kaskinen [Sat, 3 May 2014 11:21:31 +0000 (14:21 +0300)]
bluetooth: Fix a copy-paste error in log message

10 years agobluetooth: Remove redundant assignments
Tanu Kaskinen [Sat, 3 May 2014 11:10:52 +0000 (14:10 +0300)]
bluetooth: Remove redundant assignments

10 years agosink-input, source-output: Add hooks for mute changes
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:16 +0000 (13:56 +0300)]
sink-input, source-output: Add hooks for mute changes

10 years agosink, source: Add hooks for mute changes
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:15 +0000 (13:56 +0300)]
sink, source: Add hooks for mute changes

10 years agosink-input, source-output: Add hooks for volume changes
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:14 +0000 (13:56 +0300)]
sink-input, source-output: Add hooks for volume changes

10 years agosink, source: Add hooks for volume changes
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:13 +0000 (13:56 +0300)]
sink, source: Add hooks for volume changes

10 years agosolaris, tunnel: Remove some redundant boolean conversions
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:12 +0000 (13:56 +0300)]
solaris, tunnel: Remove some redundant boolean conversions

10 years agosink-input, source-output: Remove redundant get_mute() functions
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:11 +0000 (13:56 +0300)]
sink-input, source-output: Remove redundant get_mute() functions

The functions just return the muted value. Callers can as well read
the struct field directly, it's simpler that way.

10 years agosink, source: Assign to s->muted from only one place
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:10 +0000 (13:56 +0300)]
sink, source: Assign to s->muted from only one place

Forcing all mute changes to go through set_mute() makes it easier to
check where the muted field is changed, and it also allows us to have
only one place where notifications for changed mute are sent.

10 years agosink, source: Call set_mute() from mute_changed()
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:09 +0000 (13:56 +0300)]
sink, source: Call set_mute() from mute_changed()

This refactoring reduces duplication, as mute_changed() used to do the
same things as set_mute(). Other benefits are improved logging
(set_mute() logs the mute change, mute_changed() used to not do that)
and the soft mute state is kept up to date, because set_mute() sends
the SET_MUTE message to the IO thread.

The set_mute_in_progress flag is an extra precaution for preventing
recursion in case a sink/source implementation's set_mute() callback
causes mute_changed() to be called. Currently there are no such
implementations, but I think that would be a valid thing to do, so
some day there might be such implementation.

10 years agoecho-cancel: Remove redundant get_mute() callback
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:08 +0000 (13:56 +0300)]
echo-cancel: Remove redundant get_mute() callback

The callback just called pa_source_output_get_mute(), which doesn't
have any side effects, and the return value wasn't used either, so
the callback was essentially a no-op.

10 years agosink, source: Allow calling set_mute() during initialization
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:07 +0000 (13:56 +0300)]
sink, source: Allow calling set_mute() during initialization

Currently the alsa sink and source write directly to s->muted during
initialization, but I think it's better to avoid direct writes, and
use the set_mute() function instead, because that makes it easier to
figure out where s->muted is modified. This patch prevents the
set_mute() call from crashing in the state assertion.

10 years agosink-input, source-output: Add logging to set_mute()
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:06 +0000 (13:56 +0300)]
sink-input, source-output: Add logging to set_mute()

10 years agosink, source: Return early from set_mute()
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:05 +0000 (13:56 +0300)]
sink, source: Return early from set_mute()

This avoids redundant set_mute() callback calls.

Some logging was added too.

10 years agosink-input, source-output: Assign to volume from only one place
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:04 +0000 (13:56 +0300)]
sink-input, source-output: Assign to volume from only one place

Forcing all volume changes to go through set_volume_direct() makes
it easier to check where the stream volume is changed, and it also
allows us to have only one place where notifications for changed
volume are sent.

10 years agosink, source: Assign to reference_volume from only one place
Tanu Kaskinen [Tue, 15 Apr 2014 10:56:03 +0000 (13:56 +0300)]
sink, source: Assign to reference_volume from only one place

Forcing all reference volume changes to go through
set_reference_volume_direct() makes it easier to check where the
reference volume is changed, and it also allows us to have only one
place where notifications for changed reference volume are sent.

10 years agoremap: Add stereo to mono and 4-channel special case remapping
Peter Meerwald [Wed, 16 Apr 2014 17:02:02 +0000 (19:02 +0200)]
remap: Add stereo to mono and 4-channel special case remapping

The generic matrix remapping is rather inefficient; special-case code
improves performance by 3x easily.

v4: split into s16 and float code, 4-channel remapping
v3: fix remap_mono_to_stereo_c(), use assignment
v2: use consistent array addressing

on Intel Core i7-870 @ 2.93 GHz (GCC 4.6, 64-bit):

Checking special remap (float, mono->stereo)
func: 70392 usec (avg: 703.92, min = 583, max = 1879, stddev = 295.192).
orig: 193042 usec (avg: 1930.42, min = 1457, max = 2269, stddev = 89.9045).
Checking special remap (float, mono->4-channel)
func: 118408 usec (avg: 1184.08, min = 1151, max = 1454, stddev = 57.1244).
orig: 380074 usec (avg: 3800.74, min = 3740, max = 4180, stddev = 96.3389).
Checking special remap (s16, mono->stereo)
func: 60574 usec (avg: 605.74, min = 582, max = 659, stddev = 20.7681).
orig: 188262 usec (avg: 1882.62, min = 1804, max = 2167, stddev = 79.17).
Checking special remap (s16, mono->4-channel)
func: 120331 usec (avg: 1203.31, min = 1151, max = 1429, stddev = 55.2863).
orig: 376028 usec (avg: 3760.28, min = 3609, max = 4096, stddev = 122.043).
Checking special remap (float, stereo->mono)
func: 61408 usec (avg: 614.08, min = 580, max = 867, stddev = 50.933).
orig: 186484 usec (avg: 1864.84, min = 1808, max = 2121, stddev = 65.3967).
Checking special remap (float, 4-channel->mono)
func: 118101 usec (avg: 1181.01, min = 1157, max = 1383, stddev = 36.4474).
orig: 365191 usec (avg: 3651.91, min = 3540, max = 4083, stddev = 117.509).
Checking special remap (s16, stereo->mono)
func: 82908 usec (avg: 829.08, min = 795, max = 953, stddev = 33.3409).
orig: 182565 usec (avg: 1825.65, min = 1774, max = 2117, stddev = 65.5401).
Checking special remap (s16, 4-channel->mono)
func: 132025 usec (avg: 1320.25, min = 1284, max = 1509, stddev = 47.0133).
orig: 363347 usec (avg: 3633.47, min = 3560, max = 4012, stddev = 111.259).

on ARM Cortex-A8 (TI OMAP3 DM3730 @ 1GHz) (Linaro GCC 4.6):

Checking special remap (float, mono->stereo)
func: 1213562 usec (avg: 12135.6, min = 4669, max = 16266, stddev = 2067.64).
orig: 9251927 usec (avg: 92519.3, min = 87372, max = 134216, stddev = 5965.79).
Checking special remap (float, mono->4-channel)
func: 2479550 usec (avg: 24795.5, min = 7507, max = 29358, stddev = 2690.16).
orig: 13186133 usec (avg: 131861, min = 119843, max = 263855, stddev = 27309).
Checking special remap (s16, mono->stereo)
func: 471894 usec (avg: 4718.94, min = 4058, max = 9583, stddev = 1302.7).
orig: 1673826 usec (avg: 16738.3, min = 14679, max = 31342, stddev = 2271.67).
Checking special remap (s16, mono->4-channel)
func: 869508 usec (avg: 8695.08, min = 7019, max = 19165, stddev = 1866.94).
orig: 3317020 usec (avg: 33170.2, min = 29327, max = 47577, stddev = 2029.11).
Checking special remap (float, stereo->mono)
func: 4405182 usec (avg: 44051.8, min = 41443, max = 77912, stddev = 4160.54).
orig: 13245064 usec (avg: 132451, min = 125244, max = 182282, stddev = 8543.93).
Checking special remap (float, 4-channel->mono)
func: 8607974 usec (avg: 86079.7, min = 81909, max = 116608, stddev = 4311.52).
orig: 26326036 usec (avg: 263260, min = 255097, max = 312928, stddev = 10111.5).
Checking special remap (s16, stereo->mono)
func: 1209135 usec (avg: 12091.4, min = 10742, max = 16632, stddev = 1633.88).
orig: 3081515 usec (avg: 30815.2, min = 27008, max = 50537, stddev = 3124.35).
Checking special remap (s16, 4-channel->mono)
func: 1653868 usec (avg: 16538.7, min = 14648, max = 20721, stddev = 1834.52).
orig: 6017854 usec (avg: 60178.5, min = 56061, max = 89569, stddev = 4052.86).

benchmark code will be posted as follow-up patches

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoremap: Add special remapping case which just re-arranges channels
Peter Meerwald [Wed, 16 Apr 2014 13:07:25 +0000 (15:07 +0200)]
remap: Add special remapping case which just re-arranges channels

Input channels may just be copied to output channels, no mixing; this
avoids the generic (slow) matrix remapping code in cases where channels
are dropped or reordered.
This makes use of the remap struct state introduced earlier.

on Intel Core i7-870 @ 2.93 GHz (GCC 4.6, 64-bit):

Checking special remap (s16, stereo rearrange)
func: 126117 usec (avg: 1261.17, min = 1150, max = 2111, stddev = 117.332).
orig: 190509 usec (avg: 1905.09, min = 1807, max = 2402, stddev = 100.984).
Checking special remap (float, stereo rearrange)
func: 194329 usec (avg: 1943.29, min = 1876, max = 2127, stddev = 64.3486).
orig: 205263 usec (avg: 2052.63, min = 2005, max = 2452, stddev = 70.177).
Checking special remap (s16, 4-channel rearrange)
func: 278754 usec (avg: 2787.54, min = 2719, max = 3093, stddev = 78.22).
orig: 383885 usec (avg: 3838.85, min = 3634, max = 4121, stddev = 128.522).
Checking special remap (float, 4-channel rearrange)
func: 312429 usec (avg: 3124.29, min = 3017, max = 3498, stddev = 120.127).
orig: 388198 usec (avg: 3881.98, min = 3768, max = 4655, stddev = 138.441).

on ARM Cortex-A8 (TI OMAP3 DM3730 @ 1GHz) (Linaro GCC 4.6):

Checking special remap (s16, stereo rearrange)
func: 1204647 usec (avg: 12046.5, min = 10406, max = 25451, stddev = 2491.9).
orig: 1660311 usec (avg: 16603.1, min = 14740, max = 20416, stddev = 1708.07).
Checking special remap (float, stereo rearrange)
func: 1391392 usec (avg: 13913.9, min = 12207, max = 28260, stddev = 2238.12).
orig: 9246707 usec (avg: 92467.1, min = 87525, max = 125611, stddev = 5494.64).
Checking special remap (s16, 4-channel rearrange)
func: 2540225 usec (avg: 25402.2, min = 16937, max = 68268, stddev = 10786.7).
orig: 3319852 usec (avg: 33198.5, min = 29571, max = 36957, stddev = 1250.39).
Checking special remap (float, 4-channel rearrange)
func: 3024414 usec (avg: 30244.1, min = 26153, max = 58105, stddev = 4506.01).
orig: 12643624 usec (avg: 126436, min = 120575, max = 159088, stddev = 5519.28).

benchmark code will be posted as follow-up patches

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoremap: Add (optional) state to remap struct
Peter Meerwald [Wed, 16 Apr 2014 13:00:45 +0000 (15:00 +0200)]
remap: Add (optional) state to remap struct

State can be used by remap function implementations to
speed up the remapping, e.g. by precomputing things or
even by generating specialized code for a specific channel
remapping task

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoremap: Change remapping function argument type from void to int16_t / float as approp...
Peter Meerwald [Sun, 27 Apr 2014 20:22:03 +0000 (22:22 +0200)]
remap: Change remapping function argument type from void to int16_t / float as appropriate

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoremap: Cleanup remap function selection, add pa_set_remap_func() helper
Peter Meerwald [Tue, 22 Apr 2014 15:45:23 +0000 (17:45 +0200)]
remap: Cleanup remap function selection, add pa_set_remap_func() helper

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoremap: Add helper function to setup channel arrangement information
Peter Meerwald [Wed, 16 Apr 2014 13:06:29 +0000 (15:06 +0200)]
remap: Add helper function to setup channel arrangement information

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoremap: Use float constant instead of double
Peter Meerwald [Wed, 16 Apr 2014 10:00:06 +0000 (12:00 +0200)]
remap: Use float constant instead of double

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoremap: Split remapping functions into s16 and float implementation
Peter Meerwald [Wed, 16 Apr 2014 09:58:11 +0000 (11:58 +0200)]
remap: Split remapping functions into s16 and float implementation

The sample format is known when the remap structure is initialized,
no runtime decision needed.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoremap: Make resampler's remap structure more self-contained
Peter Meerwald [Wed, 16 Apr 2014 09:25:58 +0000 (11:25 +0200)]
remap: Make resampler's remap structure more self-contained

Initialization of the remap structure now happens in one place

Rename calc_map_table() to setup_remap(), copy sample format and
channel specs; the remap structure is initialized when we know the
work sample format of the resampler

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoremap: Refactor channel remap table computation calc_map_table()
Peter Meerwald [Wed, 16 Apr 2014 08:48:21 +0000 (10:48 +0200)]
remap: Refactor channel remap table computation calc_map_table()

Make the resampler argument const, and pass explicit remap
structure argument

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoremap: Rename pa_init_remap() to pa_init_remap_func()
Peter Meerwald [Wed, 16 Apr 2014 09:37:50 +0000 (11:37 +0200)]
remap: Rename pa_init_remap() to pa_init_remap_func()

pa_init_remap_func() only sets the appropriate remapping function, it
does not initialize the pa_remap struct

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoremap: Don't use PA_VOLUME_NORM
Peter Meerwald [Wed, 16 Apr 2014 17:24:01 +0000 (19:24 +0200)]
remap: Don't use PA_VOLUME_NORM

remapping operates on channel contributions, not volumes

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agopacat: Mention source in addition to sink where applicable in help
Peter Meerwald [Wed, 16 Apr 2014 16:12:52 +0000 (18:12 +0200)]
pacat: Mention source in addition to sink where applicable in help

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agosconv: Cleanup ARM NEON code
Peter Meerwald [Wed, 16 Apr 2014 16:20:16 +0000 (18:20 +0200)]
sconv: Cleanup ARM NEON code

Fix compiler warning, code formatting

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agodefault.pa: Use freedesktop theme sounds in sample examples
Bradley Broom [Sat, 26 Apr 2014 09:16:50 +0000 (12:16 +0300)]
default.pa: Use freedesktop theme sounds in sample examples

10 years agogconf: Avoid calling deprecated function if possible
Arun Raghavan [Tue, 22 Apr 2014 07:35:19 +0000 (13:05 +0530)]
gconf: Avoid calling deprecated function if possible

g_type_init() is need no longer be called explicitly from glib 2.36
onwards.

10 years agogconf: Remove unused variable
Arun Raghavan [Tue, 22 Apr 2014 07:35:18 +0000 (13:05 +0530)]
gconf: Remove unused variable

10 years agosink-input, source-output: Fix mute saving
Tanu Kaskinen [Tue, 15 Apr 2014 07:59:03 +0000 (10:59 +0300)]
sink-input, source-output: Fix mute saving

"i->save_muted = i->save_muted || mute" makes no sense. The intention
was most likely to use "save" instead of "mute" in the assignment.
This line originates from reverting the volume ramping code, commit
8401572fd534f10e07ed6a418e1399b1294d5596.

The idea of "i->save_muted |= save" is that even if the mute state
doesn't change, save_muted should still be updated, but only if the
transition is from "don't save" to "save".

Changing "!i->muted == !mute" to "mute == i->muted" is cosmetic only.
The rationale behind the old form was probably that when we still had
pa_bool_t, booleans could in theory be defined as int, so comparing
the values without the ! operator was not entirely safe. That's
unnecessary now that we use the standard bool type, which can only
have values 0 or 1.

10 years agocombine-sink: fix zero adjust_time behaviour.
Hemanth Meenakshisundaram [Mon, 21 Apr 2014 00:30:07 +0000 (17:30 -0700)]
combine-sink: fix zero adjust_time behaviour.

A value of 0 for adjust_time should disable rate adjustment.
Fix a bug where a 0 value causes rate adjustment to be called
continuously instead after an unsuspend event.

10 years agocore-util: Remove redundant check of directory permissions
Alexander E. Patrakov [Sun, 20 Apr 2014 15:58:19 +0000 (21:58 +0600)]
core-util: Remove redundant check of directory permissions

Initially (in commit ef422fa4ae626e9638ca70d1c56f27e701dd69c2),
pa_make_secure_dir followed a simple principle: "make a directory, or,
if it exists, check that it is suitable". Later this evolved into "make
a directory, or, if it exists, ensure that it is suitable". But the
check remained.

The check is now neither sufficient nor necessary. On POSIX-compliant
systems, the fstat results being checked are actually post-conditions of
fchmod and fchown. And on systems implementing POSIX ACLs, fstat only
reflects a part of the information relevant to the security of the
directory permissions, so PulseAudio could accept an existing insecure
directory anyway.

Also, the check still fires on non-POSIX-compliant filesystems like CIFS.
As a user cannot do anything to fix it, just accept insecure permissions
in this case.

10 years agocore-util: Call fchown() only when necessary
Bradley Broom [Fri, 25 Apr 2014 10:00:00 +0000 (13:00 +0300)]
core-util: Call fchown() only when necessary

This reportedly fixes some cases where the home directory is on NFS.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=45656
10 years agofdsem: Use atomic.h
David Henningsson [Tue, 15 Apr 2014 15:23:06 +0000 (17:23 +0200)]
fdsem: Use atomic.h

The fdsem header uses pa_atomic_t, which is declared in atomic.h

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agofdsem: remove superfluous parameter in call to pa_fdsem_new_shm
David Henningsson [Tue, 15 Apr 2014 14:26:12 +0000 (16:26 +0200)]
fdsem: remove superfluous parameter in call to pa_fdsem_new_shm

This parameter was never assigned, so just remove it.

Note that the only current user of this function is shmasyncq.c,
which is unused - we don't even build it. But I fixed it up anyway.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agovala: Add bindings for libpulse-simple
Alexander Kurtz [Thu, 17 Apr 2014 12:22:04 +0000 (15:22 +0300)]
vala: Add bindings for libpulse-simple

10 years agodbus: Use correct initialization for source ports hashmap.
Juho Hämäläinen [Tue, 15 Apr 2014 13:11:48 +0000 (16:11 +0300)]
dbus: Use correct initialization for source ports hashmap.

Source ports hashmap is created without value freeing function, which
results in (hashmap values) device ports not being freed when source
ports are removed or module is unloaded. This results in memory leak
during normal operation and during daemon shutdown dbus_protocol shared
object isn't unreferenced correctly, leaving dbus_protocol object in
core->shared, which causes assert when shared hashmap is checked for
isempty() before freeing.

10 years agodoxygen: Enable GENERATE_DEPRECATEDLIST
Tanu Kaskinen [Sat, 5 Apr 2014 09:30:47 +0000 (12:30 +0300)]
doxygen: Enable GENERATE_DEPRECATEDLIST

This generates a list of deprecated things, which is accessible from
the table of contents frame. The list, however, isn't the important
thing here. The important thing is that this also prevents doxygen
from stripping all documentation for the deprecated things.

Previous discussion:
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/18794

10 years agovirtual-surround-sink: Move normalization heuristic to its own function
Niels Ole Salscheider [Wed, 2 Apr 2014 20:32:34 +0000 (22:32 +0200)]
virtual-surround-sink: Move normalization heuristic to its own function

This patch also adds a description how the heuristic works and mentions that
there is a scaling factor that can be adjusted if there is audible clipping.

10 years agoUse pa_hashmap_remove_and_free() where appropriate
Tanu Kaskinen [Wed, 26 Mar 2014 15:39:48 +0000 (17:39 +0200)]
Use pa_hashmap_remove_and_free() where appropriate

10 years agohashmap: Add pa_hashmap_remove_and_free()
Tanu Kaskinen [Wed, 26 Mar 2014 15:39:47 +0000 (17:39 +0200)]
hashmap: Add pa_hashmap_remove_and_free()

10 years agopactl: Clean up checking for VOL_RELATIVE flag
Peter Meerwald [Sat, 29 Mar 2014 17:03:05 +0000 (18:03 +0100)]
pactl: Clean up checking for VOL_RELATIVE flag

VOL_RELATIVE if a bit flag (1 << 4), hence we can simply do
    if (vol_flags & VOL_RELATIVE) ...
instead of
    if ((vol_flags & VOL_RELATIVE) == VOL_RELATIVE) ...

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agopactl: Document ability to specify channel volumes individually
Peter Meerwald [Thu, 13 Feb 2014 20:15:04 +0000 (21:15 +0100)]
pactl: Document ability to specify channel volumes individually

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agopactl: Check consistency of volumes specified
Peter Meerwald [Thu, 13 Feb 2014 20:07:06 +0000 (21:07 +0100)]
pactl: Check consistency of volumes specified

Must use one way to specify volumes consistently, e.g.
+3dB +3dB, mixing different ways is not allowed, such as
40% 1000

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agopactl: Allow to set volume of each channel independently (Bug #39190)
Parin Porecha [Thu, 19 Dec 2013 11:58:15 +0000 (17:28 +0530)]
pactl: Allow to set volume of each channel independently (Bug #39190)

Example: pactl set-sink-volume "sink_name" 32000 40000
If the number of volumes provided is different than the number of channels
(excluding the case where a single volume is provided), an error message
is displayed explaining why the volumes could not be set.

patch proposed by Parin Porecha
code refactoring and commit message slightly edited by Peter Meerwald

10 years agopactl: Stop parsing option when the first non-option is encountered
Peter Meerwald [Tue, 15 Apr 2014 08:58:21 +0000 (10:58 +0200)]
pactl: Stop parsing option when the first non-option is encountered

fix bug
https://bugs.freedesktop.org/show_bug.cgi?id=77108

see getopt(3):
""By default, getopt() permutes the contents of argv as it scans, so that
  eventually all the nonoptions are at the end.  Two other modes are also
  implemented.   If  the first character of optstring is '+' or the envi‐
  ronment variable POSIXLY_CORRECT is set, then option  processing  stops
  as soon as a nonoption argument is encountered.  If the first character
  of optstring is '-', then each nonoption argv-element is handled as  if
  it were the argument of an option with character code 1.  (This is used
  by programs that were written to expect options and other argv-elements
  in any order and that care about the ordering of the two.)  The special
  argument "--" forces an end of option-scanning regardless of the  scan‐
  ning mode.""

prepend optstring with '+' to use POSIXLY_CORRECT mode

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoman: Fix typos in pulse-daemon.conf.5.xml.in
Peter Meerwald [Tue, 15 Apr 2014 08:37:26 +0000 (10:37 +0200)]
man: Fix typos in pulse-daemon.conf.5.xml.in

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agopstream: Use pa_xnew0 in initialization
David Henningsson [Tue, 15 Apr 2014 09:52:22 +0000 (11:52 +0200)]
pstream: Use pa_xnew0 in initialization

...for simplicity.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>