[alsa-devel] Remarks about alsa-lib-1.0.29/test/pcm*.c
Takashi Iwai
tiwai at suse.de
Mon Jun 1 13:47:31 CEST 2015
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 at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
More information about the Alsa-devel
mailing list