>all the commit does it to move forward the driver's notion of the "s/w
>pointer", used for tracking xruns etc. its fine to move it less than
>it could possibly be moved, but not OK to move it more.

i have attached a patch to pcm.c that tries to express this in the
documentation to snd_pcm_mmap_commit.

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 01:52:59
@@ -4341,8 +4341,10 @@
  * \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 into the audio buffer memory, and should never exceed the number
+ * of frames that snd_pcm_mmap_begin returned.
  */
 int snd_pcm_mmap_commit(snd_pcm_t *pcm, snd_pcm_uframes_t offset,
                        snd_pcm_uframes_t frames)

Reply via email to