Tanu Kaskinen [Tue, 13 Mar 2018 17:40:37 +0000 (19:40 +0200)]
oss: don't fail resume if trigger() fails
The previous code made the SET_STATE message fail if trigger() failed.
However, trigger() was called after pa_sink/source_process_msg(), which
meant that the main thread that sent the SET_STATE thought that resuming
failed, but nothing was undone in the IO thread, so in the IO thread
things seemed as if the sink/source was successfully resumed. (I don't
use OSS myself, so I don't know what kind of practical problems this
could cause).
Unless some complex undo logic is implemented, I believe it's best to
ignore all failures in trigger(). Most error cases were already ignored,
and the only one that wasn't ignored doesn't seem too serious.
I also moved trigger() to happen before pa_sink/source_process_msg(),
which made it necessary to add new state parameters to trigger(). The
reason for this move is that I want to move the SET_STATE handler code
into a separate callback, and if things are done both before and after
pa_sink/source_process_msg(), that makes things more complicated.
The previous code checked the return value of
pa_sink/source_process_msg() before calling trigger(), but that was
unnecessary, since pa_sink/source_process_msg() never fails when
processing the SET_STATE messages.
Tanu Kaskinen [Tue, 13 Mar 2018 17:40:36 +0000 (19:40 +0200)]
sink, source: rename set_state() to set_state_in_main_thread()
There will be a new callback named set_state_in_io_thread(). It seems
like a good idea to have a similar name for the main thread variant.
Tanu Kaskinen [Mon, 19 Feb 2018 14:48:25 +0000 (16:48 +0200)]
bluetooth: fix resume error handling
When resuming a sink or source, pa_sink/source_process_msg() should be
called only if resuming is successful. pa_sink/source_process_msg()
updates thread_info.state and notifies streams about the new state, but
if resuming fails, there's no state change.
Andika Triwidada [Sun, 4 Mar 2018 16:05:14 +0000 (18:05 +0200)]
i18n: update the Indonesian translation
Tanu Kaskinen [Wed, 21 Feb 2018 09:54:41 +0000 (11:54 +0200)]
null-sink, pipe-sink: some state variable cleanups
pa_sink_get_state() is supposed to be used from the main thread. In this
case it doesn't really matter, because the SET_STATE handler is executed
while the main thread is waiting, but since the state is available also
in thread_info, let's use that. All other modules use thread_info.state
too, so at least this change improves consistency.
Also, we can use the PA_SINK_IS_OPENED macro to simplify the code a bit.
Tanu Kaskinen [Mon, 19 Feb 2018 14:48:21 +0000 (16:48 +0200)]
alsa: add a couple of FIXME comments
build_pollfd() isn't likely to fail, but if it does, pa_sink/source_put()
will crash on an assertion failure. I haven't seen such crash happening,
this is just something that I noticed while studying the state change
code.
Tanu Kaskinen [Mon, 19 Feb 2018 14:48:19 +0000 (16:48 +0200)]
alsa, solaris, oss: remove unnecessary error handling when suspending
Suspending never fails.
Tanu Kaskinen [Thu, 22 Feb 2018 08:06:59 +0000 (10:06 +0200)]
sink: don't sync monitor suspend state when unlinking
When the sink is unlinked, there's no need to update the monitor suspend
state. In fact, trying to do that causes an assertion failure, because
pa_source_sync_suspend() wasn't written to handle the case where the
sink is unlinked.
Tanu Kaskinen [Mon, 19 Feb 2018 14:48:23 +0000 (16:48 +0200)]
pass pa_suspend_cause_t to set_state() callbacks
The suspend cause isn't yet used by any of the callbacks. The alsa sink
and source will use it to sync the mixer when the SESSION suspend cause
is removed. Currently the syncing is done in pa_sink/source_suspend(),
and I want to change that, because pa_sink/source_suspend() shouldn't
have any alsa specific code.
Tanu Kaskinen [Mon, 19 Feb 2018 14:48:22 +0000 (16:48 +0200)]
sink, source: redo state changing code
This adds a pa_suspend_cause_t parameter to the sink/source_set_state()
functions, and moves part of the work that pa_sink/source_suspend() does
to sink/source_set_state(). The reason for this code shuffling is that I
plan to make all suspend cause changes available to modules through the
state change callbacks. This is the first step towards that.
Additionally, pa_source_sync_suspend() is changed to also update the
suspend cause of the monitor source when the suspend cause of the
monitored sink changes. That probably doesn't have much effect on
anything, but I think it makes sense to mirror the sink suspend cause in
the monitor source.
pa_source_sync_suspend() has also a bug fix: previously it was probably
possible that a sink might get suspended while in the passthrough mode.
When the sink then resumed (while still in the passthrough mode),
pa_source_sync_suspend() would resume also the monitor source, even
though the monitor source should be kept suspended when the sink is in
the passthrough mode. Now the monitor source won't be resumed in this
situation.
Mr. M [Thu, 15 Feb 2018 08:29:48 +0000 (10:29 +0200)]
i18n: update the Lithuanian translation
Tanu Kaskinen [Sun, 8 Oct 2017 16:48:26 +0000 (19:48 +0300)]
alsa-mixer: autodetect the ELD device
This removes the need to hardcode the ELD device index in the path
configuration. The hardcoded values don't work with the Intel HDMI LPE
driver.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=100488
Tanu Kaskinen [Sun, 8 Oct 2017 16:48:25 +0000 (19:48 +0300)]
alsa-mixer: autodetect the HDMI jack PCM device
This removes the need to hardcode the PCM device index in the HDMI jack
names. The hardcoded values don't work with the Intel HDMI LPE driver.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=100488
Tanu Kaskinen [Sun, 8 Oct 2017 16:48:24 +0000 (19:48 +0300)]
alsa-mixer: add hw_device_index to pa_alsa_mapping
We have so far assumed that HDMI always uses device indexes 3, 7, 8, 9,
10, 11, 12 and 13. These values are hardcoded in the path configuration.
The Intel HDMI LPE driver, however, uses different device numbering
scheme. Since the indexes aren't always the same, we need to query the
hw device index from ALSA.
Later patches will use the queried index for HDMI jack detection and ELD
information reading.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=100488
Georg Chini [Sat, 10 Feb 2018 19:39:27 +0000 (20:39 +0100)]
filter-apply: Ignore monitor source of filter in find_paired_master()
When module-filter-apply tries to find a matching source-output for
a given sink-input and a stream within the same group exists on the
monitor source of the filter, module-filter apply falsely assumes
that the source belongs to another instance of the filter and tries
to access source->output_from_master->source, which leads to a
segmentation fault.
This patch fixes the issue by ignoring the stream if the source is
the monitor source of the filter.
Tanu Kaskinen [Wed, 24 Jan 2018 01:51:49 +0000 (03:51 +0200)]
memfd-wrappers: only define memfd_create() if not already defined
glibc 2.27 is to be released soon, and it will provide memfd_create().
If glibc provides the function, we must not define it ourselves,
otherwise building fails due to conflict between the two implementations
of the same function.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=104733
Vivek Dasmohapatra [Fri, 26 Jan 2018 01:58:19 +0000 (03:58 +0200)]
daemon: don't re-exec if the linker supports the -z,now option
Usually PulseAudio is built with a linker that supports the -z,now
option, and that option should have the same effect (i.e. the dynamic
linker resolves all symbols when the program is started) as re-execing
with the LD_BIND_NOW environment variable set, so usually the re-execing
is redundant.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=104789
Felipe Sateler [Tue, 16 Jan 2018 00:14:45 +0000 (21:14 -0300)]
build-sys: don't install esdcompat tool if building without esound support
Tanu Kaskinen [Thu, 18 Jan 2018 20:27:54 +0000 (22:27 +0200)]
bluetooth: don't send unsolicted replies to the endpoint Release() call
It was reported that PulseAudio causes error messages in syslog from
dbus-daemon:
Jan 14 04:51:32 gentoo dbus-daemon[2492]: [system] Rejected send message, 2 matched rules; type="error", sender=":1.15" (uid=1000 pid=2864 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.1" (uid=0 pid=2670 comm="/usr/libexec/bluetooth/bluetoothd ")
The default policy on the system bus is to not let any method call
replies through if they have not been requested, and apparently
bluetoothd doesn't want replies to the Release() call.
This also changes the reply type from error to normal reply. The "not
implemented" error didn't make sense to me. We don't do any cleanup in
the Release() handler, probably because there's nothing to do. If there
is some cleanup that we should do, then it's a serious bug not to do it.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=104646
Samo Pogačnik [Thu, 18 Jan 2018 15:15:18 +0000 (16:15 +0100)]
pipe-sink: use existing fifo
Allow usage of an already existing fifo (named pipe) within the
pipe-sink module. Also, the used fifo is going to be removed upon
module unload only if the fifo is created by the same module.
Tanu Kaskinen [Thu, 11 Jan 2018 17:32:29 +0000 (19:32 +0200)]
alsa-mixer: add another hardware ID for Traktor Audio 6
This is based on a patch by Rolo <rolo@wildfish.com> that replaced the
old ID with the new one. I deemed it better to leave the old ID in use
(I can't verify if the old ID was correct or not).
The original commit message:
Every time I reinstall or update Ubuntu I have to make this change
to get it to recognise my Native Instruments Traktor Audio 6
external soundcard.
Each time I remember the change by hunting down this forum post in
German,
https://forum.ubuntuusers.de/topic/traktor-audio-6-erkannt-aber-nicht-anwaehlbar/3/#post-
8759808
(I don't speak German).
I'm not sure if the ID is just incorrect or if perhaps the hardware
identifies itself differently on slightly different models, so
perhaps we need to duplicate the line - I'm well outside of my
comfort zone here and I know barely anything about how hardware
works on Linux but figured if it helps me it would help others so I
should put it forward.
Thanks!
Samo Pogačnik [Wed, 3 Jan 2018 19:34:58 +0000 (20:34 +0100)]
pipe-sink: new option "use_system_clock_for_timing"
Using this option, even the simplest tools like "cat" can properly
dump raw audio from the pipe.
Tanu Kaskinen [Thu, 28 Dec 2017 15:14:13 +0000 (17:14 +0200)]
switch-on-port-available: remove unused return values
Laurent Bigonville [Wed, 13 Dec 2017 11:12:35 +0000 (12:12 +0100)]
i18n: fix French translation of "Line Out"
Josef Andersson [Wed, 3 Jan 2018 15:06:40 +0000 (17:06 +0200)]
i18n: update the Swedish translation
Tanu Kaskinen [Thu, 28 Dec 2017 14:53:51 +0000 (16:53 +0200)]
build-sys: fix PA_MODULE_NAME for module-default-device-restore
Tanu Kaskinen [Thu, 28 Dec 2017 10:09:19 +0000 (12:09 +0200)]
sink, source: improve suspend cause logging
Previously the suspend cause was logged as a hexadecimal number, now
it's logged as a human-friendly string.
Also, the command line interface handled only a subset of causes when
printing them, now all suspend causes are printed.
Tanu Kaskinen [Thu, 28 Dec 2017 10:09:18 +0000 (12:09 +0200)]
sink, source: improve state change logging
Now the old and new state is logged every time when the sink or source
state changes.
Tanu Kaskinen [Thu, 28 Dec 2017 10:09:17 +0000 (12:09 +0200)]
alsa: fix infinite loop with Intel HDMI LPE
The Intel HDMI LPE driver works in a peculiar way when the HDMI cable is
not plugged in: any written audio is immediately discarded and underrun
is reported. That resulted in an infinite loop, because PulseAudio tried
to keep the buffer filled, which was futile since the written audio was
immediately consumed/discarded.
This patch adds special handling for the LPE driver: if the active port
of the sink is unavailable, the sink suspends itself. A new suspend
cause is added: PA_SUSPEND_UNAVAILABLE.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=100488
Arun Raghavan [Tue, 5 Dec 2017 05:24:41 +0000 (10:54 +0530)]
build-sys: Stop using symdef headers for modules
This removes the symdef header generation m4 magic in favour of a
simpler macro method, allowing us to skip one unnecessary build step
while moving to meson, and removing an 11 year old todo!
Tanu Kaskinen [Tue, 12 Dec 2017 04:16:04 +0000 (06:16 +0200)]
map-file: add pa_encoding_from_string
The function is declared in pulse/format.h and it has Doxygen
documentation, which tells me that the intention was to make the
function available to clients.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=103806
Andrius Štikonas [Mon, 20 Nov 2017 19:56:53 +0000 (19:56 +0000)]
qpaeq: port to PyQt5
KimJeongYeon [Sat, 9 Dec 2017 20:00:20 +0000 (21:00 +0100)]
filter-apply: Eliminate nested and redundant hook events
In proces(), the do_move() function calls pa_{sink_input,source_output}_set_property().
This triggers a call to {sink_input,source_output}_proplist_cb() which called process()
a second time.
This patch avoids the duplicate and nested call to process() by checking if
PA_PROP_FILTER_APPLY_MOVING is set in {sink_input,source_output}_proplist_cb().
Roliga [Sun, 3 Dec 2017 06:15:11 +0000 (07:15 +0100)]
ladspa-sink: add module argument to set sink input properties
This patch adds a sink_input_properties argument to module-ladspa-sink,
which can be helpful for customizing the appearance of the sink input in
various volume control applications, or to differentiate between
multiple instances of the module.
Tanu Kaskinen [Wed, 6 Dec 2017 23:26:29 +0000 (01:26 +0200)]
augment-properties: fix a memory leak
If the desktop file is not found, fn was not being freed after the last
loop iteration.
CID:
1462477
Tanu Kaskinen [Wed, 22 Nov 2017 15:14:10 +0000 (17:14 +0200)]
core-util, cpu-x86: use __get_cpuid() instead of homegrown assembly
The get_cpuid() function in cpu-x86.c was buggy on x86-64. When building
without optimizations, the homegrown assembly code overwrote the
beginning of the function argument list on the stack. That happened to
work fine on regular x86-64, but caused crashing with the x32 ABI.
At least GCC and clang provide cpuid.h, which has the __get_cpuid()
function that can be used instead of the homegrown assembly.
The PA_REG_* constants can be removed as well, because they're not used
any more.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=103656
Arun Raghavan [Fri, 27 Oct 2017 03:59:19 +0000 (09:29 +0530)]
client-conf: Add a default value for disable-memfd
This got missed while adding the client option.
Georg Chini [Sun, 3 Dec 2017 21:29:09 +0000 (22:29 +0100)]
sink, source: Don't finish move if unlink happens after pa_*_move_all_start()
When a sink input was unlinked between the calls to pa_sink_move_all_start() and
pa_sink_move_all_finish(), pa_sink_move_all_finish() tried to finish the move
of the already unlinked sink input, which lead to an assertion in
pa_sink_input_finish_move(). The same applies for the source side.
This patch fixes the problem by checking the state of the sink input or
source output in pa_*_move_all_finish().
Bug report: https://bugs.freedesktop.org/show_bug.cgi?id=103752
Georg Chini [Sun, 3 Dec 2017 21:27:53 +0000 (22:27 +0100)]
switch-on-connect: add option to ignore virtual sinks/sources
module-switch-on-connect would switch to any new sink, even if the sink
was a filter or a null-sink.
This patch adds a command line option ignore_virtual to the module, which
lets module-switch-on-connect ignore virtual sinks and sources. The flag
is true by default because the purpose of the module is to switch to new
hardware when it becomes available.
Tanu Kaskinen [Tue, 28 Nov 2017 17:50:02 +0000 (19:50 +0200)]
device-manager: don't override application routing requests
module-device-manager doesn't change the routing of those streams that
have been explicitly routed by the user, which is good. Similarly, it
should leave those streams alone whose routing was decided by the
application that created the stream. This patch implements that.
BugLink: https://github.com/wwmm/pulseeffects/issues/99
Tanu Kaskinen [Tue, 28 Nov 2017 17:50:01 +0000 (19:50 +0200)]
sink-input, source-output: add sink/source_requested_by_application flag
When a stream is created, and the stream creator specifies which device
should be used, that can affect automatic routing policies.
Specifically, module-device-manager shouldn't apply its priority list
routing when a stream has been routed by the application that created
the stream.
A stream that was initially routed by the application may be moved for
some valid reason (e.g. user requesting a move, or the original device
disappearing). When the stream is moved away from its initial device,
the "device requested by application" flag isn't relevant any more, so
it's set to false and never reset to true again.
The change in module-device-manager's routing logic will be done in the
following patch.
Iceyer [Sat, 18 Nov 2017 07:33:51 +0000 (15:33 +0800)]
augment-properties: support XDG_DATA_DIRS when find desktop files
Constantine Kharlamov [Wed, 8 Nov 2017 17:01:07 +0000 (20:01 +0300)]
sconv-s16be: declaration/implementation mismatches
Fixes the following compiler errors:
./pulsecore/sconv-s16be.h:41:6: warning: type of 'pa_sconv_s24_32be_from_float32ne' does not match original declaration [-Wlto-type-mismatch]
void pa_sconv_s24_32be_from_float32ne(unsigned n, const float *a, uint8_t *b);
^
pulsecore/sconv-s16le.c:413:6: note: 'pa_sconv_s24_32be_from_float32ne' was previously declared here
void pa_sconv_s24_32le_from_float32ne(unsigned n, const float *a, uint32_t *b) {
^
pulsecore/sconv-s16le.c:413:6: note: code may be misoptimized unless -fno-strict-aliasing is used
./pulsecore/sconv-s16be.h:40:6: warning: type of 'pa_sconv_s24_32be_to_float32ne' does not match original declaration [-Wlto-type-mismatch]
void pa_sconv_s24_32be_to_float32ne(unsigned n, const uint8_t *a, float *b);
^
pulsecore/sconv-s16le.c:388:6: note: 'pa_sconv_s24_32be_to_float32ne' was previously declared here
void pa_sconv_s24_32le_to_float32ne(unsigned n, const uint32_t *a, float *b) {
^
pulsecore/sconv-s16le.c:388:6: note: code may be misoptimized unless -fno-strict-aliasing is used
./pulsecore/sconv-s16be.h:56:6: warning: type of 'pa_sconv_s24_32be_from_s16ne' does not match original declaration [-Wlto-type-mismatch]
void pa_sconv_s24_32be_from_s16ne(unsigned n, const int16_t *a, uint8_t *b);
^
pulsecore/sconv-s16le.c:365:6: note: 'pa_sconv_s24_32be_from_s16ne' was previously declared here
void pa_sconv_s24_32le_from_s16ne(unsigned n, const int16_t *a, uint32_t *b) {
^
pulsecore/sconv-s16le.c:365:6: note: code may be misoptimized unless -fno-strict-aliasing is used
./pulsecore/sconv-s16be.h:55:6: warning: type of 'pa_sconv_s24_32be_to_s16ne' does not match original declaration [-Wlto-type-mismatch]
void pa_sconv_s24_32be_to_s16ne(unsigned n, const uint8_t *a, int16_t *b);
^
pulsecore/sconv-s16le.c:342:6: note: 'pa_sconv_s24_32be_to_s16ne' was previously declared here
void pa_sconv_s24_32le_to_s16ne(unsigned n, const uint32_t *a, int16_t *b) {
^
pulsecore/sconv-s16le.c:342:6: note: code may be misoptimized unless -fno-strict-aliasing is used
Signed-off-by: Constantine Kharlamov <Hi-Angel@yandex.ru>
jnqnfe [Fri, 8 Sep 2017 03:31:42 +0000 (04:31 +0100)]
merge and deduplicate some pa_buffer_attr documentation
jnqnfe [Mon, 4 Sep 2017 19:19:48 +0000 (20:19 +0100)]
api documentation improvements
includes typo fixes, neatening, addition of more return info, and such.
jnqnfe [Mon, 4 Sep 2017 01:32:37 +0000 (02:32 +0100)]
volume: slight simplification of code
jnqnfe [Thu, 31 Aug 2017 17:32:47 +0000 (18:32 +0100)]
volume: pa_cvolume_scale_mask: constify param
Hui Wang [Mon, 13 Nov 2017 02:17:19 +0000 (10:17 +0800)]
build-sys: add the Dell dock TB16 configuration
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Tanu Kaskinen [Thu, 9 Nov 2017 12:12:34 +0000 (14:12 +0200)]
echo-cancel: fix a memory leak
The pa_echo_canceller_msg object was never unreffed.
Tanu Kaskinen [Thu, 9 Nov 2017 12:12:33 +0000 (14:12 +0200)]
echo-cancel: ignore remaining canceller messages after the module has been unloaded
Not ignoring the messages caused crashing due to accessing the userdata
after it had been freed.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=103528
Tanu Kaskinen [Wed, 8 Nov 2017 12:20:23 +0000 (14:20 +0200)]
card-restore: don't restore unavailable profiles
Tanu Kaskinen [Wed, 8 Nov 2017 12:20:22 +0000 (14:20 +0200)]
card-restore: log the correct profile name
Tanu Kaskinen [Tue, 31 Oct 2017 13:29:26 +0000 (15:29 +0200)]
remap-source, virtual-source: fix max_rewind handling
The filter sources should have the same max_rewind as the master source,
but these modules didn't update max_rewind when the master max_rewind
changed.
Tanu Kaskinen [Tue, 31 Oct 2017 13:29:25 +0000 (15:29 +0200)]
alsa-sink: update max_rewind when updating the latency
Previously max_rewind was always set to the full hw buffer size, but
the actual maximum rewind amount is limited to the part of the hw buffer
that is in use.
The rewind request that was done when lowering the sink latency had to
be moved to happen before updating max_rewind.
The practical benefit of this change: When using a filter source on a
monitor source, the filter source latency is increased by max_rewind.
Without this change the max_rewind of an alsa sink is often
unnecessarily high, which leads to unnecessarily high latency with
filter sources.
Monitor sources themselves don't suffer from the latency issue, because
they use the current sink latency instead of max_rewind for the extra
buffer that they keep to deal with rewinds.
Mihai Moldovan [Tue, 7 Mar 2017 22:00:10 +0000 (23:00 +0100)]
svolume: disable incompatible MMX and SSE code on x86 macOS
We need the same workaround FreeBSD uses.
Mihai Moldovan [Thu, 11 Feb 2016 02:25:33 +0000 (03:25 +0100)]
module-coreaudio-{device, detect}: implement record and playback modargs, curtesy of module-waveout.
Signed-off-by: Mihai Moldovan <ionic@ionic.de>
Tanu Kaskinen [Sun, 29 Oct 2017 19:15:48 +0000 (21:15 +0200)]
sink-input, source-output: add a couple of assertions
Coverity complained about data->sink being possibly NULL when it's
dereferenced later. It was difficult for me to figure out whether that
was a false positive or not. Hopefully the comments make it a bit
easier to reason about the code in the future.
CID:
1323591
Tanu Kaskinen [Thu, 27 Oct 2016 14:59:29 +0000 (17:59 +0300)]
system.pa: load module-card-restore
Apparently nobody remembered to update system.pa when
module-card-restore was created.
Tanu Kaskinen [Thu, 27 Oct 2016 14:59:28 +0000 (17:59 +0300)]
system.pa: load module-device-restore before module-udev-detect
module-device-restore doesn't restore the state of devices that already
exist during the module loading, so the module has to be loaded early.
Arun Raghavan [Mon, 15 May 2017 08:47:58 +0000 (14:17 +0530)]
echo-cancel: Expose dereverb in the speex canceller
Enabled by default.
Arun Raghavan [Mon, 15 May 2017 08:47:08 +0000 (14:17 +0530)]
echo-cancel: Fix speex echo state setting
The state should be set even if echo suppression is disabled, which is
not currently the case.
Tanu Kaskinen [Thu, 19 Oct 2017 18:22:15 +0000 (21:22 +0300)]
mention the sound card clock and system clock difference in libpulse docs
Arun Raghavan [Sun, 3 Sep 2017 11:23:17 +0000 (16:53 +0530)]
sink, source: Rework reconfiguration logic to apply to more than rate
This rejigs the update_rate() logic to encompass changes to the sample
spec as a whole, as well as passthrough status. As a result,
sinks/sources provide a reconfigure() method which allows
reconfiguration as required.
The behaviour itself is currently unchanged -- alsa-sink/-source do not
actually implement anything other than rate updates for now (nor are
they ever requested to). This can be modified in the future, to allow,
for example 24-bit output when incoming media supports it, as well as
channel count changes for passthrough sinks.
Another related change is that passthrough status is now part of
sink/source reconfiguration, and we can stop doing a suspend/unsuspend
when entering/leaving passthrough state. So that part is now divided
in two -- pa_sink_reconfigure() sets the sink in passthrough mode if
required, and pa_sink_enter_passthrough() sets up everything else
(this currently means only volumes, but could disable other processing)
for passthrough mode.
Georg Chini [Sat, 21 Oct 2017 10:44:03 +0000 (12:44 +0200)]
loopback: Track and use average adjust time
The configured adjust time does not match exactly the real adjust time. Also
the adjust time varies. To improve latency estimation use an average of the
measured adjust times instead of the configured value in all calculations.
Tanu Kaskinen [Sun, 15 Oct 2017 13:56:45 +0000 (16:56 +0300)]
volume: improve documentation
Changes:
- Mention that source outputs have volume too.
- Don't claim that most distributions have flat volumes enabled.
- Volumes use a cubic scale, not logarithmic.
- Reword the warning about using the conversion functions on hardware
volumes. The old wording gave the incorrect impression that hardware
volumes could never be converted to dB or linear scale.
Tanu Kaskinen [Sun, 15 Oct 2017 10:29:42 +0000 (13:29 +0300)]
bluetooth: set better priorities for profiles
Since HSP had higher priority than A2DP, the default profile when
connecting a new headset was HSP. To me it makes more sense to default
to high-quality output. We already have some automatic policies to
switch to HSP when it's needed.
I also made the A2DP source and HSP/HFP gateway profiles have lower
priority than the A2DP sink and HSP headset profiles. The A2DP source
and HSP/HFP gateway profiles should only be activated if the remote
device initiates audio streaming, so it makes sense to have lower
priority for those profiles.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=103058
Tanu Kaskinen [Sun, 15 Oct 2017 16:24:11 +0000 (19:24 +0300)]
source-output: fix copy-paste error
Felipe Sateler [Fri, 13 Oct 2017 15:23:37 +0000 (12:23 -0300)]
build-sys: test for cxx-11 after AC_USE_SYSTEM_EXTENSIONS
This avoids the following autoconf warning:
configure.ac:89: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from...
configure.ac:89: the top level
Tanu Kaskinen [Thu, 12 Oct 2017 13:59:58 +0000 (16:59 +0300)]
Revert "alsa-mixer: fix speaker output on a couple of Asus EeePC machines"
This reverts commit
ca63fbc1d806e63e083cb700567f15066ecfdc07.
I applied the patch too hastily. force-speaker.conf is supposed to be
used only when the alsa mixer doesn't contain any elements that would
indicate the existence of a speaker port, but the reverted patch is a
workaround for a different problem. On the two affected EeePC machines
the Headphone element needs to be unmuted when using speakers. The
analog-output-speaker-always path happens to do that, but that's
unintentional. analog-output-speaker was changed[1] to mute the
headphone output when using the speaker port, and
analog-output-speaker-always should have been changed too, but that was
forgotten.
The kernel driver is buggy if it has a Headphone mixer element that
mutes both headphones and speakers, so this should be fixed in alsa. If
we end up having a workaround in PulseAudio for the broken driver, it
should be implemented with a new profile set and path configuration
files.
[1] https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=
22aac4e9fdb3786178f7815a0cb2150f588b1582
Guenter Milde [Thu, 12 Oct 2017 13:42:18 +0000 (16:42 +0300)]
alsa-mixer: fix speaker output on a couple of Asus EeePC machines
Tanu Kaskinen [Wed, 11 Oct 2017 18:03:38 +0000 (21:03 +0300)]
i18n: add raop files to POTFILES.in
Colin Leroy [Mon, 9 Oct 2017 07:42:27 +0000 (09:42 +0200)]
raop: Init dummy port and card for latency change
This adds a port, card and profile to RAOP sinks to make it
possible to change the latency at runtime (and have it persist)
using pavucontrol or pactl set-port-latency-offset.
Also move the IP:port part of the sink name to the port name.
Colin Leroy [Mon, 9 Oct 2017 07:26:42 +0000 (09:26 +0200)]
raop: Show device codename in sink properties
This will make it easier for testers to report latency offset for their
specific hardware.
Peter Meerwald-Stadler [Wed, 6 Sep 2017 10:16:31 +0000 (12:16 +0200)]
core: Fix gcc-7 -Wimplicit-fallthrough= warnings by rearranging comment
'Fall through.' must appear separately
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Peter Meerwald-Stadler [Wed, 6 Sep 2017 09:26:15 +0000 (11:26 +0200)]
core: Fix typo and gcc-7 -Wimplicit-fallthrough= warnings
Correct spelling of 'through' in a comment helps to fix a warning :)
also drop some unrelated comments
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Peter Meerwald-Stadler [Wed, 6 Sep 2017 09:20:54 +0000 (11:20 +0200)]
core: Fix gcc-7 -Wimplicit-fallthrough= warnings
the comment /* Fall through. */ fixes the warning, but gcc-7 seems to be more
picky about the position in the code
pulsecore/sink-input.c: In function ‘pa_sink_input_update_proplist’:
pulsecore/sink-input.c:1531:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
for (state = NULL; (key = pa_proplist_iterate(i->proplist, &state));) {
^~~
pulsecore/sink-input.c:1539:9: note: here
case PA_UPDATE_REPLACE: {
^~~~
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Peter Meerwald-Stadler [Wed, 6 Sep 2017 09:12:26 +0000 (11:12 +0200)]
raop: Fix typo
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Peter Meerwald-Stadler [Wed, 6 Sep 2017 09:05:29 +0000 (11:05 +0200)]
raop: Fix gcc-7 warnings, EWOULDBLOCK
EAGAIN is used allover the code rather than EWOULDBLOCK
POSIX allows EAGAIN and EWOULDBLOCK to have the same value (and in fact it is)
don't check for EWOULDBLOCK
modules/raop/raop-client.c: In function ‘send_udp_audio_packet’:
modules/raop/raop-client.c:473:41: warning: logical ‘or’ of equal expressions [-Wlogical-op]
if (written < 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
^~
modules/raop/raop-client.c: In function ‘resend_udp_audio_packets’:
modules/raop/raop-client.c:528:45: warning: logical ‘or’ of equal expressions [-Wlogical-op]
if (written < 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
^~
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Peter Meerwald-Stadler [Wed, 6 Sep 2017 07:56:10 +0000 (09:56 +0200)]
bluetooth: bluez5: Fix Coverity warning
Use pa_assert_se() to check return value (pro forma) like everywhere else
Coverity ID: #154313
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Peter Meerwald-Stadler [Wed, 6 Sep 2017 07:53:06 +0000 (09:53 +0200)]
json-test: Fix Coverity warning
Cosmetic resource leak in test code
Coverity ID: #
1454314
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Colin Leroy [Sat, 7 Oct 2017 18:11:49 +0000 (20:11 +0200)]
raop: add latency value for Shairport RAOP server
After testing, Shairport server's latency is the same as Pioneer N30.
Salvador Fandino [Wed, 4 Oct 2017 13:21:24 +0000 (15:21 +0200)]
build-sys: simulate ln -s correctly on Windows
make install was failing on Windows because there cp is
used to replace ln -s commands but cp doesn't resolve its
first argument as relative to the second one.
This patch changes the install-bashcompletion-aliases rules
to chdir to the target dir so that cp works correctly. This
is the solution recomended in the automake documentation.
Salvador Fandino [Tue, 3 Oct 2017 12:27:59 +0000 (14:27 +0200)]
ladspa-sink: fix Windows compilation
The macro LADSPA_PATH was defined as a list of directories quoted but
without taking into account that the directory names, specially on
Windows, can contain backslashes that need escaping.
This patch removes the quoted from the macro and uses the C preprocessor
to quote it properly using a helper macro.
Salvador Fandino [Tue, 3 Oct 2017 10:58:57 +0000 (12:58 +0200)]
proplist-util: fix compilation on Windows without NLS
Under MinGW, LC_MESSAGES is defined in libint.h which is not
included when pulseaudio is configured with nls disabled.
LC_MESSAGES is referenced when setting PA_PROP_APPLICATION_LANGUAGE.
This patch just disables setting that property when ENABLE_NLS
is not defined.
David Henningsson [Fri, 22 Sep 2017 14:27:44 +0000 (16:27 +0200)]
switch-on-port-available: Add some basic properties
Apparently I forgot about this for like, five years, but better
late than never!
Signed-off-by: David Henningsson <diwic@ubuntu.com>
Tanu Kaskinen [Tue, 13 Sep 2016 12:48:11 +0000 (15:48 +0300)]
thread-mq: create event on the right mainloop
It seems that the intention was to create create write_thread_event on
thread_mainloop instead of main_mainloop (the first parameter of
io_new() is thread_mainloop, io_free() is called on thread_mainloop
etc.).
As long as both mainloops are implemented with pa_mainloop, this bug has
no effect on behaviour, because the io_new() implementation is the same.
And indeed, with the current code base both mainloops are always
pa_mainloops. However, when the tunnel-new modules switches to pa_rtpoll
as the pa_mainloop_api provider, this bug would cause problems.
Kristian Klausen [Fri, 22 Sep 2017 17:54:14 +0000 (17:54 +0000)]
alsa-mixer: Prioritize hdmi-* mappings over iec958-* mappings
Pulseaudio tries to pick the best profile (on startup or
hotplugged), the best profile is the profile with the highest
priority which isn't unavailable.
Due to the facts that iec958 ports available status always (?)
is unknown, and that it is generally more likely that a user use
hdmi than iec958, lets prioritze hdmi over iec958.
This patch shift the analog-* mappings +5 and hdmi-* mappings +5.
Colin Leroy [Sun, 17 Sep 2017 18:46:49 +0000 (20:46 +0200)]
RAOP: Announce real latency
Use predefined values depending on the server, and make it configurable.
AirPlay is supposed to have 2s of latency. With my hardware, this is
more 2.352 seconds after numerous tests.
Switch from pausing/resuming the smoother to resetting it because the
smoother got stuck returning the same value after an idle/running cycle,
making latency calculation wrong.
Tanu Kaskinen [Tue, 19 Sep 2017 14:25:47 +0000 (17:25 +0300)]
qpaeq: change license from AGPL to LGPL v2.1
This removes one unnecessary exception in the PulseAudio licensing
terms. In December 2016 I asked permission from all qpaeq contributors
for the license change, and all gave the permission. I have archived the
emails here:
https://www.freedesktop.org/software/pulseaudio/misc/qpaeq_relicensing_emails.txt
Tanu Kaskinen [Tue, 19 Sep 2017 14:17:09 +0000 (17:17 +0300)]
LICENSE: fix typo
Cheng-Chia Tseng [Tue, 19 Sep 2017 13:46:21 +0000 (16:46 +0300)]
i18n: update the Chinese (Taiwan) translation
Tanu Kaskinen [Mon, 18 Sep 2017 14:40:00 +0000 (17:40 +0300)]
update NEWS
Arun Raghavan [Wed, 13 Sep 2017 07:19:28 +0000 (12:49 +0530)]
bluez: Don't crash on strange MTU sizes
We got reports of this with automatically detected MTUs that weren't
frame aligned.
Arun Raghavan [Wed, 13 Sep 2017 03:52:27 +0000 (09:22 +0530)]
bluez: Don't autodetect MTU by default
This breaks a lot of headsets, so disabling by default. Can be
re-enabled in configuration for specific hardware where it is deemed
necessary.
Also added some debug logging to be able to examine what MTU size is
reported by the device.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102660
Tanu Kaskinen [Fri, 8 Sep 2017 12:10:41 +0000 (15:10 +0300)]
alsa-mixer: add mixer handling to the fallback stereo case
Some sound cards don't have any alsa-lib configuration, but they used to
work well enough up to PulseAudio 10. PulseAudio 11 stopped using "hw:0"
for the analog-stereo mapping, and instead defined it as a fallback
mapping without any mixer handling. As a result, switching between
headphones and speakers stopped working without changing the mixer
settings manually at least on Toshiba Chromebook 2. This patch adds the
mixer handling back to the fallback mapping.
I also renamed "unknown-stereo" to "stereo-fallback", because I like
that name more.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102560
Tanu Kaskinen [Wed, 6 Sep 2017 13:08:29 +0000 (16:08 +0300)]
sink: remove priority bonus for the "internal" form factor
We're supposed to prioritize USB sound cards over PCI sound cards, but
the priority bonus for the "internal" form factor prevents this from
happening. Not all (if any) USB sound cards have the form factor
property set, whereas at least on my laptop the on-board sound card has
the form factor set to "internal".
Tanu Kaskinen [Sun, 10 Sep 2017 19:32:57 +0000 (22:32 +0300)]
sink, source: fix out of date comments
update_shared_real_volume() doesn't exist. I checked that
update_real_volume() does what the comments claim
update_shared_real_volume() to do.
Tanu Kaskinen [Sun, 10 Sep 2017 19:32:56 +0000 (22:32 +0300)]
sink, source: don't try to update volumes of not-yet-linked devices
The order of the pa_sink_input_put() and pa_sink_put() calls in filter
modules was swapped in commit
edc465da77 ("virtual sources and sinks:
Don't double attach a sink input or source output on filter load").
If flat volumes and volume sharing is enabled, the pa_sink_input_put()
call will update volumes of the whole tree of virtual sinks that are
connected to the root sink. The recursive updating procedure tried to
also update the volume of the new sink for which pa_sink_put() had not
yet been called, causing an assertion failure.
This patch tries to make sure that the volume of not-yet-linked sinks
is never changed. pa_sink_put() will set the sink volume correctly, so
it's fine to skip the not-yet-linked sinks during pa_sink_input_put().
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102549
Felipe Sateler [Wed, 6 Sep 2017 22:55:56 +0000 (19:55 -0300)]
launch: avoid autostarting pulseaudio systemd units for root
The autospawn mechanism already had a root-autospawn protection mechanism. When
using systemd that was lost. Systemd 234 has a mechanism to conditionalize unit starting
on the running user, so lets do that to protect against root autospawning.
Russell Treleaven [Fri, 8 Sep 2017 14:24:31 +0000 (10:24 -0400)]
build-sys: make bootstrap.sh fail if autopoint or intltoolize are not available