Commit graph

330 commits

Author SHA1 Message Date
Arun Raghavan
3e0c30622b tests: Set appropriate timeouts for a couple of tests
sync-playback just had a much longer timeout than it should have, and
extended-test was using the default. We set the expected amount of time,
so the test is more correct (if it takes longer than this, something
probably actually broke).
2015-11-06 17:58:50 +05:30
Deepak Srivastava
2d5eec2d2c Rename functions with "tostring" in the name to one with "to_string" to conform with the convention.
component: core

<EP-E358F00C1D9A449EAE69225B9D2530F8>
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88833

Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
2015-09-25 17:29:02 +05:30
Michael Cree
392060d0fc tests: Fix test-suite failure on Alpha
Pulseaudio fails to build on the Alpha architecture due to a failure
in the volume-test of the test suite.  I had reported this to the
Debian bug tracker [1] but the maintainer has asked that I forward the
patch to this mail list.  The failure in volume-test occurs because it
is compiled with -ffast-math which implies -ffinite-math-only of which
the gcc manual states that it optimizes for floating-point arithmetic
with the assumption that arguments and results are not NaNs or
+/-infinity, and futher notes that it may result in incorrect output.
On the Alpha platform that is somewhat an understatement as the use of
non-finite floating-point arithmetic with -ffinite-math-only results in
a floating-point exception and the termination of the program.

The volume-test converts volumes into decibels (so a zero volume
becomes a negative infinity) and proceeds to add two volumes (in
decibels), thus does arithmetic with non-finite floating point numbers
despite being compiled with -ffast-math!

I attach a patch that protects against the arithmetic with non-finite
numbers for your consideration.  With that patch the test-suite passes
on Alpha.

Cheers
Michael.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798248
2015-09-17 08:12:49 +02:00
David Henningsson
733e4bce5b lfe-filter-test: Use S16NE format
...otherwise this code will fail on big-endian architectures.

Cc: Hui Wang <hui.wang@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-06-01 11:05:24 +02:00
Hui Wang
a7d41ef043 tests: add tolerant variation for comparing the rewind result
On 32bits OS, this test case fails. The reason is when rewinding to
the middle of a block, some of float parameters in the saved_state
are stored in the memory from FPU registers, and those parameters will
be used for next time to process data with lfe. Here if FPU register
is over 32bits, the storing from FPU register to memory will introduce
some variation, and this small variation will introduce small
variation to the rewinding result.

So adding the tolerant variation for comparing the rewind result, make
this test case can work on both 64bits OS and 32bits OS.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2015-05-25 14:35:34 +02:00
Hui Wang
fec553170a tests: Remove a redundant mempool_new from resampler-test
Signed-off-by: Hui Wang <hui.wang@canonical.com>
2015-05-25 08:44:11 +02:00
Hui Wang
98e01c8a9c tests: adding lfe-filter-test
so far, this test only includes rewind test, it works as below:
let lfe-filter process 2 blocks mono lfe channel audio samples, the
sample format is PA_SAMPLE_S16LE, save the processed data to the temp
buffer, then rewind the lfe-filter back 1 block and 1.5 blocks
respectively, reprocess the audio samples from the rewind position,
then comparing the output data with previously saved data.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2015-03-30 10:52:30 +02:00
Hui Wang
c36e191ce5 lfe-filter: change the crossover frequency as a parameter
Add a user defined parameter lfe-crossover-freq for the lfe-filter,
to pass this parameter to the lfe-filter, we need to change the
pa_resampler_new() API as well.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2015-03-30 10:52:30 +02:00
Peter Meerwald
5a2c41e5bf packet: Hide internals of pa_packet, introduce pa_packet_data()
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26 23:23:17 +01:00
Ondrej Holecek
5effc83479 update FSF addresses to FSF web page
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.
2015-01-14 22:20:40 +02:00
Felipe Sateler
13a3daa928 Fix #defines for Debian GNU/kFreeBSD
Because debian does not run with the freebsd libc, but rather uses the
GNU one, it chose to not define __FreeBSD__, but rather __FreeBSD_kernel__.
Use the alternative when the functionality tested is for kernel
features, and keep the __FreeBSD__ one when using freebsd libc
headers.

If this patch is applied, debian could drop all the current patches when
importing 6.0 :)
2014-12-01 12:11:07 +01:00
Peter Meerwald
09a3d904a1 tests: Use pa_assert_se() to get rid of an used variable warning
when compiled with NDEBUG

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-17 13:25:04 +01:00
Peter Meerwald
68cc36140b core: Annotate variables only used within assert()s to be PA_UNUSED
supresses a warning when compiling with NDEBUG:

pulsecore/aupdate.c: In function 'pa_aupdate_read_end':
pulsecore/aupdate.c:82:14: warning: variable 'n' set but not used [-Wunused-but-set-variable]
     unsigned n;

pulsecore/sink-input.c: In function 'pa_sink_input_unlink':
pulsecore/sink-input.c:648:27: warning: variable 'p' set but not used [-Wunused-but-set-variable]
     pa_source_output *o, *p = NULL;

