platform/upstream/pulseaudio.git
8 years agobuild-sys: Move to compiling with C11 support
Arun Raghavan [Wed, 17 Feb 2016 14:17:05 +0000 (19:47 +0530)]
build-sys: Move to compiling with C11 support

This is needed for building with anonymous unions. A bunch of calls to
fail() that used to mysteriously work need fixing -- fail() is a macro
that takes a printf-style message as an argument. Not passing this
somehow worked with the previous compiler flags, but breaks with
-std=c11.

8 years agoecho-cancel: Add a modarg toggle for VAD in the webrtc canceller
Arun Raghavan [Wed, 17 Feb 2016 14:17:04 +0000 (19:47 +0530)]
echo-cancel: Add a modarg toggle for VAD in the webrtc canceller

8 years agoecho-cancel: Allow enabling of the webrtc experimental AGC mechanism
Arun Raghavan [Wed, 17 Feb 2016 14:17:03 +0000 (19:47 +0530)]
echo-cancel: Allow enabling of the webrtc experimental AGC mechanism

8 years agoecho-cancel: Start capture at a sane volume if we're doing webrtc AGC
Arun Raghavan [Wed, 17 Feb 2016 14:17:02 +0000 (19:47 +0530)]
echo-cancel: Start capture at a sane volume if we're doing webrtc AGC

This is required to make sure the capture output has sufficient energy
for the AGC to do its job.

8 years agoecho-cancel: Deal with volume limit breakage in webrtc AGC
Arun Raghavan [Wed, 17 Feb 2016 14:17:01 +0000 (19:47 +0530)]
echo-cancel: Deal with volume limit breakage in webrtc AGC

The AGC code no longer seems to honour the analog volume limits we set,
and internally uses 0-255 as the volume range. So we switch to use that
(keeping the old API usage as is in case this gets fixed upstream).

8 years agoecho-cancel: Allow enabling tracing output from the webrtc canceller
Arun Raghavan [Wed, 17 Feb 2016 14:17:00 +0000 (19:47 +0530)]
echo-cancel: Allow enabling tracing output from the webrtc canceller

8 years agoecho-cancel: Mark private function as static
Arun Raghavan [Wed, 17 Feb 2016 14:16:59 +0000 (19:46 +0530)]
echo-cancel: Mark private function as static

8 years agoecho-cancel: Add a modarg to use sink/source master format and spec
Arun Raghavan [Wed, 17 Feb 2016 14:16:58 +0000 (19:46 +0530)]
echo-cancel: Add a modarg to use sink/source master format and spec

This allows us to inherit the sample spec parameters from the sink and
source master (rather than forcing 32 kHz / mono). It is still possible
to override some of the parameters for the source side with modargs.

My original testing showed that these parameters provided a decent
perf/quality trade-off on lower end hardware (which I no longer have
access to). I figure it makes sense to continue with that for now, and
in the future this can be relaxed (use_master_format=yes could be the
default, and resource-constrained systems can disable it).

8 years agoecho-cancel: Express restrictions correctly on webrtc AEC stream config
Arun Raghavan [Wed, 17 Feb 2016 14:16:57 +0000 (19:46 +0530)]
echo-cancel: Express restrictions correctly on webrtc AEC stream config

In the refactoring, I'm expressing the constraints in what I see to be a
more natural way -- rec_ss expresses what we're feeding the canceller,
so it makes sense to apply the constraints on what the canceller accepts
there. This then propagates to the output spec.

This also exposes the range of sample rates that the library actually
supports (8, 16, 32 and 48 kHz).

8 years agoecho-cancel: Canceller may use different spec for playback and capture
Arun Raghavan [Wed, 17 Feb 2016 14:16:56 +0000 (19:46 +0530)]
echo-cancel: Canceller may use different spec for playback and capture

The original intention was to configure low enough parameters to keep
CPU consumption down. Prior to this change, we assumed that the EC
backend would override the sink parameters based on the source
parameters to achieve this goal, and with this change we remove that
assumption by forcing the default parameters for the sink to be low
enough.

8 years agoecho-cancel: Add some bits for webrtc intelligibility enhancer
Tanu Kaskinen [Sat, 20 Feb 2016 12:32:59 +0000 (14:32 +0200)]
echo-cancel: Add some bits for webrtc intelligibility enhancer

It's not possible to enable the intelligibility enhancer at the
moment, because the feature would require modifying the audio that we
play to speakers, which we don't do currently. All audio processing is
done at the source side, and it's not easy to change that.

This patch is based on Arun Raghavan's code, I just reordered things
a bit and reworded the FIXME comment.

8 years agoecho-cancel: Allow enabling the extended filter in webrtc AEC
Arun Raghavan [Wed, 17 Feb 2016 14:16:54 +0000 (19:46 +0530)]
echo-cancel: Allow enabling the extended filter in webrtc AEC

This creates a longer filter that is more complex and less sensitive to
incorrect delay reporting from the hardware. There is also a
delay-agnostic mode that can eventually be enabled if required.

In some very quick testing, not enabling this seems to provide better
results during double-talk.

