Commit graph

8189 commits

Author SHA1 Message Date
Arun Raghavan
aa02e1654b 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.
2016-02-25 09:09:13 +05:30
Arun Raghavan
8949ed96c6 echo-cancel: Add a modarg toggle for VAD in the webrtc canceller 2016-02-25 09:09:12 +05:30
Arun Raghavan
90608feac0 echo-cancel: Allow enabling of the webrtc experimental AGC mechanism 2016-02-25 09:09:12 +05:30
Arun Raghavan
19fb2481ea 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.
2016-02-25 09:09:12 +05:30
Arun Raghavan
a84d65d748 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).
2016-02-25 09:09:12 +05:30
Arun Raghavan
426c98acbb echo-cancel: Allow enabling tracing output from the webrtc canceller 2016-02-25 09:09:12 +05:30
Arun Raghavan
6431636fe1 echo-cancel: Mark private function as static 2016-02-25 09:09:12 +05:30
Arun Raghavan
0c86543c51 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).
2016-02-25 09:09:12 +05:30
Arun Raghavan
23ef491122 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).
2016-02-25 09:09:05 +05:30
Arun Raghavan
d777838fbb 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.
2016-02-24 18:43:58 +02:00
Tanu Kaskinen
fab8a16b0f 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.
2016-02-24 18:43:58 +02:00
Arun Raghavan
a14db55c2b 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.
2016-02-24 18:43:58 +02:00
Arun Raghavan
f8beaae238 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.
2016-02-24 18:43:58 +02:00
Peter Meerwald
93822f98f4 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>
2016-02-18 14:08:13 +01:00
Peter Meerwald
571aadfe3b 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>
2016-02-18 14:08:13 +01:00
Sangchul Lee
d049c2941e 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>
2016-02-18 15:09:14 +05:30
Arun Raghavan
3977a906e2 coreaudio: Catch devices with more channels than we support 2016-02-12 19:34:58 +05:30
Arun Raghavan
cf503f9560 coreaudio: Dynamically allocate C string when converting from CFString 2016-02-12 19:34:58 +05:30
Arun Raghavan
3314dc72ea 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.
2016-02-12 19:25:00 +05:30
Tanu Kaskinen
3813caf4fb 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
2016-02-09 13:04:49 +02:00
Arun Raghavan
54bb94b577 glib: Trivial whitespace fix 2016-02-09 16:19:00 +05:30
Jungsup Lee
2086fc82b6 rescue-streams : Fix a typo
Fix a typo in log message.

Signed-off-by: Jungsup Lee <jungsup4.lee@samsung.com>
2016-02-02 14:56:36 +05:30
Tanu Kaskinen
323dc5bfb9 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
2016-01-26 15:46:20 +02:00
Kamil Rytarowski
a1191874fe 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.
2016-01-22 13:25:29 +05:30
Jonathan Perkin
68216e8ff8 solaris: Catch up with newer API
Patch upstreamed from pkgsrc by Kamil Rytarowski <n54@gmx.com>.

See commit e4a7625ba8 for why this was
originally done.
2016-01-22 13:25:29 +05:30
Marcin Lewandowski
81d3eb8467 vala: Added cnames to callback delegates in Vala VAPI 2016-01-22 13:25:29 +05:30
Tanu Kaskinen
6a754ad4a9 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.)
2016-01-22 13:25:29 +05:30
Tanu Kaskinen
b2e7cf6521 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.
2016-01-22 13:25:29 +05:30
Arun Raghavan
a958297fc8 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).
2016-01-22 13:25:29 +05:30
Arun Raghavan
12a202c510 format: Make pa_format_info_valid() stricter for PCM
We should do stricter validation when we can.
2016-01-22 13:25:29 +05:30
Arun Raghavan
7f6c4e6ed0 Update NEWS for 8.0 2016-01-22 13:01:36 +05:30
Jason Gerecke
00ba340618 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>
2016-01-15 16:20:53 +05:30
Arun Raghavan
f8c69de418 build-sys: Use #ifdef with HAVE_FAST_64BIT_OPERATIONS
The define is made conditionally.

Reported by: Kamil Rytarowski <n54@gmx.com>
2016-01-15 16:10:46 +05:30
Arun Raghavan
c3c4937b4f stream: Clarify pa_stream_writable_size() documentation 2016-01-12 15:31:06 +05:30
Arun Raghavan
2ae2dab307 sink-input, source-output: Add some debug output on start_move() 2016-01-12 08:40:51 +05:30
Kamil Rytarowski
7c1a5d6159 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
2016-01-08 14:23:37 +01:00
jungsup lee
13664cd977 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>
2016-01-07 18:01:20 +05:30
KimJeongYeon
19c71ce851 module-tunnel: Fix double free
Local pointer 'dn' freed again when pa_thread_new() failed.

Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
2016-01-07 17:59:15 +05:30
Mihai Moldovan
403ba1e676 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>
2016-01-04 12:39:21 +05:30
Mihai Moldovan
cf91aaa2b6 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>
2016-01-04 12:39:21 +05:30
Mihai Moldovan
48c91d52f9 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>
2016-01-04 12:39:21 +05:30
Mihai Moldovan
51caceb770 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>
2016-01-04 12:39:20 +05:30
Arun Raghavan
810aa36189 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.
2015-12-29 06:00:14 +05:30
Felipe Sateler
5e8161448e build-sys: Fix install order of libpulsecore
It needs to be installed after libpulse, because of libtool relinking.
2015-12-29 05:36:50 +05:30
Felipe Sateler
cd74d8f013 travis: Run make install in travis.
This helps detect ordering problems in the install target
2015-12-29 05:36:50 +05:30
Tanu Kaskinen
ca7b0722f1 build-sys: add typedefs.h to libpulsecore SOURCES
Without this the file doesn't get included in tarballs.
2015-12-27 14:53:55 +02:00
Tanu Kaskinen
175fc3ef13 build-sys: bump sonames
Bump 18 -> 19 due to the addition of the LFE balance API.
2015-12-27 14:42:35 +02:00
Arun Raghavan
b1fe42bb3f daemon: Sanitise message about unsupported high res timers 2015-12-21 11:21:17 +05:30
Arun Raghavan
2dbd6c0fe3 build: Move to using Travis trusty images 2015-12-21 11:21:17 +05:30
Tanu Kaskinen
e8d5a6af1e always-sink: simplify hook management with pa_module_hook_connect() 2015-12-21 05:37:28 +02:00