On Wed, 31 Oct 2001, Paul Davis wrote:

> >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.'
>
> IMHO. the documentation is wrong. it should say that you cannot call
> it with a value greater than the one returned by snd_pcm_mmap_begin().
>
> 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.

The documentation is correct, but the check in the pcm.c example is really
not necessary, because mmap_begin guarantees that the returned count of
frames is less or equal to the requested count. I corrected the
documentation. Using the same value as for mmap_begin is not necessary in
the current implementation, but we can rely on the same value in the
future, so please, follow the documentation to create "bug-free"
and clean applications.

                                                Jaroslav

-----
Jaroslav Kysela <[EMAIL PROTECTED]>
SuSE Linux    http://www.suse.com
ALSA project  http://www.alsa-project.org


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

Reply via email to