pulsecore/sink-input.c: In function 'find_filter_sink_input':
pulsecore/sink-input.c:1523:14: warning: unused variable 'i' [-Wunused-variable]
     unsigned i = 0;

pulsecore/sink-input.c: In function 'pa_sink_input_start_move':
pulsecore/sink-input.c:1569:27: warning: variable 'p' set but not used [-Wunused-but-set-variable]
     pa_source_output *o, *p = NULL;

  CC       pulsecore/libpulsecore_5.0_la-sink.lo
pulsecore/sink.c: In function 'pa_sink_unlink':
pulsecore/sink.c:673:24: warning: variable 'j' set but not used [-Wunused-but-set-variable]
     pa_sink_input *i, *j = NULL;

   pulsecore/source-output.c: In function 'find_filter_source_output':
pulsecore/source-output.c:1179:9: warning: unused variable 'i' [-Wunused-variable]
     int i = 0;

  CC       pulsecore/libpulsecore_5.0_la-source.lo
pulsecore/source.c: In function 'pa_source_unlink':
pulsecore/source.c:616:27: warning: variable 'j' set but not used [-Wunused-but-set-variable]
     pa_source_output *o, *j = NULL;

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-17 13:24:51 +01:00
Peter Meerwald
fa092af59c rtpoll: Drop extra wait_op argument to pa_rtpoll_run()
is always true, not used

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:53:06 +01:00
Peter Meerwald
101092465d core: Replace assert()s with pa_assert()s
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:14:33 +01:00
Arun Raghavan
8718496d14 creds: Rename pa_ancil to pa_cmsg_ancil_data
Makes the purpose of the structure clearear.
2014-10-31 10:46:10 +05:30
Peter Meerwald
72e5671ece tests: Be careful with data types to avoid cast
use unsigned and size_t for counters and packet length, resp.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-10-28 17:36:22 +01:00
Peter Meerwald
974fd3bcfd tests: Make global variables static in srbchannel-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-10-28 17:36:22 +01:00
David Henningsson
c45c0b1490 connect-stress-test: Fix number of streams per sink to "20"
This test broke when PA_MAX_INPUTS_PER_SINK was increased from 32 to 256.
Because we currently don't have time to figure out why, let's just set
NSTREAMS to 20 in the meantime.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-10-16 12:25:49 +02:00
David Henningsson
f8aa823998 alsa-time-test: Make constants for channels and rate
Hard-coding constants on several places is bad coding practice.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-18 11:51:47 +02:00
David Henningsson
c9e8c0703f alsa-time-test: Do not use Lennart's card by default
Lennart probably had a card with a specific name. It is not a
common name anymore.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-18 11:51:42 +02:00
David Henningsson
d303489ef0 alsa-time-test: Add fillrate parameter
As a third parameter, add the number of samples to read/write in
every iteration. This will help slow CPUs.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-18 11:51:37 +02:00
Peter Meerwald
eed6d95f49 tests: Remove mix-special-test
code has been moved to cpu-mix-test

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:56:03 +02:00
Peter Meerwald
f8fe25e8df tests: Use float constants in cpu-sconv-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:56:03 +02:00
Peter Meerwald
ce9318fb72 tests: Add ARM NEON test code to cpu-remap-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:56:03 +02:00
Peter Meerwald
d8be5cbf8b tests: Add rearrange remapping test cases to cpu-remap-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:55:59 +02:00
Peter Meerwald
c68c9f3aa2 tests: Add to remapping special case code tests to cpu-remap-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:54:51 +02:00
Peter Meerwald
7ae700941c tests: Reorganize cpu-remap-test program
Make run_remap_test() support up to 8 input and output channels.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:54:39 +02:00
Peter Meerwald
8f4897e162 tests: Use remap function passed in remap struct
Cleanup and add function to setup remap struct

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:12 +02:00
Peter Meerwald
173649e4f7 tests: Add ARM NEON test code to cpu-mix-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:12 +02:00
Peter Meerwald
d58446963f tests: Add tests for mix special-case code
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:12 +02:00
Peter Meerwald
9576ba2d9e tests: Use single-line #ifdef for ARM NEON code
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:11 +02:00
Peter Meerwald
4ca3216ee3 tests: Split cpu tests in separate files
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:11 +02:00
Peter Meerwald
293a1739e2 endianmacros: Replace borked PA_FLOAT32_SWAP() with PA_READ_FLOAT32RE() / PA_WRITE_FLOAT32RE()
building PA with -O0 leads to test failure in mix-test on i386

issue reported by Felipe, see
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021406.html

