On Mon, 9 Sep 2002, Paul Davis wrote: > >On Fri, 6 Sep 2002, Guilhem Tardy wrote: > > > >> Hi all, > >> > >> While trying to understand snd_pcm_lib_write1(), I found that > >> runtime->xfer_align is set to period_size in pcm_native.c, but wonder if it > >is > >> just a default? > >> > >> Paul Davis' example (at http://www.op.net/~pbd/alsa-audio.html#playex) doesn > >'t > >> check for a particular transfer size, and my card supports playout of less t > >han > >> 160 samples (i.e. the period size). Thus, I set to try playing out 512 bytes > > at > >> a time (i.e. 2048 samples of 2-bit ADPCM), which does NOT come to a multiple > > of > >> period size. The result is that only 1920 samples are played, and my app thi > >nks > >> an error has occured. > >> > >> Is it a general requirement for apps to send only audio in multiple of the > >> period size? > > > >Nope, applications might modify xfer_align to satisfy their requirements. > > jaroslav, since even i don't understand what xfer_align is for, or > even have an answer to the actual question, it might be good for you > to expand on this a little.
It's software only limit for read/write transfers. The direct transfers (mmap) don't take care about this limit. The idea is to avoid using very small transfer chunks which are inefficient. Application might change this value from 1 (no control) to buffer_size (in samples), but values bigger than period_size hasn't any sense anyway. The default value for xfer_align is period_size. Jaroslav ----- Jaroslav Kysela <[EMAIL PROTECTED]> SuSE Linux http://www.suse.com ALSA project http://www.alsa-project.org ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel