Commit graph

8215 commits

Author SHA1 Message Date
Georg Chini
e5815a0429 role-ducking: use the common code in stream-interaction.c 2016-03-21 14:29:18 +02:00
Georg Chini
2ed0f1cb24 stream-interaction: add ducking functionality 2016-03-21 14:29:02 +02:00
Georg Chini
4731690a21 stream-interaction: Bugfix for improper uncorking behavior with global=1
This patch is based on a recent patch for module-role-ducking from Sangchul Lee
which fixes incorrect behavior when global is set to 1. Original commit can be found
here:
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=d049c2941e6aef5ff33bcd0b4adece12289302b7
2016-03-18 10:14:31 +02:00
Tanu Kaskinen
71b128aaea filter-apply: fix typo "what" -> "want" 2016-03-17 19:33:28 +02:00
Georg Chini
bc10d26621 role-cork: more cosmetic changes, changed debug output
Change names of shall_interact() and is_trigger_stream() because the names look
like the functions return a boolean. Simpler debugging output.
2016-03-16 13:29:04 +02:00
Georg Chini
c03cf89b33 role-cork: prepare merge with role-ducking: replace "cork" with "interact" where appropriate
Again, interact includes cork and duck.
2016-03-15 13:02:04 +02:00
Georg Chini
f12102857a role-cork: prepare merge with role-ducking: move most code to stream-interaction.c
Filename suggested by Tanu, as it includes both, cork and duck.
2016-03-14 10:46:57 +02:00
Georg Chini
16660789ca role-cork: remove corking on module exit
While module-role-ducking removes the attenuation when the module exits,
module-role-cork does not remove the corking. Added a function for that.
2016-03-13 12:33:16 +02:00
Georg Chini
7f5f25bb1a role-cork: allow cork of all non-trigger streams using cork_roles=any_role
There might be situations where you want to cork all streams that are not
trigger streams. Use cork_roles=any_role to implement this.
2016-03-12 16:55:59 +02:00
Georg Chini
075796d767 role-cork: React to mute/cork of trigger streams and to proplist changes
When a trigger stream changes mute or cork state, the cork streams should
react to this. The same applies if a stream changes its role to or from the
trigger role.
2016-03-11 10:46:22 +02:00
Georg Chini
61164d3b51 role-cork: Don't ignore streams without media.role
When corking do not ignore streams without media.role. Instead treat
them as if media.role="no_role", so that you can specify "no_role" as
trigger or cork role.
2016-03-10 18:12:41 +02:00
Tanu Kaskinen
092eb57974 resampler-test: remove translations
Translators shouldn't be burdened with translating strings in tests.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=94435
2016-03-10 17:35:58 +02:00
Gabor Kelemen
104e4adde4 Updated Hungarian translation 2016-03-09 09:54:36 +02:00
Tanu Kaskinen
ff85bc437c card-restore: save the database when shutting down
If u->save_time_event is non-NULL when the module is being unloaded,
it means that there are some changes to the database that haven't
yet been flushed to the disk.

Acked-by: David Henningsson <david.henningsson@canonical.com>
2016-03-08 10:21:13 +02:00
David Henningsson
c87917cf0d alsa-mixer: refactor element_probe and fix >2 channel bug
By refactoring volume probing into its own function, we can reduce
indentation a lot. Also, if an error occurs during the volume probe,
that volume element is now always skipped (instead of taking down
the entire path with it).

Also, a bug for elements with more than two channels is fixed, as
previously, the volume parsing code was continuing, potentially
referencing somewhere outside the array (which has max two channels).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2016-03-08 08:37:57 +01:00
David Henningsson
f6e1ac2dd2 switch-on-port-available: Switch from HDMI to analog; but not the other way around
If you have headphones plugged in and plug in HDMI; you want sound
to stay on headphones.
If you have HDMI plugged in and you plug in headphones; you want sound
to switch to headphones.

Hence we need to take priority into account as well when determining
whether to switch to a new profile or not.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=93903
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2016-02-26 13:45:53 +01:00
Arun Raghavan
fa2b0b4aad echo-cancel: Convert AGC API to deal with pa_volume_t
It is expected that the underlying AGC mechanism will likely provide a
single volume for the source rather than a per-channel volume. Dealing
with per-channel volumes just adds complexity with regards to the
actual volume setting (depending on whether volume sharing is enabled or
not, we would set the volume on the source output of the virtual source,
and their sample specs may be different).

Using a single volume allows us to sidestep this problem entirely.
2016-02-25 19:06:44 +05:30
Arun Raghavan
05a6af744b echo-cancel: Add beamforming support in the webrtc canceller 2016-02-25 09:17:25 +05:30
Arun Raghavan
cfd3a948de echo-cancel: Remove pa_ prefix on private functions 2016-02-25 09:17:25 +05:30
Arun Raghavan
be5e196c1a echo-cancel: Update a copyright notice 2016-02-25 09:17:25 +05:30
Arun Raghavan
07663b06b3 echo-cancel: Use webrtc's deinterleaved API
This is required to have unequal channel counts on capture in and out
streams, which is needed for beamforming to work. The deinterleaved API
only works with floating point samples.
2016-02-25 09:17:10 +05:30
Arun Raghavan
3133ff8e11 echo-cancel: webrtc canceller supports different in/out channel counts
Needed for upcoming beamforming code.
2016-02-25 09:09:13 +05:30
Arun Raghavan
222a98846c echo-cancel: Improve webrtc canceller error handling a bit 2016-02-25 09:09:13 +05:30
Arun Raghavan
5baecd37c3 echo-cancel: Fix webrtc canceller when rec channels != play channels
The calculations around how many samples were sent to the canceller
engine was not updated when we started supporting different channel
counts for playback and capture.
2016-02-25 09:09:13 +05:30
Arun Raghavan
08afc36ae4 echo-cancel: Make webrtc AGC start volume a modarg
Allows for tuning based on the target hardware.
2016-02-25 09:09:13 +05:30
Arun Raghavan
8de7dfec14 echo-cancel: Use anonymous unions for echo canceller params
Makes this part of the code just a little less verbose.
2016-02-25 09:09:13 +05:30
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