<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 10:26 PM, Gianfranco Ceccolini <span dir="ltr"><<a href="mailto:gianfranco@portalmod.com.br" target="_blank">gianfranco@portalmod.com.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class=""><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Mar 10, 2014 at 9:51 AM, Gianfranco Ceccolini <span dir="ltr"><<a href="mailto:gianfranco@portalmod.com.br" target="_blank">gianfranco@portalmod.com.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Paul. I’m really sorry for my lack of comprehension, but I still don’t get it.  Is there a relation between the ALSA period with JACK’s period?<br></blockquote><div><br></div><div>they are identical.<br></div></div></div>
</div></blockquote></div>How can that be? JACK says -p 128 samples and ALSA says 2 on the PC and 16 on the BBB</div></div></blockquote><div><br></div><div>How does ALSA "say" anything?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class=""><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> <br></div>
<div>note: other audio APIs call this a "buffer". some, like ASIO, force a double "buffered" model where the total size of the hardware memory area used for transfers (what ALSA calls the "hardware buffer") is always twice the "buffer size".<br>

<br>ALSA offers control over *both* the "period" (between interrupts) and the total hardware buffer size. This is unusual among audio APIs, except that JACK follows the same convention in its ALSA backend. You can specify the period size (-p) and the number of "periods" that make up the hardware buffer.<br>
</div></div></div></div></blockquote></div>So if I use -p128 and -n2 it means the kernel will buffer 256 samples per interrupt, is it?<br></div></div></blockquote><div><br></div><div>No. What it means depends on the precise details of the device. In an ideal world, those settings mean that the DEVICE will buffer 128 samples before issuing an interrupt, and that its total buffer size is 256.<br>
<br></div><div>However, USB devices etc. do not work this way, so it translates more generically to "ALSA will wake the client up whenever at least 128 samples of data (and/or space) are available".<br><br></div>
<div>The -n 2 parameter only affects the total amount of hardware buffering, not the interval ("period") between when the application is woken.<br><br><br></div></div></div></div>