the problem is the value 0xbeffbd7f: when byte-swapped it becomes 0x7fbdffbe and according
to IEEE-754 represents a signalling NaN (starting with s111 1111 10, see http://en.wikipedia.org/wiki/NaN)

when this value is assigned to a floating point register, it becomes 0x7ffdffbe, representing
a quiet NaN (starting with s111 1111 11) -- a signalling NaN is turned into a quiet NaN!

so PA_FLOAT32_SWAP(PA_FLOAT32_SWAP(x)) != x for certain values, uhuh!

the following test code can be used; due to volatile, it will always demonstrate the issue;
without volatile, it depends on the optimization level (i386, 32-bit, gcc 4.9):

// snip

static inline float PA_FLOAT32_SWAP(float x) {
    union {
        float f;
        uint32_t u;
    } t;

    t.f = x;
    t.u = bswap_32(t.u);
    return t.f;
}

int main() {
  unsigned x = 0xbeffbd7f;
  volatile float f = PA_FLOAT32_SWAP(*(float *)&x);
  printf("%08x %08x %08x %f\n", 0xbeffbd7f, *(unsigned *)&f, bswap_32(*(unsigned *)&f), f);
}
// snip

the problem goes away with optimization when no temporary floating point registers are used

the proposed solution is to avoid passing swapped floating point data in a
float; this is done with new functions PA_READ_FLOAT32RE() and PA_WRITE_FLOAT32RE()
which use uint32_t to dereference a pointer and byte-swap the data, hence no temporary
float variable is used

also delete PA_FLOAT32_TO_LE()/_BE(), not used

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reported-by: Felipe Sateler <fsateler@debian.org>
2014-09-04 09:58:20 +02:00
David Henningsson
764da4260a Make all debug/info level messages untranslatable
Debug and info messages are primarily meant for developers,
rather than end users. Let's save translators' time,
and leave them untranslated.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-02 12:50:22 +02:00
Peter Meerwald
c32e12e7b9 tests: Check expected result of sigbus-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-18 15:31:41 +02:00
Peter Meerwald
1849cfdad9 misc: Fix format specifiers
to print a pa_usec_t, the format specifier to use is "%" PRIu64

modules/module-combine-sink.c: In function 'update_latency_range':
modules/module-combine-sink.c:750:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'pa_usec_t' [-Wformat]
modules/module-combine-sink.c:750:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'pa_usec_t' [-Wformat]

to print a size_t, use %zu

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-18 15:31:19 +02:00
Peter Meerwald
eca6217129 tests: Fix mix-test on big-endian systems
the mix test code never worked on big-endian systems

patch saves a lot of duplicate test and uses more logical naming

see
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021035.html

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reported-by: Felipe Sateler <fsateler@debian.org>
2014-08-12 21:28:52 +02:00
Peter Meerwald
e14863334b tests: Cleanup mix-test
indentation and use of fabsf() for floats

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-10 12:20:52 +03:00
Peter Meerwald
1499271f46 mix: Fix mixing of S24 samples stored as S32RE
pa_mix_s24_32re_c() should advance m->ptr by sizeof(int32_t)

http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-10 10:33:28 +03:00
David Henningsson
1afec0e5a3 tests: Add pstream/srbchannel test
Runs four tests:
 1) Small packets, iochannel
 2) Big packets, iochannel
 3) Small packets, srbchannel
 4) Big packets, srbchannel

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:30:56 +02:00
Peter Meerwald
073128fbc8 tests: Adapt memblock-test to changed pa_memimport_get()
patch 'memblock, pstream: Allow send/receive of remote writable memblocks'
adds an extra parameter to pa_memimport_get()

change test program accordingly

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:16:33 +02:00
Peter Meerwald
9362bdc8a1 remap: Make resampler's remap structure more self-contained
Initialization of the remap structure now happens in one place

Rename calc_map_table() to setup_remap(), copy sample format and
channel specs; the remap structure is initialized when we know the
work sample format of the resampler

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-04-29 00:00:06 +02:00
Koop Mast
b115e9c592 Make tests compile on FreeBSD
cpu_set_t is named cpuset_t on FreeBSD.
Add headers to allow for warning free compilation.
2014-02-25 14:28:36 +02:00
Tanu Kaskinen
27e47c72a2 volume-test: Increase the allowed number of rouding errors
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=72374
2014-01-03 14:15:31 +02:00
Peter Meerwald
4515f5d2ff tests: Fix resource leak in sigbus-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:55:17 +01:00
Peter Meerwald
e8a84270c3 tests: Extract PA_CPU_TEST* macros to separate header
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-11-01 15:02:24 +01:00
Peter Meerwald
81f0eb626e tests: Resampler output memchunk may be reset (zero)
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-10-29 18:31:32 +02:00
Tanu Kaskinen
ee5e245afa Use pa_(c)volume_snprint_verbose() everywhere
All pa_cvolume_snprint(), pa_volume_snprint(),
pa_sw_cvolume_snprint_dB() and pa_sw_volume_snprint_dB() calls have
been replaced with pa_cvolume_snprint_verbose() and
pa_volume_snprint_verbose() calls, making the log output more
informative and the code sometimes simpler.
2013-07-09 17:37:04 +03:00
Tanu Kaskinen
efcc3ba576 mainloop-test: Use FALSE instead of false for gboolean 2013-07-04 12:33:47 +03:00