8 years agoecho-cancel: Update webrtc-audio-processing usage to new API
Arun Raghavan [Wed, 17 Feb 2016 14:16:53 +0000 (19:46 +0530)]
echo-cancel: Update webrtc-audio-processing usage to new API

The code now needs C++11 support to compile with the updated
webrtc-audio-processing library.

8 years agocore: Fix GCC 6 compiler warning regarding left shift of negative value
Peter Meerwald [Mon, 15 Feb 2016 22:05:03 +0000 (23:05 +0100)]
core: Fix GCC 6 compiler warning regarding left shift of negative value

In file included from pulse/timeval.c:32:0:
pulse/timeval.c: In function 'pa_timeval_add':
./pulsecore/macro.h:303:28: warning: left shift of negative value [-Wshift-negative-value]
              ? ~(~(type) 0 << (8*sizeof(type)-1))

reported by Ubuntu gcc-6

gcc-6 adds -Wshift-negative-value (enabled by -Wextra) which warns
about left shifting a negative value. Such shifts are undefined
because they depend on the representation of negative values.

also works with -Wshift-overflow=2

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
8 years agomodules: Fix compiler warning comparing 0 with bool
Peter Meerwald [Wed, 13 Jan 2016 22:52:11 +0000 (23:52 +0100)]
modules: Fix compiler warning comparing 0 with bool

modules/module-stream-restore.c: In function 'clean_up_db':
modules/module-stream-restore.c:2344:74: warning: comparison of constant '0' with boolean expression is always true [-Wbool-compare]
         pa_assert_se(entry_write(u, item->entry_name, item->entry, true) >= 0);

reported by Ubuntu gcc-6

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
8 years agorole-ducking: Fix improper unducking behavior in case of operating globally
Sangchul Lee [Thu, 11 Feb 2016 14:11:21 +0000 (23:11 +0900)]
role-ducking: Fix improper unducking behavior in case of operating globally

Fix improper unducking behavior when using this module with "global=1" argument.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=93994
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
8 years agocoreaudio: Catch devices with more channels than we support
Arun Raghavan [Mon, 4 Jan 2016 07:03:11 +0000 (12:33 +0530)]
coreaudio: Catch devices with more channels than we support

8 years agocoreaudio: Dynamically allocate C string when converting from CFString
Arun Raghavan [Mon, 4 Jan 2016 06:46:01 +0000 (12:16 +0530)]
coreaudio: Dynamically allocate C string when converting from CFString

8 years agobuild-sys: Only use sysroot in OS X CFLAGS if specified
Arun Raghavan [Mon, 4 Jan 2016 05:47:29 +0000 (11:17 +0530)]
build-sys: Only use sysroot in OS X CFLAGS if specified

The default value doesn't make sense any more, so we'll only use this if
explicitly specified.

8 years agodefault.pa: remove X11 module examples
Tanu Kaskinen [Sat, 6 Feb 2016 13:35:31 +0000 (15:35 +0200)]
default.pa: remove X11 module examples

Loading X stuff from default.pa is a bad idea, since it doesn't work
if there are multiple X sessions, or PulseAudio is started outside the
X session. Since it's a bad idea, don't encourage it by including
examples that do so.

I also removed the sample loading examples. I don't think the examples
are particularly useful, since nothing uses the loaded samples once
module-x11-bell is removed from the configuration.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=93109
8 years agoglib: Trivial whitespace fix
Arun Raghavan [Tue, 9 Feb 2016 10:49:00 +0000 (16:19 +0530)]
glib: Trivial whitespace fix

8 years agorescue-streams : Fix a typo
Jungsup Lee [Tue, 2 Feb 2016 04:47:57 +0000 (13:47 +0900)]
rescue-streams : Fix a typo

Fix a typo in log message.

Signed-off-by: Jungsup Lee <jungsup4.lee@samsung.com>
8 years agodevice-manager: improve logging about non-existing data
Tanu Kaskinen [Tue, 26 Jan 2016 12:57:32 +0000 (14:57 +0200)]
device-manager: improve logging about non-existing data

Previously a missing key would cause this kind of log output:

D: [pulseaudio] module-device-manager.c: Database contains invalid data for key: sink:auto_null (probably pre-v1.0 data)
D: [pulseaudio] module-device-manager.c: Attempting to load legacy (pre-v1.0) data for key: sink:auto_null
D: [pulseaudio] module-device-manager.c: Size does not match.
D: [pulseaudio] module-device-manager.c: Unable to load legacy (pre-v1.0) data for key: sink:auto_null. Ignoring.

That is now replaced with

D: [pulseaudio] module-device-manager.c: Database contains no data for key: sink:auto_null

8 years agosolaris: Illumos does not ship with SOUND_PCM* functionality
Kamil Rytarowski [Mon, 21 Dec 2015 03:10:35 +0000 (04:10 +0100)]
solaris: Illumos does not ship with SOUND_PCM* functionality

Code reference:
https://github.com/joyent/illumos-joyent/blob/master/usr/src/uts/common/sys/audio/audio_oss.h

