* [PATCH i-g-t v2] lib/tests: Add audio selftest
@ 2017-08-31 8:02 Paul Kocialkowski
2017-08-31 13:01 ` Paul Kocialkowski
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Paul Kocialkowski @ 2017-08-31 8:02 UTC (permalink / raw)
To: intel-gfx; +Cc: Paul Kocialkowski
This introduces a selftest for the audio library.
It consists of generating a signal from a list of frequencies and
ensuring that the integrity checking function does detect these
frequencies (and only these frequencies).
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
---
lib/tests/.gitignore | 1 +
lib/tests/Makefile.am | 4 ++--
lib/tests/Makefile.sources | 5 +++++
lib/tests/igt_audio.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 63 insertions(+), 2 deletions(-)
create mode 100644 lib/tests/igt_audio.c
diff --git a/lib/tests/.gitignore b/lib/tests/.gitignore
index ae11dd47..49bd5b01 100644
--- a/lib/tests/.gitignore
+++ b/lib/tests/.gitignore
@@ -1,5 +1,6 @@
# Please keep sorted alphabetically
igt_assert
+igt_audio
igt_fork_helper
igt_exit_handler
igt_invalid_subtest_name
diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am
index 5d14194a..36c16124 100644
--- a/lib/tests/Makefile.am
+++ b/lib/tests/Makefile.am
@@ -16,5 +16,5 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS) \
LDADD = ../libintel_tools.la $(PCIACCESS_LIBS) $(DRM_LIBS) $(LIBUNWIND_LIBS) $(TIMER_LIBS)
-LDADD += $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(GLIB_LIBS) -lm
-AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS)
+LDADD += $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(GLIB_LIBS) $(GSL_LIBS) -lm
+AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS) $(GSL_CFLAGS)
diff --git a/lib/tests/Makefile.sources b/lib/tests/Makefile.sources
index 8d1a8dea..eb702844 100644
--- a/lib/tests/Makefile.sources
+++ b/lib/tests/Makefile.sources
@@ -18,6 +18,11 @@ check_prog_list = \
igt_can_fail_simple \
$(NULL)
+#if HAVE_GSL
+check_prog_list += \
+ igt_audio
+#endif
+
TESTS = \
$(check_prog_list) \
$(check_script_list) \
diff --git a/lib/tests/igt_audio.c b/lib/tests/igt_audio.c
new file mode 100644
index 00000000..2f9d0492
--- /dev/null
+++ b/lib/tests/igt_audio.c
@@ -0,0 +1,55 @@
+/*
+ * Copyright © 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include "igt_core.h"
+#include "igt_audio.h"
+
+static int test_frequencies[] = {
+ 300,
+ 600,
+ 1200,
+ 80000,
+ 10000,
+};
+
+igt_simple_main
+{
+ short buffer[2048];
+ struct audio_signal *signal;
+ int i;
+
+ signal = audio_signal_init(2, 44800);
+ igt_assert(signal);
+
+ for (i = 0; i < ARRAY_SIZE(test_frequencies); i++)
+ audio_signal_add_frequency(signal, test_frequencies[i]);
+
+ audio_signal_synthesize(signal);
+ audio_signal_fill(signal, buffer, 1024);
+
+ igt_assert(audio_signal_detect(signal, 2, 44800, buffer, 1024));
+
+ audio_signal_clean(signal);
+ free(signal);
+}
--
2.14.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH i-g-t v2] lib/tests: Add audio selftest
2017-08-31 8:02 [PATCH i-g-t v2] lib/tests: Add audio selftest Paul Kocialkowski
@ 2017-08-31 13:01 ` Paul Kocialkowski
2017-08-31 13:20 ` ✓ Fi.CI.BAT: success for lib/tests: Add audio selftest (rev2) Patchwork
2017-08-31 19:22 ` ✗ Fi.CI.IGT: failure " Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Paul Kocialkowski @ 2017-08-31 13:01 UTC (permalink / raw)
To: intel-gfx; +Cc: Paul Kocialkowski
On Thu, 2017-08-31 at 11:02 +0300, Paul Kocialkowski wrote:
> This introduces a selftest for the audio library.
>
> It consists of generating a signal from a list of frequencies and
> ensuring that the integrity checking function does detect these
> frequencies (and only these frequencies).
Looks like I forgot to CC Lyude on v2, sorry.
For reference, the patch is up at:
https://patchwork.freedesktop.org/series/29550/
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
> ---
> lib/tests/.gitignore | 1 +
> lib/tests/Makefile.am | 4 ++--
> lib/tests/Makefile.sources | 5 +++++
> lib/tests/igt_audio.c | 55
> ++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 63 insertions(+), 2 deletions(-)
> create mode 100644 lib/tests/igt_audio.c
>
> diff --git a/lib/tests/.gitignore b/lib/tests/.gitignore
> index ae11dd47..49bd5b01 100644
> --- a/lib/tests/.gitignore
> +++ b/lib/tests/.gitignore
> @@ -1,5 +1,6 @@
> # Please keep sorted alphabetically
> igt_assert
> +igt_audio
> igt_fork_helper
> igt_exit_handler
> igt_invalid_subtest_name
> diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am
> index 5d14194a..36c16124 100644
> --- a/lib/tests/Makefile.am
> +++ b/lib/tests/Makefile.am
> @@ -16,5 +16,5 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS)
> $(DEBUG_CFLAGS) \
>
> LDADD = ../libintel_tools.la $(PCIACCESS_LIBS) $(DRM_LIBS)
> $(LIBUNWIND_LIBS) $(TIMER_LIBS)
>
> -LDADD += $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(GLIB_LIBS) -lm
> -AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS)
> +LDADD += $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(GLIB_LIBS) $(GSL_LIBS) -lm
> +AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS)
> $(GSL_CFLAGS)
> diff --git a/lib/tests/Makefile.sources b/lib/tests/Makefile.sources
> index 8d1a8dea..eb702844 100644
> --- a/lib/tests/Makefile.sources
> +++ b/lib/tests/Makefile.sources
> @@ -18,6 +18,11 @@ check_prog_list = \
> igt_can_fail_simple \
> $(NULL)
>
> +#if HAVE_GSL
> +check_prog_list += \
> + igt_audio
> +#endif
> +
> TESTS = \
> $(check_prog_list) \
> $(check_script_list) \
> diff --git a/lib/tests/igt_audio.c b/lib/tests/igt_audio.c
> new file mode 100644
> index 00000000..2f9d0492
> --- /dev/null
> +++ b/lib/tests/igt_audio.c
> @@ -0,0 +1,55 @@
> +/*
> + * Copyright © 2017 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person
> obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom
> the
> + * Software is furnished to do so, subject to the following
> conditions:
> + *
> + * The above copyright notice and this permission notice (including
> the next
> + * paragraph) shall be included in all copies or substantial portions
> of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
> SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
> OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include "igt_core.h"
> +#include "igt_audio.h"
> +
> +static int test_frequencies[] = {
> + 300,
> + 600,
> + 1200,
> + 80000,
> + 10000,
> +};
> +
> +igt_simple_main
> +{
> + short buffer[2048];
> + struct audio_signal *signal;
> + int i;
> +
> + signal = audio_signal_init(2, 44800);
> + igt_assert(signal);
> +
> + for (i = 0; i < ARRAY_SIZE(test_frequencies); i++)
> + audio_signal_add_frequency(signal,
> test_frequencies[i]);
> +
> + audio_signal_synthesize(signal);
> + audio_signal_fill(signal, buffer, 1024);
> +
> + igt_assert(audio_signal_detect(signal, 2, 44800, buffer,
> 1024));
> +
> + audio_signal_clean(signal);
> + free(signal);
> +}
--
Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo, Finland
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread* ✓ Fi.CI.BAT: success for lib/tests: Add audio selftest (rev2)
2017-08-31 8:02 [PATCH i-g-t v2] lib/tests: Add audio selftest Paul Kocialkowski
2017-08-31 13:01 ` Paul Kocialkowski
@ 2017-08-31 13:20 ` Patchwork
2017-08-31 19:22 ` ✗ Fi.CI.IGT: failure " Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-08-31 13:20 UTC (permalink / raw)
To: Paul Kocialkowski; +Cc: intel-gfx
== Series Details ==
Series: lib/tests: Add audio selftest (rev2)
URL : https://patchwork.freedesktop.org/series/29550/
State : success
== Summary ==
IGT patchset tested on top of latest successful build
c2159678d283fea5615ec8e846a51cf4954ac82d tests/perf: add Geminilake support
with latest DRM-Tip kernel build CI_DRM_3021
c399d43adc55 drm-tip: 2017y-08m-31d-07h-25m-28s UTC integration manifest
Test kms_cursor_legacy:
Subgroup basic-flip-after-cursor-varying-size:
pass -> FAIL (fi-hsw-4770) fdo#102402 +1
Test kms_force_connector_basic:
Subgroup force-connector-state:
pass -> SKIP (fi-snb-2520m) fdo#101048
fdo#102402 https://bugs.freedesktop.org/show_bug.cgi?id=102402
fdo#101048 https://bugs.freedesktop.org/show_bug.cgi?id=101048
fi-bdw-5557u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:457s
fi-bdw-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:447s
fi-blb-e6850 total:288 pass:224 dwarn:1 dfail:0 fail:0 skip:63 time:364s
fi-bsw-n3050 total:288 pass:243 dwarn:0 dfail:0 fail:0 skip:45 time:554s
fi-bwr-2160 total:288 pass:184 dwarn:0 dfail:0 fail:0 skip:104 time:253s
fi-bxt-j4205 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:523s
fi-byt-j1900 total:288 pass:254 dwarn:1 dfail:0 fail:0 skip:33 time:527s
fi-byt-n2820 total:288 pass:250 dwarn:1 dfail:0 fail:0 skip:37 time:522s
fi-elk-e7500 total:288 pass:230 dwarn:0 dfail:0 fail:0 skip:58 time:439s
fi-glk-2a total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:619s
fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:2 skip:25 time:470s
fi-hsw-4770r total:288 pass:263 dwarn:0 dfail:0 fail:0 skip:25 time:427s
fi-ilk-650 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:421s
fi-ivb-3520m total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:507s
fi-ivb-3770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:491s
fi-kbl-7500u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:483s
fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:595s
fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:607s
fi-pnv-d510 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:536s
fi-skl-6260u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:474s
fi-skl-6700k total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:535s
fi-skl-6770hq total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:491s
fi-skl-gvtdvm total:288 pass:266 dwarn:0 dfail:0 fail:0 skip:22 time:445s
fi-skl-x1585l total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:492s
fi-snb-2520m total:288 pass:250 dwarn:0 dfail:0 fail:0 skip:38 time:551s
fi-snb-2600 total:288 pass:249 dwarn:0 dfail:0 fail:1 skip:38 time:410s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_131/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread* ✗ Fi.CI.IGT: failure for lib/tests: Add audio selftest (rev2)
2017-08-31 8:02 [PATCH i-g-t v2] lib/tests: Add audio selftest Paul Kocialkowski
2017-08-31 13:01 ` Paul Kocialkowski
2017-08-31 13:20 ` ✓ Fi.CI.BAT: success for lib/tests: Add audio selftest (rev2) Patchwork
@ 2017-08-31 19:22 ` Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-08-31 19:22 UTC (permalink / raw)
To: Paul Kocialkowski; +Cc: intel-gfx
== Series Details ==
Series: lib/tests: Add audio selftest (rev2)
URL : https://patchwork.freedesktop.org/series/29550/
State : failure
== Summary ==
Test kms_setmode:
Subgroup basic:
pass -> FAIL (shard-hsw) fdo#99912
Test kms_flip:
Subgroup plain-flip-fb-recreate:
fail -> PASS (shard-hsw)
Subgroup plain-flip-ts-check-interruptible:
pass -> FAIL (shard-hsw)
Test perf:
Subgroup polling:
fail -> PASS (shard-hsw) fdo#102252 +1
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
shard-hsw total:2265 pass:1230 dwarn:0 dfail:0 fail:19 skip:1016 time:9632s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_131/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-31 19:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-31 8:02 [PATCH i-g-t v2] lib/tests: Add audio selftest Paul Kocialkowski
2017-08-31 13:01 ` Paul Kocialkowski
2017-08-31 13:20 ` ✓ Fi.CI.BAT: success for lib/tests: Add audio selftest (rev2) Patchwork
2017-08-31 19:22 ` ✗ Fi.CI.IGT: failure " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox