Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Remarks about  alsa-lib-1.0.29/test/pcm*.c
@ 2015-05-31 11:51 Christophe Lohr
  2015-06-01 11:47 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe Lohr @ 2015-05-31 11:51 UTC (permalink / raw)
  To: alsa-devel

[-- 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 --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Remarks about  alsa-lib-1.0.29/test/pcm*.c
  2015-05-31 11:51 Remarks about alsa-lib-1.0.29/test/pcm*.c Christophe Lohr
@ 2015-06-01 11:47 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2015-06-01 11:47 UTC (permalink / raw)
  To: Christophe Lohr; +Cc: alsa-devel

At Sun, 31 May 2015 13:51:26 +0200,
Christophe Lohr wrote:
> 
> 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?

Yes, both are correct fixes.  Now I merged to git tree.
Thanks!


Takashi

> 
> Best regards
> Christophe
> 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))
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-01 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-31 11:51 Remarks about alsa-lib-1.0.29/test/pcm*.c Christophe Lohr
2015-06-01 11:47 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox