platform/upstream/pulseaudio.git
8 years agosink-input, source-output: Add some debug output on start_move() v7.99.2
Arun Raghavan [Mon, 11 Jan 2016 07:22:10 +0000 (12:52 +0530)]
sink-input, source-output: Add some debug output on start_move()

8 years agoNetBSD: Stop depending upon nonstandard __WORDSIZE
Kamil Rytarowski [Sun, 20 Dec 2015 00:25:41 +0000 (01:25 +0100)]
NetBSD: Stop depending upon nonstandard __WORDSIZE

There is no way to check CPU type in a portable way across ABIs.

Assume if pointers are 64-bit that CPU is capable to perform fast
64-bit operations. Add an extra check to handle x32-ABI.

PulseAudio by default builds with -Wundef. If we add -Werror=undef this
missing define is fatal. By default build log is full of entries like:

In file included from ./pulsecore/core.h:47:0,
                 from ./pulsecore/module.h:31,
                 from ./pulsecore/sink-input.h:31,
                 from pulsecore/sound-file-stream.c:36:
./pulsecore/sample-util.h: In function 'pa_mult_s16_volume':
./pulsecore/sample-util.h:58:5: warning: "__WORDSIZE" is not defined [-Wundef]
 #if __WORDSIZE == 64 || ((ULONG_MAX) > (UINT_MAX))
     ^

(NetBSD-7.99.21 with default GCC 4.8.5)

This change fixes build issues on NetBSD.

This also address a bug reported by Shawn Walker from Oracle (possibly Solaris):
Bug 90880 - builds can fail due to non-portable glibc-specific internal macro usage

8 years agortpoll: Fix build error when building with DEBUG_TIMING
jungsup lee [Wed, 6 Jan 2016 05:18:50 +0000 (14:18 +0900)]
rtpoll: Fix build error when building with DEBUG_TIMING

This typo causes a build error when DEBUG_TIMING is defined.
Signed-off-by: jungsup lee <jungsup4.lee@samsung.com>
8 years agomodule-tunnel: Fix double free
KimJeongYeon [Wed, 6 Jan 2016 08:28:11 +0000 (17:28 +0900)]
module-tunnel: Fix double free

Local pointer 'dn' freed again when pa_thread_new() failed.

Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
8 years agomodule-coreaudio-device: get channel name as CFString and convert to plain C string.
Mihai Moldovan [Mon, 20 Apr 2015 18:46:02 +0000 (20:46 +0200)]
module-coreaudio-device: get channel name as CFString and convert to plain C string.

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
The old code fetched the channel name via AudioObjectGetPropertyData()
and accessed the "returned" data as a plain char buffer.

This may or may not have worked at some point according to the Apple
CFString documentation, which warns that the actual data layout is an
implementation detail and subject to change at any time.

