Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Lohr <christophe.lohr@cegetel.net>
To: alsa-devel@alsa-project.org
Subject: Remarks about  alsa-lib-1.0.29/test/pcm*.c
Date: Sun, 31 May 2015 13:51:26 +0200	[thread overview]
Message-ID: <556AF5BE.1070409@cegetel.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

Hello,
   I'm looking about examples in alsa-lib-1.0.29/test/

I have two questions about:

pcm.c line 71: In case of a FLOAT format, maxval is 1.0, isn't it?

pcm_min.c lin 79: Variable err does not refers to the previous call?

Did I understood well?

Best regards
Christophe

[-- Attachment #2: misc.patch --]
[-- Type: text/x-patch, Size: 1121 bytes --]

diff -uprN alsa-lib-1.0.29.origin/test/pcm.c alsa-lib-1.0.29/test/pcm.c
--- alsa-lib-1.0.29.origin/test/pcm.c	2015-02-26 13:34:52.000000000 +0100
+++ alsa-lib-1.0.29/test/pcm.c	2015-05-31 13:36:42.806463600 +0200
@@ -68,7 +68,7 @@ static void generate_sine(const snd_pcm_
 		} fval;
 		int res, i;
 		if (is_float) {
-			fval.f = sin(phase) * maxval;
+			fval.f = sin(phase);
 			res = fval.i;
 		} else
 			res = sin(phase) * maxval;
diff -uprN alsa-lib-1.0.29.origin/test/pcm_min.c alsa-lib-1.0.29/test/pcm_min.c
--- alsa-lib-1.0.29.origin/test/pcm_min.c	2015-02-26 13:34:52.000000000 +0100
+++ alsa-lib-1.0.29/test/pcm_min.c	2015-05-31 13:38:58.166156767 +0200
@@ -39,7 +39,7 @@ int main(void)
                 if (frames < 0)
                         frames = snd_pcm_recover(handle, frames, 0);
                 if (frames < 0) {
-                        printf("snd_pcm_writei failed: %s\n", snd_strerror(err));
+                        printf("snd_pcm_writei failed: %s\n", snd_strerror(frames));
                         break;
                 }
                 if (frames > 0 && frames < (long)sizeof(buffer))

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2015-05-31 11:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-31 11:51 Christophe Lohr [this message]
2015-06-01 11:47 ` Remarks about alsa-lib-1.0.29/test/pcm*.c Takashi Iwai

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=556AF5BE.1070409@cegetel.net \
    --to=christophe.lohr@cegetel.net \
    --cc=alsa-devel@alsa-project.org \
    /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