| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on filter load
When a filter is loaded and module-switch-on-connect is present, switch-on-connect
will make the filter the default sink or source and move streams from the old
default to the filter. This is done from the sink/source put hook, therefore streams
are moved to the filter before the module init function of the filter calls
sink_input_put() or source_output_put(). The move succeeds because the asyncmsq
already points to the queue of the master sink or source. When the master sink or
source is attached to the sink input or source output, the attach callback will call
pa_{sink,source}_attach_within_thread(). These functions assume that all streams
are detached. Because streams were already moved to the filter by switch-on-connect,
this assumption leads to an assertion in pa_{sink_input,source_output}_attach().
This patch fixes the problem by reverting the order of the pa_{sink,source}_put()
calls and the pa_{sink_input,source_output}_put calls and creating the sink input
or source output corked. The initial rewind that is done for the master sink is
moved to the sink message handler. The order of the unlink calls is swapped as well
to prevent that the filter appears to be moving during module unload.
The patch also seems to improve user experience, the move of a stream to the filter
sink is now done without any audible interruption on my system.
The patch is only tested for module-echo-cancel.
Bug-Link: https://bugs.freedesktop.org/show_bug.cgi?id=100065
|
|
|
|
|
|
| |
This patch reverts commit db4fbb0121a2577d786cda023a6a439a9734f152 and
3bb94c4e836ca765a36255e416fd8e6cf272ab44. They were the wrong approach
to fix the bug (and did not fix it anyway).
|
|
|
|
|
|
|
|
|
|
| |
Several virtual sources and sinks apart from module-echo-cancel also query the master
sink or source to estimate the current latency. Those modules might potentially show
the bug that is described for module-echo-cancel in bug 100277.
This patch checks in the message handlers for the PA_{SINK,SOURCE}_MESSAGE_GET_LATENCY
if the master sink or source is valid and returns 0 as latency if not. This is however
not yet sufficient to solve the issue. Additional patches will follow.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
negative values
The reported latency of source or sink is based on measured initial conditions.
If the conditions contain an error, the estimated latency values may become negative.
This does not indicate that the latency is indeed negative but can be considered
merely an offset error. The current get_latency_in_thread() calls and the
implementations of the PA_{SINK,SOURCE}_MESSAGE_GET_LATENCY messages truncate negative
latencies because they do not make sense from a physical point of view. In fact,
the values are truncated twice, once in the message handler and a second time in
the pa_{source,sink}_get_latency_within_thread() call itself.
This leads to two problems for the latency controller within module-loopback:
- Truncating leads to discontinuities in the latency reports which then trigger
unwanted end to end latency corrections.
- If a large negative port latency offsets is set, the reported latency is always 0,
making it impossible to control the end to end latency at all.
This patch is a pre-condition for solving these problems.
It adds a new flag to pa_{sink,source}_get_latency_within_thread() to allow
negative return values. Truncating is also removed in all implementations of the
PA_{SINK,SOURCE}_MESSAGE_GET_LATENCY message handlers. The allow_negative flag
is set to false for all calls of pa_{sink,source}_get_latency_within_thread()
except when used within PA_{SINK,SOURCE}_MESSAGE_GET_LATENCY. This means that the
original behavior is not altered in most cases. Only if a positive latency offset
is set and the message returns a negative value, the reported latency is smaller
because the values are not truncated twice.
Additionally let PA_SOURCE_MESSAGE_GET_LATENCY return -pa_sink_get_latency_within_thread()
for monitor sources because the source gets the data before it is played.
|
|
|
|
|
|
|
|
|
|
|
| |
sink or source
If pa_sink_input_cork() or pa_source_output_cork() were called without a sink
or source attached, the calls would crash pulseaudio.
This patch fixes the problem, so that a source output or sink input can still
be corked or uncorked while source or sink are invalid. This is needed to
correct the corking logic in module-loopback.
|
|
|
|
|
|
|
|
|
| |
FSF addresses used in PA sources are no longer valid and rpmlint
generates numerous warnings during packaging because of this.
This patch changes all FSF addresses to FSF web page according to
the GPL how-to: https://www.gnu.org/licenses/gpl-howto.en.html
Done automatically by sed-ing through sources.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commands used for this (executed from the pulseaudio/src directory):
find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \
-a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \
-a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \
-exec sed -i -e 's/\bpa_bool_t\b/bool/g' \
-e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \;
and:
sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \
-e '181,194!s/\bTRUE\b/true/' -e \
'181,194!s/\bFALSE\b/false/' pulsecore/macro.h
|
|
|
|
|
|
| |
Some modules have source_output_may_move_to_cb() and
sink_input_may_move_to_cb() implemented that duplicate the default behavior.
Remove them.
|
|
|
|
| |
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=46529
|
|
|
|
|
|
| |
Besides making the code a bit cleaner, this also gets rid of
a few "cast increases required alignment of target type"
warnings.
|
| |
|
|
|
|
|
| |
The comment is inherited from module-ladspa-sink. It
doesn't make sense in module-virtual-sink.
|
|
|
|
|
|
| |
These are not used for anything at this point, but this
makes it easy to add ad-hoc debug prints that show the
memblockq name and to convert between bytes and usecs.
|
|
|
|
|
| |
People who use this code (i.e. mostly filters) would presumably want
volume sharing on by default.
|
|
|
|
|
| |
The header is used in files troughout the tree and is not included in the public api,
so it belongs in pulsecore, not in pulse.
|
|
|
|
|
|
|
|
| |
We want to set the volume callbacks only if volume sharing
is not used. When volume sharing is used, we don't want to
mess with the stream volumes.
This was broken in 6c6b50
|
|
|
|
|
| |
This allows us to flip from software to hardware volume control as the port's
mixer path dictates.
|
|
|
|
|
|
| |
This is not currently useful but future commits will make further
changes concerning automatic setting of flags and event delivery
that makes this structure necessary.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the beginning of work to support compressed formats natively in
PulseAudio. This adds a pa_stream_new_extended() that takes a format
structure, sends it to the server (=> protocol extension) and has the
server negotiate with the appropropriate sink to figure out what format
it should use.
This is work in progress, and works only with PCM streams. Actual
compressed format support in some sink needs to be implemented, and
extensive testing is required.
More details on how this is supposed to work is available at:
http://pulseaudio.org/wiki/PassthroughSupport
|
|
|
|
|
|
|
| |
(Based on Colin's review) We mark modules as being autoloaded so that
they can handle this as a special case if needed (which is required by
module-echo-cancel for now). This inverts how things were done and makes
using these modules manually less error-prone.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mostly warnings about unused stuff.
Furthermore, the first hunk is a fix for the change in 177948a6.
Finally, comment in AEC_dtd was translated and the code simplified slightly.
CC module_bluetooth_device_la-module-bluetooth-device.lo
modules/bluetooth/module-bluetooth-device.c: In function ‘a2dp_process_render’:
modules/bluetooth/module-bluetooth-device.c:1335:30: warning: pointer targets in passing argument 6 of ‘sbc_encode’
differ in signedness [-Wpointer-sign]
../src/modules/bluetooth/sbc/sbc.h:92:9: note: expected ‘ssize_t *’ but argument is of type ‘size_t *’
CC module_rygel_media_server_la-module-rygel-media-server.lo
modules/module-rygel-media-server.c:383:13: warning: ‘append_property_dict_entry_object_array’ defined but not used [-Wunused-function]
CC module_echo_cancel_la-adrian-aec.lo
modules/echo-cancel/adrian-aec.h:360:15: warning: ‘AEC_getambient’ defined but not used [-Wunused-function]
modules/echo-cancel/adrian-aec.h:368:14: warning: ‘AEC_setgain’ defined but not used [-Wunused-function]
modules/echo-cancel/adrian-aec.h:374:14: warning: ‘AEC_setaes’ defined but not used [-Wunused-function]
modules/echo-cancel/adrian-aec.h:377:16: warning: ‘AEC_max_dotp_xf_xf’ declared ‘static’ but never defined [-Wunused-function]
CC module_echo_cancel_la-module-echo-cancel.lo
modules/echo-cancel/module-echo-cancel.c: In function ‘time_callback’:
modules/echo-cancel/module-echo-cancel.c:266:12: warning: variable ‘fs’ set but not used [-Wunused-but-set-variable]
CC module-virtual-sink.lo
modules/module-virtual-sink.c: In function ‘sink_input_pop_cb’:
modules/module-virtual-sink.c:206:15: warning: variable ‘current_latency’ set but not used [-Wunused-but-set-variable]
|
|
|
|
| |
Only whitespace changes in here
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
setup.
If the virtual sink is moved to a new master right after it has been created,
then the virtual sink input's memblockq can be rewound to a negative read
index. The data written prior to the move starts from index zero, so after the
rewind there's a bit of silence. If the memblockq doesn't have a silence
memchunk set, then pa_memblockq_peek() will return zero in such case, and the
returned memchunk's memblock pointer will be NULL.
That scenario wasn't taken into account in the implementation of
sink_input_pop_cb. Setting a silence memchunk for the memblockq solves this
problem, because pa_memblock_peek() will now return a valid memblock if the
read index happens to point to a hole in the memblockq.
I believe this isn't the best possible solution, though. It doesn't really make
sense to rewind the sink input's memblockq beyond index 0 in the first place,
because now when the stream starts to play to the new master sink, there's some
unnecessary silence before the actual data starts. This is a small problem,
though, and I don't grok the rewinding system well enough to know how to fix
this issue properly.
I went through all files that call pa_memblockq_peek() to see if there are more
similar bugs. play-memblockq.c was the only one that looked to me like it might
be broken in the same way. I didn't try reproducing the bug with
play-memblockq.c, though, so I just added a FIXME comment there.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change doesn't add any functionality in itself, but it will be useful in
the future for operating on chains of sinks or sources that are piggy-backing
on each other.
For example, the PA_PROP_DEVICE_MASTER_DEVICE property could
be handled in the core so that each virtual device doesn't have to maintain it
separately. By using the origin_sink and destination_source pointers the core
is able to see at stream creation time that the stream is created by a virtual
device, and then update that device's property list using the name of the
master device that the stream is being connected to. The same thing can be done
also when the stream is being moved from a device to another, in which case the
_MASTER_DEVICE property needs updating.
|
| |
|
| |
|
| |
|
| |
|
|
|