Age | Commit message (Collapse) | Author | Files | Lines |
|
This only works in the single-format case (i.e. we know the format
up-front and we're not negotiating).
|
|
In case the sample spec is not known, as can be the case when
pa_stream_new_extended is used, we cannot satisfy the PULSE_LATENCY_MSEC
request.
As a workaround disable being able to use PULSE_LATENCY_MSEC in this case.
Reported-by: Fritsch <fritsch@xbmc.org>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
|
|
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.
|
|
If somebody tries to push a non-frame-aligned memblock onto the
memblockq, then we should fail the write. Otherwise the daemon will
crash, see https://bugs.freedesktop.org/show_bug.cgi?id=77595
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
|
|
New function allows to pass data pointer that is a member
of the outer structure that need to be freed too when data
is not needed anymore.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
|
|
The check is done for clients that use pa_stream_new() but not for
clients that use pa_stream_new_extended(). This is inconsistent. We
could check that the volume channels match the channels set in the
format info struct that is passed to pa_stream_new_extended(), but
that doesn't work if the format info doesn't contain the channel
information (that can happen if the client wants the server to choose
the channel count for the stream). And it should also be possible to
pass a mono volume for a multi-channel stream. The check could be
extended to handle all these cases, but I don't see much point in
wasting time on that. The server will anyway validate the stream
parameters, it's not particularly important to fail already when the
stream is being created at the client side.
|
|
I think this makes the code a bit nicer to read and write. This also
reduces the chances of off-by-one errors when checking the bounds of
sample rate values.
|
|
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
|
|
This patch removes all occurrences of double and triple
newlines.
Command used for this:
find . -type d \( -name ffmpeg \) -prune -o \
-regex '\(.*\.[hc]\|.*\.cc\)' \
-a -not -name 'adrian-aec.*' -a -not \
-name reserve.c -a -not -name 'rtkit.*' \
-exec sed -i -e '/^$/{N;s/^\n$//}' {} \;
Two passes were needed to remove triple newlines.
The excluded files are mirrored files from external sources.
|
|
This patch replaces every occurrence of ')\n{' with ') {'.
Command used for this:
find . -type d \( -name ffmpeg \) -prune -o \
-regex '\(.*\.[hc]\|.*\.cc\)' \
-a -not -name core-util.c -a -not \
-name adrian-aec.c -a -not -name g711.c \
-exec sed -i -e '/)$/{N;s/)\n{$/) {/}' {} \;
The excluded files are mirrored files from external sources.
|
|
This is only useful while hacking on PulseAudio.
|
|
Previously, if there was a hole in a recording stream,
pa_stream_peek() would crash. Holes could be handled silently inside
pa_stream_peek() by generating silence (wouldn't work for compressed
streams, though) or by skipping any holes. However, I think it's
better to let the caller decide how the holes should be handled, so
in case of holes, pa_stream_peek() will return NULL data pointer and
the length of the hole in the nbytes argument.
This change is technically an interface break, because previously the
documentation didn't mention the possibility of holes that need
special handling. However, since holes caused crashing anyway in the
past, it's not a regression if applications keep misbehaving due to
not handing holes properly.
Some words about when holes can appear in recording streams: I think
it would be reasonable behavior if overruns due to the application
reading data too slowly would cause holes. Currently that's not the
case - overruns will just cause audio to be skipped. But the point is
that this might change some day. I'm not sure how holes can occur
with the current code, but as the linked bug shows, they can happen.
It's most likely due to recording from a monitor source where the
thing being monitored has holes in its playback stream.
BugLink: http://bugs.launchpad.net/bugs/1058200
|
|
This check was valid before we introduced per-source-output volumes, so
dropping it now. Thanks to Alban Browaeys <prahal@yahoo.com> for
catching this.
|
|
This fixes pa_sample_spec init to use the correct API. Not doing so
triggers a valgrind warning as we call pa_sample_spec_valid() on this
later on, which checks the rate and channels fields. Thanks to Rémi
Denis-Courmont for reporting this.
|
|
Signed-off-by: Maarten Lankhorst<m.b.lankhorst@gmail.com>
|
|
|
|
In pa_create_stream_callback, a stream is inserted into
s->context->record_streams only if it's a record stream. Otherwise it's
inserted into s->context->playback_streams. However, in stream_unlink the
stream is removed from s->context->playback_streams only if it's a playback
stream and otherwise it's removed from s->context->record_streams.
Thus, if the stream is an upload stream, we first insert it into
s->context->playback_streams in pa_create_stream_callback and then try to
remove it unsuccessfully from s->context->record_streams in stream_unlink. This
means that we are leaking hashmap entries until the context is freed,
constantly consuming more memory with applications that upload and unload a
large number of samples through one context.
Of course, this begs the question whether upload streams even belong in either
of those hashmaps. I don't want to mess around with the code too much at this
point though, so this patch should be a sufficient improvement.
|
|
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.
|
|
For some reason this assert wasn't triggered earlier -- we shouldn't be
looking at the stream sample_spec if the formats API is used.
|
|
|
|
This patch introduces some extra protocol information, so protocol
version is bumped. This functionality is primarily needed to solve
a long standing issue in alsa-plugins, which should ignore underruns
if and only if it is obsolete, i e, if more data has been written to
the pipe in the meantime (which will automatically end the underrun).
BugLink: http://bugs.launchpad.net/bugs/805940
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
|
|
|
|
|
|
This piggy backs onto the previous changes for protocol 22 and
thus does not bump the version. This and the previous commits should be
seen as mostly atomic. Apologies for any bisecting issues this causes
(although I would expect these to be minimal)
|
|
This helps to keep the API more symmetrical and also potentially
allows support for passthrough monitor sources at some point in the future.
|
|
Passing a NULL-terminated array of pa_format_info pointers is a bit
unwieldy for clients. Instead of this, let's pass in an array of
pointers and the number of elements in the array.
|
|
|
|
source
This quite is an old patch. It was added to N900 to avoid unnecessary
wake-ups when the phone is in power save mode (= blank screen and
no user interaction). In this situation if the user had a browser
window with flash animation open pulseaudio kept waking up every
10 seconds, causing a severe hit to use times.
Anyway I do not see any reason to send timing updates if the sink or
source where the stream is connected to is suspended.
|
|
When the sink format changes and we kill the stream, clients need a way
to know (a) what device they should reconnect to, and (b) what the
stream running time was when the stream got killed (pa_stream_get_time()
won't work after the stream has been killed). This adds these two bits
of information in the event callback's proplist parameter.
|
|
|
|
This adds some checks that I'd postponed and adds a
"should-be-good-enough" guess for tlength when using a compressed
format.
|
|
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
|
|
|
|
Use #include "header.h" if functionality of header.h is implemented
and #include <header.h> if functionality of header.h is used.
|
|
Only whitespace changes in here
|
|
This prevents the smoother attached to the stream clock from being
updated while the stream is corked, which in turn ensures that once
corking is completed, pa_stream_get_time() always returns the same value
until the stream is uncorked - i.e., the clock does not advance when the
client believes that it will not.
The actual call to pa_smoother_put() happens on things like stream
suspend/unsuspend, which trigger timing updates. This changes the
smoother coefficients, which means that a call to pa_smoother_get() for
the same value of 'x' can return different values before and after a
timing update.
|
|
Second version after Tanu's feedback
TODO:
- notify client that volume control is disabled
- change sink rate in passthrough mode if needed
- automatic detection of passthrough mode instead of hard
coded profile names
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
|
|
not know anything about
All seeks/flushes that depend on the playback buffer read pointer cannot
be accounted for properly in the client since it does not know the
actual read pointer. Due to that the clients do not account for it at
all. We need do the same on the server side. And we did, but a little
bit too extreme. While we properly have not applied the changes to the
"request" counter we still do have to apply it to the "missing" counter.
This patch fixes that.
|
|
This allows easy overriding of a clients latency setting for debugging
purposes.
http://pulseaudio.org/ticket/753
|
|
|
|
Do not subtract bytes the client sends us beyond what we requested from
our missing bytes counter.
This was mostly a thinko that caused servers asking for too little data
when the client initially sent more data than requested, because that
data sent too much was accounted for twice.
This commit fixes this miscalculation.
http://bugzilla.redhat.com/show_bug.cgi?id=534130
|
|
Since the stream identifiers (channels) are monotonically growing integer, it
isn't a good idea to use them as index to a dynamic array, because the array
will grow all the time. This is not a problem with client connections that
don't create many streams, but, for example, long-running clients that use
libcanberra for playing event sounds, this means that the client connection
effectively leaks memory.
|
|
state change so that in the STARTED/UNDERFLOW callbacks we accurate transport latency information
|
|
don't want the timer to advance when we are supposedly already paused
|
|
in corked state
|
|
|
|
|
|
|
|
|
|
|