Jaroslav Kysela wrote: > > > > Hmm, the mmap semantics of stop_threshold should be similar to the > > > read()/write() API. > > > > And this was already true. If you use mmap or read/write is irrelevant > > wrt stream stop in XRUN state. > > Right, but the stream is RUNNING. My change does nothing else than > checking if an xrun state occured in the user space and synchronizes > the kernel code with this situation. Definitely the PCM state should be > XRUN not RUNNING when snd_pcm_avail_update() returns -EPIPE. It was very > misleading for application to receive these broken results.
I've thought more about this and I'm happy to say that I think you're right about your patch. This change a bit the "when" part of xrun detection (previously was doable only by kernel space), but once documentented I think it's correct. I still have doubts about snd_pcm_avail_update return value. Should it return a value > buffer_size when stop_threshold is high? Actually snd_pcm_mmap_begin automatically will reduce this amount to contiguous size... So yes, I think it's a good work. At the time of the first reading it looked awful at my eyes, but now I've seen the light. Sorry for the noise. -- Abramo Bagnara mailto:[EMAIL PROTECTED] Opera Unica Phone: +39.546.656023 Via Emilia Interna, 140 48014 Castel Bolognese (RA) - Italy ALSA project http://www.alsa-project.org It sounds good! _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel