On 03/12/2014 04:21 AM, Gianfranco Ceccolini wrote: > > Em 11/03/2014, à(s) 23:50, Paul Davis <[email protected]> escreveu: > >> >> >> >> On Tue, Mar 11, 2014 at 10:26 PM, Gianfranco Ceccolini >> <[email protected]> wrote: >>> >>> On Mon, Mar 10, 2014 at 9:51 AM, Gianfranco Ceccolini >>> <[email protected]> wrote: >>> >>> 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? >>> >>> they are identical. >> How can that be? JACK says -p 128 samples and ALSA says 2 on the PC and 16 >> on the BBB >> >> How does ALSA "say" anything? > > Sorry. I mean, JACK says ALSA uses that period size (ALSA: use 16 periods for > capture)
Hi Gianfranco,
Seems like you're mixing up number of frames (JACK -p option) and number
of periods (JACK -n option). -p128 means 128 frames per period while the
ALSA message normally refers to the -n setting (so 16 equals to -n16 in
your case).
>>
>>
>>>
>>> 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".
>>>
>>> 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.
>> So if I use -p128 and -n2 it means the kernel will buffer 256 samples per
>> interrupt, is it?
>>
>> 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.
>>
>> 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".
>>
>> The -n 2 parameter only affects the total amount of hardware buffering, not
>> the interval ("period") between when the application is woken.
>>
> And where does the 16 (from ALSA: use 16 periods for capture) affects?
>
> if I call jack using -p128 / -n2 and the opening message states that ALSA
> uses 16 periods for capture the sound card will buffer a total of 256 samples
> and ALSA will wake the client each 16 frames?
Not sure but I think 128*16=2048 frames are buffered in your case.
>
> If I used -p256 / -n2 instead ALSA would wake the client each 32 frames?
>
Probably not because the BBB audio cape driver apparently doesn't do -n2
but switches to -n16.
But I could be wrong and I'll risk some spanking ;)
Bye,
Jeremy
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Linux-audio-dev mailing list [email protected] http://lists.linuxaudio.org/listinfo/linux-audio-dev
