Commit graph

330 commits

Author SHA1 Message Date
poljar (Damir Jelić)
d806b19714 Remove pa_bool_t and replace it with bool.
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
2013-07-04 12:25:30 +03:00
poljar (Damir Jelić)
97da92d894 Whitespace cleanup: Remove all multiple newlines
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.
2013-06-24 16:56:24 +03:00
Arun Raghavan
c6df40a539 tests: Make loopback latency test more accurate
This makes sure that we always take the timing at the point when we
write out the pulse, making the overall latency measurement more
accurate.
2013-06-04 00:38:44 +05:30
Arun Raghavan
e001cc1424 tests: Factor out loopback setup code
This moves over setup code for the loopback latency test into a private
library so that we can easily write more tests using the same framework.
2013-06-04 00:38:44 +05:30
Arun Raghavan
36bdd720aa tests: Adjust latency test calibration
This makes the test more robust by:

1. Decreasing the '1' threshold during calibration - the RMS value for
   the sine wave will be 0.5, so the previous code was making us take
   the ALSA mixer past 0dB.

2. Using the difference rather than absolute value for 0->1 transitions,
   so that we're somewhat independent noise in our calculations.
2013-06-04 00:38:44 +05:30
Arun Raghavan
3f16c7100b tests: Make loopback latency test run with rt priority 2013-06-04 00:38:44 +05:30
Arun Raghavan
0862a281aa tests: Add a latency measurement test
This test is intended to measure real latency by playing a sample to a
sink and capturing that over a loopback interface. The loopback can
either be physical (cable running from headphone out to line in) or
virtual (monitor source or module loopback).