On recent OS X versions, this behavior led to "random data" channel
names like >H��{, H��{<.

We need to actually let AudioObjectGetPropertyData() populate a CFString
struct and convert this into a plain char buffer.

The conversion function will not free the CFString, so do that in the
caller.

Signed-off-by: Mihai Moldovan <ionic@ionic.de>
8 years agosystem.pa.in: load module-coreaudio-detect if HAVE_COREAUDIO.
Mihai Moldovan [Tue, 21 Apr 2015 06:01:27 +0000 (08:01 +0200)]
system.pa.in: load module-coreaudio-detect if HAVE_COREAUDIO.

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
Signed-off-by: Mihai Moldovan <ionic@ionic.de>
8 years agodefault.pa.in: load module-coreaudio-detect if HAVE_COREAUDIO.
Mihai Moldovan [Tue, 21 Apr 2015 06:01:16 +0000 (08:01 +0200)]
default.pa.in: load module-coreaudio-detect if HAVE_COREAUDIO.

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
Signed-off-by: Mihai Moldovan <ionic@ionic.de>
8 years agoconfigure.ac: add HAVE_COREAUDIO to automake and code.
Mihai Moldovan [Tue, 21 Apr 2015 06:01:05 +0000 (08:01 +0200)]
configure.ac: add HAVE_COREAUDIO to automake and code.

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
Signed-off-by: Mihai Moldovan <ionic@ionic.de>
8 years agoalsa: Don't disable timer-based scheduling on USB devices
Arun Raghavan [Tue, 29 Dec 2015 00:30:14 +0000 (06:00 +0530)]
alsa: Don't disable timer-based scheduling on USB devices

This isn't a great fix, but we need ALSA API to do this right. In the
mean time, USB devices work fine with timer-based scheduling, so there's
no reason to force a large minimum latency by disabling tsched on them.

8 years agobuild-sys: Fix install order of libpulsecore
Felipe Sateler [Mon, 28 Dec 2015 23:34:08 +0000 (20:34 -0300)]
build-sys: Fix install order of libpulsecore

It needs to be installed after libpulse, because of libtool relinking.

8 years agotravis: Run make install in travis.
Felipe Sateler [Mon, 28 Dec 2015 23:34:09 +0000 (20:34 -0300)]
travis: Run make install in travis.

This helps detect ordering problems in the install target

8 years agobuild-sys: add typedefs.h to libpulsecore SOURCES v7.99.1
Tanu Kaskinen [Sun, 27 Dec 2015 12:52:37 +0000 (14:52 +0200)]
build-sys: add typedefs.h to libpulsecore SOURCES

Without this the file doesn't get included in tarballs.

8 years agobuild-sys: bump sonames
Tanu Kaskinen [Sun, 27 Dec 2015 12:41:04 +0000 (14:41 +0200)]
build-sys: bump sonames

Bump 18 -> 19 due to the addition of the LFE balance API.

8 years agodaemon: Sanitise message about unsupported high res timers
Arun Raghavan [Mon, 21 Dec 2015 05:24:58 +0000 (10:54 +0530)]
daemon: Sanitise message about unsupported high res timers

8 years agobuild: Move to using Travis trusty images
Arun Raghavan [Mon, 21 Dec 2015 05:38:25 +0000 (11:08 +0530)]
build: Move to using Travis trusty images

8 years agoalways-sink: simplify hook management with pa_module_hook_connect()
Tanu Kaskinen [Sun, 20 Dec 2015 10:18:28 +0000 (12:18 +0200)]
always-sink: simplify hook management with pa_module_hook_connect()

8 years agoi18n: Update Ukrainian translation
Yuri Chornoivan [Sun, 20 Dec 2015 11:35:13 +0000 (13:35 +0200)]
i18n: Update Ukrainian translation

8 years agogitignore: Add .orig and .rej to gitignore
David Henningsson [Fri, 18 Dec 2015 12:34:46 +0000 (13:34 +0100)]
gitignore: Add .orig and .rej to gitignore

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agocontext: continue without srbchannel if it fails
Pierre Ossman [Thu, 10 Dec 2015 15:22:54 +0000 (16:22 +0100)]
context: continue without srbchannel if it fails

We might be compiled without eventfd support, or something else
might go wrong. And it's fully possible to continue using the old
channel rather than just disconnecting.

Signed-off-by: Pierre Ossman <ossman@cendio.se>
8 years agoloopback: Validate the rate parameter
Georg Chini [Wed, 25 Feb 2015 18:43:24 +0000 (19:43 +0100)]
loopback: Validate the rate parameter

8 years agoecho-cancel: Don't skip canceller when sink is inactive
Arun Raghavan [Wed, 18 Nov 2015 02:56:47 +0000 (08:26 +0530)]
echo-cancel: Don't skip canceller when sink is inactive

This forces the canceller engine to be invoked even if playback is not
currently active. We need to do this for cases where the engine provides
additional processing that is independent of playback, such as noise
suppression and AGC.

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

8 years agobuild-sys: Make pulsecore a private library
Felipe Sateler [Fri, 11 Dec 2015 14:00:30 +0000 (11:00 -0300)]
build-sys: Make pulsecore a private library

It is not meant to be used by third parties, so do not install in a public dir

8 years agoclient-conf, daemon-conf: enable .d directories
Tanu Kaskinen [Mon, 7 Dec 2015 21:22:42 +0000 (23:22 +0200)]
client-conf, daemon-conf: enable .d directories

I want to enable client.conf.d, because in OpenEmbedded-core we have
a graphical environment called Sato that runs as root. Sato needs to
set allow-autospawn-for-root=true in client.conf, but the default
configuration in OpenEmbedded-core should not set that option. With
this patch, I can create a Sato-specific package that simply installs
50-sato.conf in /etc/pulse/client.conf.d without conflicting with the
main client.conf coming from a different package.

daemon.conf.d is enabled just because it would be strange to not
support it while client.conf.d is supported.

8 years agoconf-parser: add support for .d directories
Tanu Kaskinen [Mon, 7 Dec 2015 21:22:41 +0000 (23:22 +0200)]
conf-parser: add support for .d directories

This allows a configuration scheme where after loading configuration
from "somefile", the parser loads configuration from files in
directory "somefile.d". This feature needs to be enabled on a per-file
basis, though, and this patch doesn't yet enable the feature for any
files.

8 years agotypedefs.h: Move some typedefs to a separate file
David Henningsson [Thu, 26 Nov 2015 17:29:58 +0000 (18:29 +0100)]
typedefs.h: Move some typedefs to a separate file

The relationship between sinks, sources, cards, profiles, and ports
is becoming ever more intertwined, to the point that if you try to
include one file from the other, you're likely to end up with some
weird error somewhere else.

Work around this by creating a new typedefs.h, which does not depend
on anything else, and just creates a few typedefs.

(Can be expanded with more typedefs in the future if the need arises.)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoalsa-mixer: Have valid proplist for synthesized path as well.
Juho Hämäläinen [Thu, 10 Dec 2015 13:09:34 +0000 (15:09 +0200)]
alsa-mixer: Have valid proplist for synthesized path as well.

When synthesized alsa path is freed there is an assert from NULL
proplist. Create empty proplist for the path to fix.

Signed-off-by: Juho Hämäläinen <juho.hamalainen@nomovok.com>
8 years agonetbsd: Revamp NetBSD platform checks
Kamil Rytarowski [Tue, 8 Dec 2015 03:22:42 +0000 (04:22 +0100)]
netbsd: Revamp NetBSD platform checks

8 years agocore, pulse, modules: Fix undefined behavior with array subscript of invalid type
Kamil Rytarowski [Fri, 20 Nov 2015 03:20:36 +0000 (04:20 +0100)]
core, pulse, modules: Fix undefined behavior with array subscript of invalid type

From the NetBSD manual:

     The first argument of these functions is of type int, but only a very
     restricted subset of values are actually valid.  The argument must either
     be the value of the macro EOF (which has a negative value), or must be a
     non-negative value within the range representable as unsigned char.
     Passing invalid values leads to undefined behavior.

     --  ctype(3)

8 years agocore-rtclock: Add missing declaration of struct timespec
Kamil Rytarowski [Tue, 8 Dec 2015 01:52:08 +0000 (02:52 +0100)]
core-rtclock: Add missing declaration of struct timespec

8 years agobuild-sys: fix PULSE_LOCALEDIR definition
Tanu Kaskinen [Tue, 29 Sep 2015 08:41:51 +0000 (11:41 +0300)]
build-sys: fix PULSE_LOCALEDIR definition

On some systems (at least Arch) DATADIRNAME is not defined. This
caused PULSE_LOCALEDIR to point to a wrong directory. This seemed like
an issue introduced in 7.0, but probably something else was updated in
Arch at the same time, causing DATADIRNAME to become undefined,
because there were no changes between 6.0 and 7.0 that could have
caused this.

After noticing that localedir is a standard variable, my first idea
was to use pulselocaledir='${localedir}' in configure.ac, but Jan
Steffens pointed out that it causes the final PULSE_LOCALEDIR to
become "${prefix}/share/locale", that is, the variables weren't fully
expanded. I then found a FAQ item in Autoconf's manual[1], which
recommends not to define any absolute installation directories in
configure.ac, because the installation directories should be possible
to change when running make. The recommended solution is to define the
constant in AM_CPPFLAGS instead, so that's what this patch does.

[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Defining-Directories.html

8 years agocore-util: improve comments in pa_machine_id()
Tanu Kaskinen [Wed, 12 Aug 2015 09:37:00 +0000 (11:37 +0200)]
core-util: improve comments in pa_machine_id()

8 years agomodule: Remove redundant core argument from pa_module_unload()
Kiran Krishnappa [Thu, 25 Jun 2015 16:29:36 +0000 (21:59 +0530)]
module: Remove redundant core argument from pa_module_unload()

pa_module_unload() takes two pointers: pa_module and pa_core.
The pa_core pointer is also available via the pa_module object,
so the pa_core argument is redundant

[David Henningsson: Rebased to git HEAD]

8 years agonetbsd: Fix unportable test(1) construct
Kamil Rytarowski [Sat, 28 Nov 2015 13:59:26 +0000 (14:59 +0100)]
netbsd: Fix unportable test(1) construct

8 years agonetbsd: Improve handling of <locale> and <xlocale.h> headers
Kamil Rytarowski [Sat, 28 Nov 2015 09:01:05 +0000 (10:01 +0100)]
netbsd: Improve handling of <locale> and <xlocale.h> headers

NetBSD ships with strtod_l(3) in <stdlib.h>.
Having strtol_l(3) doesn't imply to have <xlocale.h>.
Generalize inclusion of <locale.h> and <xlocale.h>.

8 years agoalsa-sink: Don't pretend to support passthrough on HDMI surround sinks
Alexander E. Patrakov [Fri, 27 Nov 2015 12:30:38 +0000 (17:30 +0500)]
alsa-sink: Don't pretend to support passthrough on HDMI surround sinks

It doesn't work currently (fails and falls back to PCM), due to channel
count mismatch between the sink sample spec and the sample spec required
by IEC61937.

To be reverted when someone implements changing channel count without
switching profiles. This would also be required for HBR passthrough over
HDMI.

Reported-by: Xamindar <junkxamindar@gmail.com>
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
8 years agoman: remove a reference to pacmd from default.pa.5
Tanu Kaskinen [Fri, 4 Dec 2015 05:38:20 +0000 (07:38 +0200)]
man: remove a reference to pacmd from default.pa.5

I don't want to have unnecessary advertising for pacmd, because I
think pacmd should be deprecated.

8 years agoman: document when system.pa is used instead of default.pa
Tanu Kaskinen [Fri, 4 Dec 2015 05:38:19 +0000 (07:38 +0200)]
man: document when system.pa is used instead of default.pa

8 years agocard: Only update port's preferred profile if profile is saved
David Henningsson [Thu, 26 Nov 2015 13:29:23 +0000 (14:29 +0100)]
card: Only update port's preferred profile if profile is saved

In case pa_card_set_profile is called with save=false, then probably
it makes more sense not to update the port's preferred profile as well.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoi18n: Updated zh_CN translation
Mingye Wang (Arthur2e5) [Sat, 21 Nov 2015 22:47:16 +0000 (17:47 -0500)]
i18n: Updated zh_CN translation

This patch updates zh_CN translation to 518 complete, 0 fuzzy and 3
untranslated.

8 years agonetbsd: NetBSD ships with paccept(2) a superset of Linux-specific accept4()
Kamil Rytarowski [Sat, 21 Nov 2015 22:08:23 +0000 (23:08 +0100)]
netbsd: NetBSD ships with paccept(2) a superset of Linux-specific accept4()

[diwic: Moved paccept to #bsd line in configure.ac]

8 years agoalsa-mixer: sb-omni-surround-5.1.conf: remove analog-surround-21, add Linux 4.3+...
Nazar Mokrynskyi [Sun, 11 Oct 2015 01:35:56 +0000 (03:35 +0200)]
alsa-mixer: sb-omni-surround-5.1.conf: remove analog-surround-21, add Linux 4.3+ support

In 2.1 mode LFE is not actually working at all, so it is removed.
With Linux 4.3-rc1+ Mic/Line are hw:%f,0,0 as it should be: https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/usb?id=5ee20bc792467d7d612157e0a9962765aa943b08
So now we support both Linux 4.2.x- and 4.3-rc1+ setups.
Also in Linux 4.3-rc1 S/PDIF input was detected incorrectly (there is no such hardware input), so it is not present in config.

8 years agomodule-card-restore: Remove "version" from internal entry struct
David Henningsson [Tue, 17 Nov 2015 14:10:36 +0000 (15:10 +0100)]
module-card-restore: Remove "version" from internal entry struct

If we always write entries of the latest version, we can simplify
code a little by only handling old versions in the "entry_read"
function and assume we have the latest version everywhere else.

Suggested-by: Tanu Kaskinen <tanuk@iki.fi>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agomodule-switch-on-port-available: Route to preferred profile
David Henningsson [Tue, 17 Nov 2015 14:10:35 +0000 (15:10 +0100)]
module-switch-on-port-available: Route to preferred profile

This makes the routing slightly more aggressive:

 * It will try to route to another profile, if such a profile
   is preferred by the port.

 * It will allow changing profiles on transitions both to
   PA_AVAILABLE_YES and PA_AVAILABLE_NO

To accommodate there is also some refactoring.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agomodule-switch-on-port-available: Use input and output names
David Henningsson [Tue, 17 Nov 2015 14:10:34 +0000 (15:10 +0100)]
module-switch-on-port-available: Use input and output names

In case input or output names are filled in, we can use this to
get a better match in the profile_good_for_input/output functions
instead of guessing based on number of sources and channels.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agocard-restore: Save and restore "preferred profile" of port
David Henningsson [Tue, 17 Nov 2015 14:10:33 +0000 (15:10 +0100)]
card-restore: Save and restore "preferred profile" of port

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agocard: Update preferred_profile for ports when profile changes
David Henningsson [Tue, 17 Nov 2015 14:10:32 +0000 (15:10 +0100)]
card: Update preferred_profile for ports when profile changes

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agodevice-port: Add preferred_profile field to pa_device_port
David Henningsson [Tue, 17 Nov 2015 14:10:31 +0000 (15:10 +0100)]
device-port: Add preferred_profile field to pa_device_port

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoalsa-mixer: Fill in input and output names
David Henningsson [Tue, 17 Nov 2015 14:10:30 +0000 (15:10 +0100)]
alsa-mixer: Fill in input and output names

Fill in input_name and output_name to make routing easier for
routing modules.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agocard: Add variables for splitting up a profile
David Henningsson [Tue, 17 Nov 2015 14:10:29 +0000 (15:10 +0100)]
card: Add variables for splitting up a profile

It can be useful for routing modules to know a profile's input
and output parts, in order to e g change output profile
while keeping the input profile unchanged.

For now filling in these fields is optional and a routing module
must be able to handle NULL in these fields.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agotests: Make echo-cancel-test not crash
Arun Raghavan [Wed, 21 Oct 2015 06:15:32 +0000 (11:45 +0530)]
tests: Make echo-cancel-test not crash

Adding AGC broke this test, so we hard-disable the volume code in test
mode. This is probably okay for now, since at least with analog AGC, the
source volume changes and the data we get is going to be with AGC
applied, but digital gain won't be encapsulated here.

Long term, we might need to figure out how to deal with this properly.

8 years agoalsa: Use helper function for byte conversion across sample specs
Arun Raghavan [Mon, 16 Nov 2015 14:07:20 +0000 (19:37 +0530)]
alsa: Use helper function for byte conversion across sample specs

8 years agosource: Deal with filter having more channels than the master
Arun Raghavan [Tue, 3 Nov 2015 17:12:08 +0000 (22:42 +0530)]
source: Deal with filter having more channels than the master

Without this, we hit an assert because the channel count in
new_reference (which was inherited from the master) is lower than the
channel count of the filter.

8 years agopulsecore/packet: avoid redefinition of pa_packet structure
Thomas Petazzoni [Tue, 17 Nov 2015 11:06:36 +0000 (12:06 +0100)]
pulsecore/packet: avoid redefinition of pa_packet structure

packet.h defines:

  typedef struct pa_packet pa_packet;

and packet.c defines:

  typedef struct pa_packet {
    ...
  } pa_packet;

With old versions of gcc (such as gcc 4.5) this causes a redefinition
error at compile time:

pulsecore/packet.c:43:3: error: redefinition of typedef 'pa_packet'
pulsecore/packet.h:26:26: note: previous declaration of 'pa_packet' was here

In order to fix this, this commit changes the definition in packet.c
to just:

  struct pa_packet {
    ...
  };

This way, the contents of the structure remain opaque to users of
pa_packet outside packet.c, and the 'pa_packet' type remains usable.

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

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8 years agosink: Make early drain reporting propagate down to filters
Arun Raghavan [Mon, 16 Nov 2015 14:13:18 +0000 (19:43 +0530)]
sink: Make early drain reporting propagate down to filters

The drain reporting improvements that were added to alsa-sink were only
being applied to directly connected sink inputs. This patch makes the
same logic also recurse down the filter hierarchy, so drains are
acknowledged more accurately (and not late) even if there is a filter
sink in between.

Also does some minor reorganisation of the code and sprinkles in some
comments as documentation.

8 years agoalsa-mixer: Return early in case of no mixer poll descriptors
David Henningsson [Fri, 6 Nov 2015 11:31:32 +0000 (12:31 +0100)]
alsa-mixer: Return early in case of no mixer poll descriptors

We encountered an alsa plugin a while ago (not sure if the source
can be shared) which had mixer controls, but no descriptors to
poll for changes.

Quit early to avoid latter assertion failures.

BugLink: https://bugs.launchpad.net/bugs/1092377
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoalsa-sink: Avoid unloading alsa-sink module before calling try_recover()
Zbigniew Kempczyński [Tue, 10 Nov 2015 06:51:46 +0000 (07:51 +0100)]
alsa-sink: Avoid unloading alsa-sink module before calling try_recover()

This fixes rare condition when pulseaudio client tries to rewind,
but a device previously reached underrun and was changed to XRUN state.

8 years agoalsa-mixer: Add "Front Headphone" to headset mic path
David Henningsson [Thu, 29 Oct 2015 14:13:17 +0000 (15:13 +0100)]
alsa-mixer: Add "Front Headphone" to headset mic path

The combination "Front Headphone" + "Headset Mic Phantom"
was found on one the machines we enable. Without this patch,
the headset mic appeared plugged in when nothing was plugged
into the jack.

BugLink: https://bugs.launchpad.net/bugs/1513384
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agobuild: Add IRC notifications to Travis
Arun Raghavan [Fri, 6 Nov 2015 14:19:14 +0000 (19:49 +0530)]
build: Add IRC notifications to Travis

8 years agotests: Set appropriate timeouts for a couple of tests
Arun Raghavan [Mon, 2 Nov 2015 06:16:46 +0000 (11:46 +0530)]
tests: Set appropriate timeouts for a couple of tests

sync-playback just had a much longer timeout than it should have, and
extended-test was using the default. We set the expected amount of time,
so the test is more correct (if it takes longer than this, something
probably actually broke).

8 years agoresampler: Don't expose soxr methods if they are not supported
Arun Raghavan [Fri, 6 Nov 2015 10:24:55 +0000 (15:54 +0530)]
resampler: Don't expose soxr methods if they are not supported

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

8 years agortp: fix non null terminated string / non portable sscanf
Lev Melnikovsky [Wed, 4 Nov 2015 10:42:21 +0000 (12:42 +0200)]
rtp: fix non null terminated string / non portable sscanf

In rtp.c:

if (sscanf(t+9, "%i %64c", &_payload, c) == 2)

the string c seems to be non-null terminated. It is later used as
following:

c[strcspn(c, "\n")] = 0;

The same piece of code is responsible for the inability of pulseaudio
on OpenWRT to handle RTP stream at the rate 48000 from another
machine:

[pulseaudio] sdp.c: Failed to parse SDP data: missing data.

It turns out that uClibc does not agree with glibc about "%64c", see
http://git.uclibc.org/uClibc/tree/docs/Glibc_vs_uClibc_Differences.txt

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=92568
8 years agosoxr: Use soxr_clear() if libsoxr version is 0.1.2 or later.
Andrey Semashev [Sat, 31 Oct 2015 15:59:46 +0000 (18:59 +0300)]
soxr: Use soxr_clear() if libsoxr version is 0.1.2 or later.

The 0.1.2 version of libsoxr fixes soxr_process() crash after soxr_clear() is used, so check the library version at compile time and use soxr_clear() if possible.

8 years agoscripts: Plot memory benchmarks using gnuplot
Ahmed S. Darwish [Wed, 23 Sep 2015 16:33:05 +0000 (18:33 +0200)]
scripts: Plot memory benchmarks using gnuplot

Now that we have memory usage benchmarks collected at our disposal,
introduce a gnuplot script to plot the newest version.

To avoid scaling issues, memory is plotted in a "double y axis" form,
with VM usage on the left, and dirty RSS memory usage on the right.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
8 years agoscripts: Introduce benchmark_memory_usage.sh
Ahmed S. Darwish [Wed, 23 Sep 2015 16:30:16 +0000 (18:30 +0200)]
scripts: Introduce benchmark_memory_usage.sh

Add shell script to sample PulseAudio memory usage while increasing
the number of connected 'paplay' clients over time.

Linux kernel /proc/$PID/smaps Private and Shared_Dirty fields are used
to accurately measure the total size of used dirty pages over time.
This shall be useful for benchmarking the PA daemon's memory while
introducing new features like per-client SHM access and memfds.

Also add an empty benchmarks-collection directory 'benchmarks/'. All
output from the benchmarking tools shall be saved in this place, with
timestamps and symbolic links to the newest versions.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
8 years agopacmd: Fix typo in set-default-* help
Peter Mattern [Wed, 14 Oct 2015 16:39:50 +0000 (18:39 +0200)]
pacmd: Fix typo in set-default-* help

which was causing faulty output when running 'pacmd --help' on the shell

8 years agovolume: Add LFE balance API
David Henningsson [Tue, 27 Oct 2015 08:54:39 +0000 (09:54 +0100)]
volume: Add LFE balance API

The gnome/unity-control-center UIs have a master volume slider, and
three sub-sliders: balance, fade, and subwoofer. Balance and fade
use PA's set_balance and set_fade APIs accordingly, but the subwoofer
slider sometimes does unintuitive things.

In order to make that slider behave better, let's add a LFE balance
API that these volume control UIs can use instead. With this API,
the UI can balance between "no subwoofer" and "only subwoofer" with
"equal balance" in the middle, which would make it more consistent
with the behaviour of the other sliders.

BugLink: https://bugzilla.gnome.org/show_bug.cgi?id=753847
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agovolume: Refactor get/set balance/fade
David Henningsson [Tue, 27 Oct 2015 08:54:38 +0000 (09:54 +0100)]
volume: Refactor get/set balance/fade

get/set balance and fade use very similar code, so refactor out
common parts.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoalsa-ucm: fix pa_device_port.profiles leak
Tanu Kaskinen [Fri, 23 Oct 2015 10:56:40 +0000 (13:56 +0300)]
alsa-ucm: fix pa_device_port.profiles leak

pa_device_port.profiles is initialized in pa_device_port_new(), so no
need to do that in alsa-ucm.c.

8 years agonull-sink: correct update of timestamp when state changes to RUNNING or IDLE
Georg Chini [Sat, 24 Oct 2015 11:00:39 +0000 (13:00 +0200)]
null-sink: correct update of timestamp when state changes to RUNNING or IDLE

u->timestamp should be reset to "now" when the sink state changes from
INIT or SUSPENDED to IDLE or RUNNING.
Thanks to Olivier Delbeke for reporting the bug and testing the patch.
Bug report is here:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-October/024553.html

8 years agoalsa-mixer: Ignore volume with unexpected number of channels
David Henningsson [Mon, 19 Oct 2015 09:16:37 +0000 (11:16 +0200)]
alsa-mixer: Ignore volume with unexpected number of channels

We currently only support one and two channels for volumes, and
bail out otherwise. This makes Xonar users unhappy because they
have a volume with eight channels, and bailing out means they
don't have a path/port at all.

This way they will at least have a port, which will in turn make
the gnome/unity UI behave better.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=84983
BugLink: https://bugzilla.gnome.org/show_bug.cgi?id=745017
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agothread-mainloop: keep SIGSYS unblocked if currently trapped
Julien Isorce [Mon, 19 Oct 2015 22:29:53 +0000 (23:29 +0100)]
thread-mainloop: keep SIGSYS unblocked if currently trapped

Seccomp-BPF uses SIGSYS signal to trigger
the trap handler attached to sys_open.
If the signal is blocked then the kernel kills
the process whenever pulse audio calls 'open'.
The result backtrace is terminating in sys_open.

That's why it is required to keep SIGSYS unblocked
if it is currently unblocked and trapped.

This patch allows to have pulse audio working
in the Chromium sandbox.

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Signed-off-by: Arun Raghavan <git@arunraghavan.net>
8 years agogit-version-gen: Avoid further processing when tarball-version is present
Ross Burton [Tue, 20 Oct 2015 14:55:23 +0000 (16:55 +0200)]
git-version-gen: Avoid further processing when tarball-version is present

In case a tarball-version file is present, use that and quit.

Otherwise git will continue looking for directories, potentially
finding .git directories which are dirty and mark the version as such.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90936
8 years agopstream: Fix use-after-free in srb_callback
David Henningsson [Fri, 16 Oct 2015 20:12:32 +0000 (22:12 +0200)]
pstream: Fix use-after-free in srb_callback

We need to guard the pstream with an extra ref to ensure
it is not destroyed at the time we check whether or not the
srbchannel is destroyed.

Reported-by: Takashi Iwai <tiwai@suse.de>
BugLink: http://bugzilla.opensuse.org/show_bug.cgi?id=950487
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agomodule-alsa-card: Report available ports before unavailable ones
David Henningsson [Tue, 5 May 2015 15:01:13 +0000 (17:01 +0200)]
module-alsa-card: Report available ports before unavailable ones

In case the same jack causes one port to become available and another
one unavailable, the available should be reported first.

This is to avoid unnecessary changes: e g, consider a 'Headphone Jack'
making 'Headphone' available and 'Speaker' unavailable. In case the
unavailable change triggers first, and there is also a currently available
third port (e g 'Digital out'), the routing system might choose to route
to this port because neither of the 'Speaker' and 'Headphone' ports are
available.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agomake availability of ports visible over dbus
John Horan [Sun, 19 Apr 2015 14:29:27 +0000 (15:29 +0100)]
make availability of ports visible over dbus

8 years agodbus: Add card profile availability info to API
Juho Hämäläinen [Thu, 19 Mar 2015 11:51:00 +0000 (13:51 +0200)]
dbus: Add card profile availability info to API

[diwic: Profile availability to boolean bug fixed]

8 years agocore-util: avoid calling fchmod if already right mode
Julien Isorce [Sat, 10 Oct 2015 19:11:21 +0000 (20:11 +0100)]
core-util: avoid calling fchmod if already right mode

fchmod is denied in chromium sandbox.

8 years agocard: Use pa_xmalloc0 when creating card profiles
David Henningsson [Tue, 5 May 2015 15:01:07 +0000 (17:01 +0200)]
card: Use pa_xmalloc0 when creating card profiles

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoshm: Warn on not being able to open shm files
David Henningsson [Mon, 28 Sep 2015 13:41:15 +0000 (15:41 +0200)]
shm: Warn on not being able to open shm files

With the exception of when trying to clean up shm files,
it's useful to warn if opening them fails, regardless of reason.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agocard: Use pa_xnew0 when creating a card
David Henningsson [Mon, 28 Sep 2015 12:37:49 +0000 (14:37 +0200)]
card: Use pa_xnew0 when creating a card

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agoclient: Use pa_xnew0 when creating a client
David Henningsson [Mon, 28 Sep 2015 12:36:23 +0000 (14:36 +0200)]
client: Use pa_xnew0 when creating a client

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agobuild-sys: fix the default bash completion directory
Tanu Kaskinen [Sun, 27 Sep 2015 13:48:18 +0000 (16:48 +0300)]
build-sys: fix the default bash completion directory

If bashcompletiondir was empty, the check didn't catch that. As
a result, the symlinks that were supposed to be generated in the
completion directory were created in the root directory.

8 years agobuild-sys: bootstrap.sh: Do a make only if configure has succeeded
Ahmed S. Darwish [Fri, 18 Sep 2015 23:59:02 +0000 (01:59 +0200)]
build-sys: bootstrap.sh: Do a make only if configure has succeeded

Otherwise the important configure script error messages get buried
by the "make clean" output.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
8 years agoalsa-mixer: Add "Dock Line Out" jack handling to analog-output-speaker-always
Tanu Kaskinen [Fri, 18 Sep 2015 06:59:45 +0000 (09:59 +0300)]
alsa-mixer: Add "Dock Line Out" jack handling to analog-output-speaker-always

The jack is already in analog-output-speaker, so let's have the same
handling in analog-output-speaker-always too.

8 years agoalsa-mixer: Recognize "Dock Line Out" jack
Takashi Iwai [Mon, 15 Jun 2015 15:06:41 +0000 (17:06 +0200)]
alsa-mixer: Recognize "Dock Line Out" jack

Some machines provide "Dock Line Out Jack" control that should be
handled like a normal line out.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agobluetooth: bluez4: Remove the unused "auto_connect" parameter as it is not used in...
Manish Sogi [Mon, 15 Jun 2015 12:16:05 +0000 (17:46 +0530)]
bluetooth: bluez4: Remove the unused "auto_connect" parameter as it is not used in bluez4

<EP-F69A421D31544C56BDE97C590307C014>
Signed-off-by: Manish Sogi <manish.sogi@samsung.com>
8 years agoalsa-mixer: Add "Mic Boost" and "Line Boost" to analog-input.conf
David Henningsson [Tue, 15 Sep 2015 11:09:14 +0000 (13:09 +0200)]
alsa-mixer: Add "Mic Boost" and "Line Boost" to analog-input.conf

I'm not sure how much they are needed nowadays with the latest
changes to the subset elimination (I found this while
researching a bug on an older PA version), but I guess they could
be added for consistency at least.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8 years agolog: Fix compilation error on non-systemd systems
Ahmed S. Darwish [Wed, 16 Sep 2015 21:38:38 +0000 (23:38 +0200)]
log: Fix compilation error on non-systemd systems

Commit 262bdae0330e used symbols which are only available if systemd
support was compiled in. Fix by using the appropriate #ifdef guards.

Also document the resulting PULSE_LOG_JOURNAL environment variable
behavior if systemd journal support was not compiled in.

[Diwic: changed wording slightly.]

Reported-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
8 years agolog: Introduce PULSE_LOG_JOURNAL environment variable
Ahmed S. Darwish [Fri, 14 Aug 2015 16:47:32 +0000 (18:47 +0200)]
log: Introduce PULSE_LOG_JOURNAL environment variable

By introducing such an environment variable, applications using the
PA client libraries can configure these libraries to send their logs
directly to the journal.

While client libraries journal logging can be indirectly achieved
using PULSE_LOG_SYSLOG, this pollutes the journal. Meta data gets
replicated twice: once in the journal meta fields and once in the
syslog(3) plain-text message itself.

For attaching any backtraces, also introduce the PA-specific journal
meta field PULSE_BACKTRACE. This is the recommend journal practice
instead of appending any furuther data to the logging message itself.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
8 years agopulseaudio.1: document that systemd notification only works without daemonization
Felipe Sateler [Thu, 13 Aug 2015 22:58:28 +0000 (19:58 -0300)]
pulseaudio.1: document that systemd notification only works without daemonization

8 years agodaemon: Use Type=notify for systemd service
Felipe Sateler [Thu, 13 Aug 2015 22:58:27 +0000 (19:58 -0300)]
daemon: Use Type=notify for systemd service

This ensures systemd knows when pulseaudio finishes loading, thus never
marking pulseaudio as active if startup fails.

8 years agoRename functions with "tostring" in the name to one with "to_string" to conform with...
Deepak Srivastava [Fri, 12 Jun 2015 12:47:07 +0000 (18:17 +0530)]
Rename functions with "tostring" in the name to one with "to_string" to conform with the convention.

component: core

<EP-E358F00C1D9A449EAE69225B9D2530F8>
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88833
Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
8 years agocore: Fallbacks for machine-id in filesystem
Peter Meerwald [Tue, 9 Jun 2015 19:56:36 +0000 (21:56 +0200)]
core: Fallbacks for machine-id in filesystem

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

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
8 years agobuild-sys: don't use the nodelete linker flag on executables
Shawn Walker [Tue, 11 Aug 2015 14:22:37 +0000 (16:22 +0200)]
build-sys: don't use the nodelete linker flag on executables

The nodelete flag indicates that we don't want our libraries to be
unloaded. It's only relevant on libraries, so let's not use it for
executables. Trying to use it on executables breaks things on some
platforms.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90878
8 years agoUpdate NEWS for 7.0 release v7.0
Arun Raghavan [Thu, 24 Sep 2015 03:23:06 +0000 (08:53 +0530)]
Update NEWS for 7.0 release

8 years agoi18n: Update Slovak translation
Dušan Kazik [Wed, 23 Sep 2015 07:49:25 +0000 (13:19 +0530)]
i18n: Update Slovak translation

8 years agotests: Fix test-suite failure on Alpha
Michael Cree [Tue, 15 Sep 2015 04:38:41 +0000 (10:08 +0530)]
tests: Fix test-suite failure on Alpha

Pulseaudio fails to build on the Alpha architecture due to a failure
in the volume-test of the test suite.  I had reported this to the
Debian bug tracker [1] but the maintainer has asked that I forward the
patch to this mail list.  The failure in volume-test occurs because it
is compiled with -ffast-math which implies -ffinite-math-only of which
the gcc manual states that it optimizes for floating-point arithmetic
with the assumption that arguments and results are not NaNs or
+/-infinity, and futher notes that it may result in incorrect output.
On the Alpha platform that is somewhat an understatement as the use of
non-finite floating-point arithmetic with -ffinite-math-only results in
a floating-point exception and the termination of the program.

The volume-test converts volumes into decibels (so a zero volume
becomes a negative infinity) and proceeds to add two volumes (in
decibels), thus does arithmetic with non-finite floating point numbers
despite being compiled with -ffast-math!

I attach a patch that protects against the arithmetic with non-finite
numbers for your consideration.  With that patch the test-suite passes
on Alpha.

Cheers
Michael.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798248

8 years agolfe-filter: Deal with empty input chunks
Arun Raghavan [Thu, 17 Sep 2015 04:14:49 +0000 (09:44 +0530)]
lfe-filter: Deal with empty input chunks

It is possible that we get a zero-length memchunk to work with.
Specifically, this happens the resampler (which is called before the
lfe-filter) consumes all the input data, but does not (yet) produce any
output data.

Reproduced using:

  pulseaudio --resample-method=soxr-mq
  pactl load-module module-null-sink sink_name=lfe_test channels=3 channel_map=front-left,front-right,lfe
  paplay --raw /dev/zero --rate=48000 -d lfe_test

Thanks to the original reporter for the backtrace:

Bug: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1496577

8 years agomodules: Fix entry leak in module-card-restore
Peter Meerwald [Mon, 14 Sep 2015 15:23:29 +0000 (17:23 +0200)]
modules: Fix entry leak in module-card-restore

CID 1323585

entry_read() allocates an entry which must be freed

8 years agocore: Add missing return on protocol error
Peter Meerwald [Mon, 14 Sep 2015 15:50:36 +0000 (17:50 +0200)]
core: Add missing return on protocol error

CID 1323582

when a protocol error occors, better bail out :)