From patchwork Mon Feb 24 15:04:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will R X-Patchwork-Id: 3721411 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D31A99F2ED for ; Wed, 26 Feb 2014 07:10:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC10C201DD for ; Wed, 26 Feb 2014 07:10:53 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5030420170 for ; Wed, 26 Feb 2014 07:10:52 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D726C26569B; Wed, 26 Feb 2014 08:10:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 08335261A29; Wed, 26 Feb 2014 08:10:37 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 25D2E2654E5; Mon, 24 Feb 2014 16:17:23 +0100 (CET) Received: from mail-yk0-f176.google.com (mail-yk0-f176.google.com [209.85.160.176]) by alsa0.perex.cz (Postfix) with ESMTP id 00FC6265568 for ; Mon, 24 Feb 2014 16:05:08 +0100 (CET) Received: by mail-yk0-f176.google.com with SMTP id 19so14801075ykq.7 for ; Mon, 24 Feb 2014 07:05:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=nT0LqNhh6GdnzBgFBrCaKBRBGZUYquvPQhmABFQJnMg=; b=RXpUnoTf2oVxz8KDWP2Yw+JPmzCparIi0d93fXKMhoN8fxngyeKhjhjUWMBZ0WoIsJ VTEIkfeFnM1+oECM3XBDTIl4HuKztkeVSUTpYSW2XMMxI+KLnqvhOlabZZpH9uLeeAbh R/h004x4Mlau3VjxI7NMi1okm97RgYYgGBHeaInyF9F8OzuduI6WIcP85GFch9oFbNt1 Kt7iwiNXGev+xdYFBNIcY0ncLTIQQh3BBS6idrKORw1xa0d/7sx2J1tjYw1jbxXFgcOm 5dp4hO6U45BIGX6tkjarbipFcsyQov0CeSm95jvlW2Vks6OPmlkzL5JB/MHBoRrgQYk4 2o+g== X-Received: by 10.236.101.227 with SMTP id b63mr31156572yhg.37.1393254307932; Mon, 24 Feb 2014 07:05:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.170.205.11 with HTTP; Mon, 24 Feb 2014 07:04:27 -0800 (PST) In-Reply-To: References: From: Will R Date: Mon, 24 Feb 2014 07:04:27 -0800 Message-ID: To: Takashi Iwai X-Mailman-Approved-At: Wed, 26 Feb 2014 08:10:35 +0100 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] [PATCH - speaker-test 1/1] speaker-test: add --force-frequency option to allow hz outside range X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP What is the reasoning behind the limit, protecting speaker hardware, hearing? I think common speakers have frequency response up to 15 or 16kHz or so, so maybe a bit higher default limit of 8kHz would be okay. I was doing some tests around 20kHz - 22kHz (to test my hearing and freq response of my 25kHz rated headphones), so still see the merit in a force option for people who are certain they want to test that high. New patch: Added min of 1.0Hz for force option, changed default max to 8kHz, fixed typo in flag name: From 3d9ceb42e1205618b29479077b0bd3f2d71c64db Mon Sep 17 00:00:00 2001 From: Erik Ackermann Date: Mon, 24 Feb 2014 06:53:08 -0800 Subject: [PATCH - speaker-test 1/1] speaker-test: add --force-frequency option to allow hz outside range Signed-off-by: Erik Ackermann diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c index 261f399..61396f2 100644 --- a/speaker-test/speaker-test.c +++ b/speaker-test/speaker-test.c @@ -106,6 +106,7 @@ static snd_pcm_uframes_t period_size; static const char *given_test_wav_file = NULL; static char *wav_file_dir = SOUNDSDIR; static int debug = 0; +static int force_frequency = 0; static int in_aborting = 0; static snd_pcm_t *pcm_handle = NULL; @@ -1015,6 +1016,7 @@ static void help(void) "-w,--wavfile Use the given WAV file as a test sound\n" "-W,--wavdir Specify the directory containing WAV files\n" "-m,--chmap Specify the channel map to override\n" + "-X,--force-frequency force frequencies outside the 30-8000hz range\n" "\n")); printf(_("Recognized sample formats are:")); for (fmt = supported_formats; *fmt >= 0; fmt++) { @@ -1057,6 +1059,7 @@ int main(int argc, char *argv[]) { {"wavfile", 1, NULL, 'w'}, {"wavdir", 1, NULL, 'W'}, {"debug", 0, NULL, 'd'}, + {"force-frequency", 0, NULL, 'X'}, #ifdef CONFIG_SUPPORT_CHMAP {"chmap", 1, NULL, 'm'}, #endif @@ -1078,7 +1081,7 @@ int main(int argc, char *argv[]) { while (1) { int c; - if ((c = getopt_long(argc, argv, "hD:r:c:f:F:b:p:P:t:l:s:w:W:d" + if ((c = getopt_long(argc, argv, "hD:r:c:f:F:b:p:P:t:l:s:w:W:d:X" #ifdef CONFIG_SUPPORT_CHMAP "m:" #endif @@ -1114,8 +1117,6 @@ int main(int argc, char *argv[]) { break; case 'f': freq = atof(optarg); - freq = freq < 30.0 ? 30.0 : freq; - freq = freq > 5000.0 ? 5000.0 : freq; break; case 'b': buffer_time = atoi(optarg); @@ -1173,6 +1174,9 @@ int main(int argc, char *argv[]) { case 'd': debug = 1; break; + case 'X': + force_frequency = 1; + break; #ifdef CONFIG_SUPPORT_CHMAP case 'm': chmap = optarg; @@ -1190,6 +1194,13 @@ int main(int argc, char *argv[]) { exit(EXIT_SUCCESS); } + if (!force_frequency) { + freq = freq < 30.0 ? 30.0 : freq; + freq = freq > 8000.0 ? 8000.0 : freq; + } else { + freq = freq < 1.0 ? 1.0 : freq; + } + if (test_type == TEST_WAV) format = SND_PCM_FORMAT_S16_LE; /* fixed format */ -- 1.8.3.2