Add autoconf checks for:
- SOUND_PCM_READ_RATE
- SOUND_PCM_READ_CHANNELS
- SOUND_PCM_READ_BITS

Some platforms like SunOS (Illumos) may ship without SOUND_PCM_* functionality

Thanks to Jonathan Perkin (Joyent) for Illumos code reference.

8 years agosolaris: Catch up with newer API
Jonathan Perkin [Mon, 21 Dec 2015 03:10:34 +0000 (04:10 +0100)]
solaris: Catch up with newer API

Patch upstreamed from pkgsrc by Kamil Rytarowski <n54@gmx.com>.

See commit e4a7625ba884c5cce20468d75937857343751c35 for why this was
originally done.

8 years agovala: Added cnames to callback delegates in Vala VAPI
Marcin Lewandowski [Sat, 16 Jan 2016 14:42:34 +0000 (15:42 +0100)]
vala: Added cnames to callback delegates in Vala VAPI

8 years agosource-output: remap volume_factor_source when starting move
Tanu Kaskinen [Thu, 7 Jan 2016 13:25:41 +0000 (15:25 +0200)]
source-output: remap volume_factor_source when starting move

This gets rid of an error message from the debug log. If
volume_factor_source would actually be used somewhere, this bug would
have caused more severe problems.

volume_factor_source should have the source's channel map. When moving
the stream, the volume needs to be remapped from the old source's
channel map to the new source's map. However, when the stream is being
moved, there is a period where the old source has already been
forgotten and the new source isn't yet known, so the remapping can't
be done directly between the two channel maps. Instead, the volume is
remapped from the old source's map to the stream's own map when the
move starts, and again remapped from the stream's map to the new
source's map when the move finishes.

The first remapping was missing, causing the second remapping fail and
print an error to the log.

(I checked the sink input code as well. It didn't have this bug.)

8 years agosource-output: do volume_factor_source application before resampling
Tanu Kaskinen [Thu, 7 Jan 2016 13:25:40 +0000 (15:25 +0200)]
source-output: do volume_factor_source application before resampling

Applying the volume after resampling means mismatch between the volume
channel map and the data channel map.

volume_factor_source is not currently used anywhere, so this bug
hasn't been causing any problems. I noticed it while reading the code.

8 years agopulse: Bump PA_RATE_MAX to 384 kHz
Arun Raghavan [Thu, 31 Dec 2015 03:58:28 +0000 (09:28 +0530)]
pulse: Bump PA_RATE_MAX to 384 kHz

This will likely be needed in the future when we start supporting high
bitrate passthrough, and there actually seem to be people 352/384 kHz
out there (potentially as an intermediate production step).

8 years agoformat: Make pa_format_info_valid() stricter for PCM
Arun Raghavan [Thu, 31 Dec 2015 03:57:56 +0000 (09:27 +0530)]
format: Make pa_format_info_valid() stricter for PCM

We should do stricter validation when we can.

8 years agoUpdate NEWS for 8.0 v8.0
Arun Raghavan [Fri, 22 Jan 2016 07:31:36 +0000 (13:01 +0530)]
Update NEWS for 8.0

8 years agobluetooth: Prevent aborts caused by invalid module arguments
Jason Gerecke [Thu, 14 Jan 2016 04:27:39 +0000 (20:27 -0800)]
bluetooth: Prevent aborts caused by invalid module arguments

If 'pa_modargs_new' returns a NULL, we need to be careful to not call
'pa_modargs_free' in the failure path since it requires that we pass it
a non-null argument. Also updates 'module-bluetooth-policy.c:pa__init'
to follow the standard "goto fail" pattern used everywhere else.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
8 years agobuild-sys: Use #ifdef with HAVE_FAST_64BIT_OPERATIONS
Arun Raghavan [Fri, 15 Jan 2016 10:39:49 +0000 (16:09 +0530)]
build-sys: Use #ifdef with HAVE_FAST_64BIT_OPERATIONS

The define is made conditionally.

Reported by: Kamil Rytarowski <n54@gmx.com>

8 years agostream: Clarify pa_stream_writable_size() documentation
Arun Raghavan [Tue, 12 Jan 2016 10:01:06 +0000 (15:31 +0530)]
stream: Clarify pa_stream_writable_size() documentation

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.

9 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

9 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

9 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()

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

9 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>
9 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>
9 years agoloopback: Validate the rate parameter
Georg Chini [Wed, 25 Feb 2015 18:43:24 +0000 (19:43 +0100)]
loopback: Validate the rate parameter

9 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
9 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

9 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.

9 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.

9 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>
9 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>
9 years agonetbsd: Revamp NetBSD platform checks
Kamil Rytarowski [Tue, 8 Dec 2015 03:22:42 +0000 (04:22 +0100)]
netbsd: Revamp NetBSD platform checks

9 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)

9 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

9 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

9 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()

9 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]

9 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

9 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>.

9 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>
9 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.

9 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

9 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>
9 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.

9 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]

9 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.

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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.

9 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

9 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.

9 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>
9 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.

9 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>
9 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.

9 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>
9 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

9 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).

9 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
9 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
9 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.

9 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>
9 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>
9 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

9 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>