jaroslav,

there is something wrong with either the pcm.c example or with the
documentation in alsa-lib/src/pcm/pcm.c. 

the documentation says about snd_pcm_mmap_commit:

 'To call this with offset/frames values different from that returned by
  snd_pcm_mmap_begin has undefined effects and it has to be avoided.'

and in pcm.c we find

    ...
    err = snd_pcm_mmap_begin(handle, &my_areas, &offset, &frames);
    if (err < 0) {
      printf("MMAP begin error: %s\n", snd_strerror(err));
      exit(EXIT_FAILURE);
    }
    if (frames > period_size)
      frames = period_size;
    generate_sine(my_areas, offset, frames, &phase);
    err = snd_pcm_mmap_commit(handle, offset, frames);
    ...

where the frames returned from snd_pcm_mmap_begin is changed in the second
if-statement and this value is passed to snd_pcm_mmap_commit.

can you clarify this, please? it would also be helpful to know what
exactly snd_pcm_mmap_commit does with the value of frames. 

tim


_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to