public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Martin Peres <martin.peres@linux.intel.com>
To: Simon Ser <simon.ser@intel.com>, igt-dev@lists.freedesktop.org
Cc: martin.peres@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t 5/5] lib/tests/igt_audio: add a pop test
Date: Mon, 3 Jun 2019 17:14:31 +0300	[thread overview]
Message-ID: <8a8ea0c5-40fa-69b1-d079-43f68d1aef38@linux.intel.com> (raw)
In-Reply-To: <20190529133250.27817-6-simon.ser@intel.com>

On 29/05/2019 16:32, Simon Ser wrote:
> Make sure adding a pop in the input signal makes audio_signal_detect fail.
> 
> Signed-off-by: Simon Ser <simon.ser@intel.com>
> ---
>  lib/tests/igt_audio.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/lib/tests/igt_audio.c b/lib/tests/igt_audio.c
> index 0f1c39d93728..214dcea73efc 100644
> --- a/lib/tests/igt_audio.c
> +++ b/lib/tests/igt_audio.c
> @@ -111,6 +111,26 @@ static void test_signal_detect_extra(struct audio_signal *signal)
>  	igt_assert(!ok);
>  }
>  
> +static void test_signal_detect_pop(struct audio_signal *signal)
> +{
> +	double *buf;
> +	bool ok;
> +	size_t i;
> +
> +	buf = malloc(BUFFER_LEN * sizeof(double));
> +	audio_signal_fill(signal, buf, BUFFER_LEN / CHANNELS);
> +
> +	/* Add a discontinuity in the signal */
> +	for (i = 0; i < 5; i++)
> +		buf[BUFFER_LEN / 3 + i] = 0.9;

Would be nice to check both for a held value (no updates for some
samples then continuing the signal as expected) and a phase shift.

Could you check both in two different tests? That would increase our
confidence in our methodology!

I'll review 4 and 5 again when this is done :)

> +
> +	ok = audio_signal_detect(signal, SAMPLING_RATE, 0, buf, BUFFER_LEN);
> +
> +	free(buf);
> +
> +	igt_assert(!ok);
> +}
> +
>  igt_main
>  {
>  	struct audio_signal *signal;
> @@ -146,6 +166,9 @@ igt_main
>  		igt_subtest("signal-detect-extra")
>  			test_signal_detect_extra(signal);
>  
> +		igt_subtest("signal-detect-pop")
> +			test_signal_detect_pop(signal);
> +
>  		igt_fixture {
>  			audio_signal_fini(signal);
>  		}
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-06-03 14:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 13:32 [igt-dev] [PATCH i-g-t 0/5] Add igt_audio self-tests and check for noise/pops Simon Ser
2019-05-29 13:32 ` [igt-dev] [PATCH i-g-t 1/5] lib/igt_audio: add basic audio_signal_detect tests Simon Ser
2019-06-03 13:43   ` Martin Peres
2019-06-04  8:00     ` Ser, Simon
2019-05-29 13:32 ` [igt-dev] [PATCH i-g-t 2/5] lib/tests/igt_audio: add test with missing frequency Simon Ser
2019-06-03 13:46   ` Martin Peres
2019-05-29 13:32 ` [igt-dev] [PATCH i-g-t 3/5] lib/tests/igt_audio: add test with an extra frequency Simon Ser
2019-06-03 13:49   ` Martin Peres
2019-05-29 13:32 ` [igt-dev] [PATCH i-g-t 4/5] lib/igt_audio: detect noise and pops Simon Ser
2019-06-03 14:11   ` Martin Peres
2019-05-29 13:32 ` [igt-dev] [PATCH i-g-t 5/5] lib/tests/igt_audio: add a pop test Simon Ser
2019-06-03 14:14   ` Martin Peres [this message]
2019-05-29 14:44 ` [igt-dev] ✓ Fi.CI.BAT: success for Add igt_audio self-tests and check for noise/pops Patchwork
2019-05-29 22:22 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a8ea0c5-40fa-69b1-d079-43f68d1aef38@linux.intel.com \
    --to=martin.peres@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=martin.peres@intel.com \
    --cc=simon.ser@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox