Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
This reverts commit 5bc6cadcb2e7255fd333ed88cc80b61a7673ddd9.
I wasn't meaning to push this out - just merged for review / testing.
|
|
A rewind may erase data that sink_input counted in playing_for or
underrun_for earlier. Add code adjusting those values after a rewind.
One visible symptom of this bug was problems recovering from an
underrun. When a client calls pa_stream_write() with a large block of
memory, the function can split that into smaller pieces before sending
it to the server. When receiving new data for a stream that had
silence queued due to underrun, the server would do a rewind to
replace the queued-but-not-played silence with the new data. Because
of the bug, this rewind itself would not change underrun_for. It's
possible for multiple rewinds to be done without filling the sink
buffer in between (which is what would eventually reset underrun_for).
In this case, the server rapidly processing the split packets would
rewind the stream for _each_ of them (as underrun_for would stay set),
erasing valid audio as a result.
|
|
As Peter Meerwald <p.meerwald@bct-electronic.com> discovered, our ARM
svolume code performance is quite terrible when the incoming samples are
not word-aligned. This can very easily be the case, since the
architecture only requires that the samples be 16-bit aligned, and we
might end up running the innermost loop after processing modulo-4
samples. The performance degradation was ~50x on a Cortex A9
(Pandaboard).
This reworks the svolume logic to first consume enough samples to make
sure the rest is word aligned, and reordering the processing to work
with 4 samples at a time first, and then finally deal with the
remainder.
With this, performance is comparable for arbitrary alignments (~3x
faster than the C code).
|
|
|
|
The callback relies on the sample spec being finalized, which is not
true with the NEW hook.
In case you're wondering about the "hook EARLY - 1, to match before
stream-restore" comment that was not changed even though the code that
the comment concerned was changed: the comment was apparently written
at a time when module-stream-restore used the NEW hook too, and later
stream-restore has been changed to use the FIXATE hook. So, the
comment was wrong/nonsensical before this patch. Since these two
modules now use the same hook again, the comment makes sense again.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=55135
|
|
Previously thread_func() used PA_SINK_IS_OPENED() to check whether
some data should be rendered. process_render_null() used a different
check: it would return immediately if the sink was not in the RUNNING
state. This caused a busy loop when the sink was in the IDLE state,
because process_render_null() didn't update the timestamp, and
thread_func() still kept the timer active using the old timestamp.
pa_rtpoll_run() would return immediately because of the old timestamp.
This is fixed by using the same check in both thread_func() and
process_render_null(). Since the checks are the same, it's actually
redundant to have the check in process_render_null(), so it is now an
assertion.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=54779
|
|
The sink has different frame size than the sink input, so
the max_request and max_rewind values of the sink input need
to be converted when setting the sink max_request and
max_rewind values.
The conversion is already done correctly in
sink_input_update_max_request_cb() and
sink_input_update_max_rewind_cb().
|
|
Once the sink input has been routed in pa_sink_input_new(),
the sample spec and channel map have already become fixed.
The sink input and source output must use the same stream
format, because the data is copied as-is.
|
|
When module-loopback is loaded without arguments, the ss and
map variables are initialized with dummy values. This caused
a problem, because also pa_memblockq_new() was called with
the dummy values, making it work incorrectly. The base was
set to 1 instead of the real frame size, which in turn
caused alignment related crashes.
|
|
potentially big numbers.
This fixes at least one crash that has been observed. The
multiplication in trivial_resample() overflowed when
resampling from 96 kHz to 48 kHz, causing an assertion
error:
Assertion 'o_index * fz < pa_memblock_get_length(output->memblock)' failed at pulsecore/resampler.c:1521, function trivial_resample(). Aborting.
Without the assertion, the memcpy() after the assertion
would have overwritten some random heap memory.
|
|
|
|
When compiling without HAVE_SYMLINK the runtime dir is a real directory,
which is attempted to be created. In the case it already exists we shouldn't
error out. The HAVE_SYMLINK-enabled code already does this.
|
|
Currently, Windows versions of pacat and friends fail because the current
poll emulation is not sufficient (it only works for socket fds).
Luckily Gnulib has a much better emulation that seems to work good enough.
The implementation has been largely copied (except a few bug fix
regarding timeout handling, to be pushed upstream) and works on pipes
and files as well. The copy has been obtained through their gnulib-tool utility,
which gives a LGPLv2.1+ licensed file.
This fixes the "Assertion (!e->dead) failed" error coming and lets pacat
and friends stream happily to/from a server (I didn't actually test parec).
|
|
Since we mandate C99 support, not reason to keep this around.
|
|
We align at sample granularity and not byte granularity (which might
violate arch alignment requirements).
|
|
This adds checks to run svolume tests with 1, 2 and 3 channels (we don't
run Orc with 3 channels since only 1/2-ch are implemented there).
|
|
Drops the correctness debug output since we want to run this several
times, and the output becomes much more verbose than required.
|
|
Allows us to make sure that svolume works independently of sample
alignment, and that performance doesn't degrade based on this.
|
|
|
|
|
|
The s16->float test is only run on ARM with NEOn at the moment, so we
don't define that code in other cases.
|
|
|
|
This takes longer on ARM CPUs, especially older ones.
|
|
With some optimised sconv implementations (read NEON), rounding
inaccuracy might lead to a difference of 1 with the reference
implementation. The inaccuracy is worth the performance gain.
Also increases floating-point accuracy while printing errors to make
errors easier to analyse.
|
|
Rounding with 0.5 causes us to always round up for any value of the form
x.5. IEEE754 specifies round-to-nearest-even as the behaviour in this
case. This might not always be possible with NEON code, but this change
gets us much closer to it.
|
|
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
|
|
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
|
|
final:
* includes some minor style fixes and build-time changes to allow
building a single binary for neon and non-neon systems
v4:
* fix for sample length < 4
v3:
* convert from intrinsics to inline assembly
v2:
* load and store data with vld1/vld1q and vst1/vst1q, resp., to work
around alignment issues of compiler-generated vldmia instruction
* remove redundant check for NEON flags
Ubuntu/Linaro gcc 4.6.3
arm-linux-gnueabi-gcc -O2 -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=neon
runtime on beagle-xm:
D: [pulseaudio] sconv_neon.c: checking NEON sconv_s16le_from_float
I: [pulseaudio] sconv_neon.c: NEON: 3754 usec.
I: [pulseaudio] sconv_neon.c: ref: 58594 usec.
D: [pulseaudio] sconv_neon.c: checking NEON sconv_s16le_to_float
I: [pulseaudio] sconv_neon.c: NEON: 1831 usec.
I: [pulseaudio] sconv_neon.c: ref: 10528 usec.
I: [pulseaudio] sconv_neon.c: Initialising ARM NEON optimized conversions.
conversion may be off by one for some samples due to rounding issues
|
|
Commit dd31d652a ("utils: Adding a function to get volume from string")
uses pa_sw_volume_from_dB(), which is part of libpulse, in libpulsecore.
This breaks as-needed builds. We fix this by also building the volume
code in libpulsecommon.
|
|
|
|
UUIDs might be announced at any time, so a hook is needed to notify any
interested module. In practice, the UUIDs are quite stable with the
exception of the pairing procedure, where the UUIDs are reported by
BlueZ as soon as they are discovered.
|
|
Card profiles -specially the ones registered with pa_card_add_profile()-
might need to create new ports during the lifetime of the card.
|
|
Some cards might need to add profiles during their lifetime, that is,
after the card has been created.
|
|
The allowed volume formats are dB, % or integer.
For example: 10% or 10db or 10.
|
|
This allows us to test the sconv code with the incoming samples at
various byte alignments. The test is also now split into correctness and
performance checks.
|
|
The IDT/Sigmatel codec driver often creates a "Mic Jack Mode" for
every mic jack, so it can change functionality between Mic and Line In.
However, as the "Mic Jack" is the standard naming, our current solution
does not make the Line In port unavailable when nothing is plugged in.
This patch makes the "Line In" port not to be created just because there
is a "Mic Jack Mode" that could be set to "Line". This makes the behaviour
consistent with e g "Dock Mic Jack Mode", "Front Mic Jack Mode" etc, where
we don't create a "Dock Line" or "Dock Mic" port either.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
|
|
modules/rtp/module-rtp-recv.c:462:8: warning: 'r' may be used uninitialized in this function [-Wuninitialized]
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
|
|
v2: better log message
|
|
Otherwise, the hrir might be too short to get completely resampled
v2: take different sample rates into account
|
|
Fixing the documentation for the function pa_cvolume_dec().
|
|
This seems redundant with the previous check in that function, but it
makes sure that the result of the speed comparison is what we think it
is.
|
|
This factors out the basic measurement code for each test into a
separate block so that each test can be broken down into a basic
correctness test, and a performance comparison with minimum effort.
|
|
This will let us add tests for non-SSE sconv tests.
|
|
|
|
pa_atou() return value was not checked, and the cast of a
16-bit variable pointer to a 32-bit variable pointer could
corrupt cseq.
|
|
Am 23.10.2012 08:25, schrieb Arun Raghavan:
> On Tue, 2012-08-21 at 13:32 +0200, Thomas Martitz wrote:
>> Am 21.08.2012 08:51, schrieb Rémi Denis-Courmont:
>>> Le mardi 21 août 2012 00:50:34 Thomas Martitz, vous avez écrit :
>>>> There are tons of warnings, most of them because the function is not
>>>> recognized as printf-like.
>>> Removing checks looks very fishy.
>>>
>>> To use C99 and/or GNU format specifiers on MingW, you need to use the
>>> gnuprintf attribute instead of printf. With printf, the format string is
>>> validated according to the antiquated MSVC rules.
>>>
>> Interesting, I didn't know about gnuprintf. FWIW, what are those
>> antiquated MSVC rules? I assumed the return value which isn't int for
>> some affected functions?
> Is this one going to be respun?
>
Yes, here you go.
>From c5f15eec69bf95c9a1261e0d82abbd039156e75e Mon Sep 17 00:00:00 2001
From: Thomas Martitz <kuge@rockbox.org>
Date: Wed, 8 Aug 2012 17:38:04 +0200
Subject: [PATCH 1/3] gccmacro: Work around warnings due to printf redirection
by libintl.
Libintl defines printf as libintl_printf, which breaks the format
attribue. Unfortunately the workaround around provided by libintl
is only enabled for cygwin, but not for mingw builds. Therefore
install the workaround manually.
|
|
Put the created ports in a hashmap, but not necessarily inside a struct
pa_card_new_data.
|
|
Use a helper function to create the card profiles, given an UUID.
|
|
CXX libwebrtc_util_la-webrtc.lo
modules/echo-cancel/webrtc.cc: In function 'pa_bool_t pa_webrtc_ec_init(pa_core*, pa_echo_canceller*, pa_sample_spec*, pa_channel_map*, pa_sample_spec*, pa_channel_map*, uint32_t*, const char*)':
modules/echo-cancel/webrtc.cc:196:9: warning: 'rm' may be used uninitialized in this function [-Wuninitialized]
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
|