>here's a better version (i think): > >* You should pass this function the offset value that >* snd_pcm_mmap_begin returned. The frames parameter should hold the >* number of frames you have written or read to/from the audio >* buffer. Each call to snd_pcm_mmap_begin() may be followed by a >* series of zero or more calls to snd_pcm_mmap_commit(). If >* snd_pcm_mmap_begin() returned N frames, the sum of all frames >* recorded as written or read by that corresponding series of calls to >* snd_pcm_mmap_commit() may not exceed N.
much better. very dense, and very enlightening. i have turned this into a patch, too. tim
Index: alsa-lib/src/pcm/pcm.c =================================================================== RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm.c,v retrieving revision 1.182 diff -u -r1.182 pcm.c --- alsa-lib/src/pcm/pcm.c 2001/10/25 13:51:26 1.182 +++ alsa-lib/src/pcm/pcm.c 2001/11/01 02:49:42 @@ -4341,8 +4341,14 @@ * \param pcm PCM handle * \return 0 on success otherwise a negative error code * - * 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. + * You should pass this function the offset value that + * #snd_pcm_mmap_begin returned. The frames parameter should hold the + * number of frames you have written or read to/from the audio + * buffer. Each call to #snd_pcm_mmap_begin may be followed by a + * series of zero or more calls to #snd_pcm_mmap_commit. If + * #snd_pcm_mmap_begin returned N frames, the sum of all frames + * recorded as written or read by that corresponding series of calls to + * #snd_pcm_mmap_commit may not exceed N. */ int snd_pcm_mmap_commit(snd_pcm_t *pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t frames)