Also included in this is calibration code to make sure that volumes are
sufficiently adjusted to be able to detect the played back signal (and
that there aren't false positives due to line noise).

One of the objectives of all this is to later factor out the setup code
to allow us to easily write more loopback tests for various
functionality (volumes, resampling, mixing, etc.).
2013-06-04 00:38:44 +05:30
Arun Raghavan
11d8da83d4 alsa: Fix mixer path when running from build tree
The mixer paths are not available in ${builddir} - we need to look in
${srcdir}. This should fix running an in-tree build without make install
as well as alsa-mixer-path-test in make distcheck.

Since the most straightforward way to define PA_SRCDIR was in
Makefile.am, I'm moving PA_BUILDDIR there as well for consistency.
2013-04-14 11:27:41 +05:30
Arun Raghavan
93a4a82bd3 tests: Minor alsa-time-test improvments
Tries to get RT privs and prints elapsed time and a periodic header to
make grokking the output easier.
2013-03-25 09:47:04 +00:00
David Henningsson
c6806efb09 tests: Add tests for alsa-mixer paths
It checks all files in the mixer/paths directory and checks
 - that the file can be parsed without errors
 - that the file is actually shipped in the makefile

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-03-25 08:30:32 +01:00
Peter Meerwald
da5f03b7f5 tests: add test/performance comparison for mixing special-case code
x86-64, i7-870, 3 GHz gcc -O0, 100 TIMES

mix s16 generic 1 channel: 286503 usec (avg: 2865.03, min = 2673, max = 6892, stddev = 425.996).
mix s16 2 streams 1 channel: 136490 usec (avg: 1364.9, min = 1304, max = 1686, stddev = 73.4594).

mix s16 generic 2 channels: 590472 usec (avg: 5904.72, min = 5342, max = 16027, stddev = 1079.34).
mix s16 2 channels: 380369 usec (avg: 3803.69, min = 3570, max = 5041, stddev = 234.831).
mix s16 2 streams: 316254 usec (avg: 3162.54, min = 3034, max = 3536, stddev = 107.716).
mix s16 2 streams 2 channels: 269645 usec (avg: 2696.45, min = 2585, max = 3027, stddev = 87.9661).

x86-64, i7-870, 3 GHz gcc -O2, 1000 TIMES

mix s16 generic 1 channel: 371550 usec (avg: 3715.5, min = 3515, max = 10534, stddev = 760.071).
mix s16 2 streams 1 channel: 207750 usec (avg: 2077.5, min = 2009, max = 2271, stddev = 58.6076).

mix s16 generic 2 channels: 724294 usec (avg: 7242.94, min = 6937, max = 10350, stddev = 363.451).
mix s16 2 channels: 345661 usec (avg: 3456.61, min = 3291, max = 5586, stddev = 256.309).
mix s16 2 streams: 559243 usec (avg: 5592.43, min = 5349, max = 6705, stddev = 223.271).
mix s16 2 streams 2 channels: 390101 usec (avg: 3901.01, min = 3696, max = 5345, stddev = 213.482).

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-02-16 01:08:10 +02:00
Peter Meerwald
cf8e67ede8 tests: Add NEON mix test cases to cpu-test
on beagle-xm (Cortex-A8)

Initialising ARM NEON optimized mixing functions.
Checking NEON mix
Testing 2-channel mixing performance with 7 sample alignment
func: 2329073 usec (avg: 23290.7, min = 18127, max = 65368, stddev = 10404.2).
orig: 7931126 usec (avg: 79311.3, min = 65002, max = 239411, stddev = 35885.6).

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-02-15 23:24:15 +02:00
Peter Meerwald
c23963a99f tests: Add mult-s16 test
test mostly compares runtime of 64 bit vs 32 bit s16ne-by-volume multiplication

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-02-15 21:34:13 +02:00
Peter Meerwald
95b64804ab core: Move pa_mix() into new file mix.c
idea is to allow optimized code path (similar to volume code)
and rework/specialize mixing cases to enable runtime performance improvements

no functionality changes in this patch

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-02-15 21:33:07 +02:00
Peter Meerwald
bc8b6eaf95 tests: Volume-test seems to be long-running, set timeout
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-02-15 21:27:07 +02:00
Tanu Kaskinen
3b3d26813f tests: Indicate failure in test-daemon.sh by returning 1 if any test fails. 2013-02-06 14:15:09 +02:00
Peter Meerwald
34c631c0ae tests: Fix sconv sample correctness in cpu-test
do allow up to one sample difference
cleanup output of signed shorts (use 0xhx)

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 10:06:03 +02:00
Tanu Kaskinen
e8f1cfd9a5 tests: Fix function argument wrapping style in cpu-test.c. 2013-02-01 09:06:18 +02:00
Peter Meerwald
01a7c6b4e6 tests: Add remap test code to cpu-test
v2 (comments by Paul Menzel):
* generate test samples from -1..1, -0x8000..0x7fff
* check all output samples (not just half of them)

the idea is to compare the output of the C (reference) implementation
against the output of the optimized code path; currently, there are MMX
and SSE implementation for the mono-to-stereo remapper for s16 and float
sample formats

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Cc: Paul Menzel <paulepanter@users.sourceforge.net>
2013-02-01 08:30:28 +02:00
Peter Meerwald
60aeb3dd23 tests: Test both, SSE and SSE2, sconv in cpu-test
SSE sconv was not tested before, only SSE2 was (on CPUs supporting both
instruction sets)

now both code path are tested on CPUs supporting both

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 07:30:06 +02:00
Peter Meerwald
2dc51f3371 tests: Fix potential out-of-bound access violation in svolume cpu-test
nsamples should be forced to be a multiple of channels; do so correctly
and don't make nsamples larger than it actually is

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 07:23:16 +02:00
Peter Meerwald
3a942fc191 tests: Fix conversion typo in cpu-test
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 07:23:00 +02:00
Peter Meerwald
c5514d65e1 tests: Fix allowed sample formats in resampler-test usage text
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-01-04 15:51:11 +02:00
Tanu Kaskinen
2567bc10ec smoother-test: Fix array overflow. 2012-12-19 12:31:50 +02:00
Arun Raghavan
700cd890a9 Revert "tests: modify alsa-time-test to use 'check' framework"
This reverts commit 1569601864.

Rethinking this, it makes more sense to not add this to the check
framework. This is mostly useful for exposing ALSA driver issues, and
it's handy to be able to build this as a standalone executable.
2012-11-05 17:48:20 +05:30
Arun Raghavan
96fa87086d tests: Minor alignment adjustment fix for cpu-test 2012-10-30 20:34:20 +05:30
Arun Raghavan
03e9d3d0d7 tests: Fix a cpu-test debug message
We align at sample granularity and not byte granularity (which might
violate arch alignment requirements).
2012-10-30 15:00:45 +05:30
Arun Raghavan
f10e663d04 tests: Run svolume on different channel counts
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).
2012-10-30 15:00:45 +05:30
Arun Raghavan
58b61a9d16 tests: Make cpu-test less verbose
Drops the correctness debug output since we want to run this several
times, and the output becomes much more verbose than required.
2012-10-30 11:27:19 +05:30
Arun Raghavan
a172db5c0d tests: Run svolume test for various sample alignments
Allows us to make sure that svolume works independently of sample
alignment, and that performance doesn't degrade based on this.
2012-10-30 11:18:08 +05:30
Arun Raghavan
654444eda9 tests: Minor cpu-test fixes for non-NEON builds
The s16->float test is only run on ARM with NEOn at the moment, so we
don't define that code in other cases.
2012-10-29 14:42:42 +05:30
Arun Raghavan
2ec891d892 tests: Print average outer-loop iteration time in cpu-test 2012-10-29 14:37:18 +05:30
Arun Raghavan
17b5a36130 tests: Increase sconv cpu-test timeout
This takes longer on ARM CPUs, especially older ones.
2012-10-29 14:37:18 +05:30
Arun Raghavan
32b4e848ae tests: Allow off-by-one error in sconv test
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.
2012-10-29 14:36:33 +05:30
Peter Meerwald
f558327cca tests: Implement test code for ARM NEON sconv s16_to_float
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2012-10-29 13:13:38 +05:30
Peter Meerwald
bd7229b38a tests: Fix test description in cpu-test
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2012-10-29 13:13:38 +05:30
Peter Meerwald
1319c4533a core: Add ARM NEON optimized sample conversion code
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
2012-10-29 12:49:37 +05:30
Arun Raghavan
fe0ba245e5 tests: Run sconv tests with multiple alignments
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.
2012-10-25 10:11:24 +05:30
Arun Raghavan
7914e1286b tests: Add a basic sanity test to sconv cpu-test
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.
2012-10-24 10:12:06 +05:30
Arun Raghavan
472fe05297 tests: Reorganise cpu-test to reuse code
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.
2012-10-24 10:12:06 +05:30
Arun Raghavan
3f44eb0559 tests: Factor out core sconv test code in cpu-test
This will let us add tests for non-SSE sconv tests.
2012-10-24 10:12:06 +05:30
Arun Raghavan
0d2bef6c78 tests: Add a copyright header to cpu-test 2012-10-24 10:12:05 +05:30
Arun Raghavan
b87067a007 tests: Minor cpu-test reorganisation
Make volume and conversion tests separate test cases.
2012-10-19 19:44:10 +05:30
Arun Raghavan
f8017bb19d tests: Factor out ARM svolume test into cpu-test
This allows us to run the testing code separately from the PulseAudio
daemon, which makes developing / regression testing this code a lot
easier.
2012-10-19 19:43:30 +05:30
Tanu Kaskinen
3d6092bb0f memblock: Add pa_memblock_acquire_chunk().
Besides making the code a bit cleaner, this also gets rid of
a few "cast increases required alignment of target type"
warnings.
2012-08-22 09:47:03 +03:00
Deng Zhengrong
8e0f50c176 tests: fix the wrong library path in check-daemon 2012-08-20 07:27:43 +05:30
Deng Zhengrong
70acd7bf66 tests: modify ipacl-test to use 'check' framework 2012-08-20 07:06:00 +05:30
Deng Zhengrong
deeb0f05b3 tests: modify once-test to use 'check' framework 2012-08-20 07:06:00 +05:30
Deng Zhengrong
b095ebd502 tests: modify lock-autospawn-test to use 'check' framework 2012-08-20 07:06:00 +05:30
Deng Zhengrong
d9841a9431 tests: modify rtpoll-test to use 'check' framework 2012-08-20 07:06:00 +05:30