All of lore.kernel.org
 help / color / mirror / Atom feed
* ioplug plugin programming: HW_PERIOD_BYTES and HW_PERIODS constraints ?
@ 2009-10-01 12:17 Stefan Schoenleitner
  0 siblings, 0 replies; only message in thread
From: Stefan Schoenleitner @ 2009-10-01 12:17 UTC (permalink / raw)
  To: alsa-devel

Hi,

I'm currently developing an ALSA ioplug plugin that should transfer
audio samples to a DSP over UART.

In my plugin code I set up the hardware constrains (HW_PERIOD_BYTES and
HW_PERIODS being among them) and then I utilize the transfer callback to
send the audio chunk over UART.

The DSP application would like to have exactly 156 - 164 audio samples
at a time, where the sampling rate has to be 8 kHz and the format is S16_LE.
In between there has to be a delay of 20ms (which is equal to 164 audio
frames at a sampling rate of 8 kHz (i.e. 164 * 125us = 20,5 ms).

For this reason I configured HW_PERIOD_BYTES with these values.
The result is that each time the transfer callback gets called, exactly
312 bytes (thus 164 frames with each one having 2 bytes) are transfered.


However, what I do not understand is the setup of HW_PERIODS which is
AFAIK the number of periods being transfered at a time ?


* What is the influence of this constraint on my ioplug plugin ?

* How does it change the way data is being transfered with the transfer
callback ?

* What would be the correct setup for the mentioned application ?


cheers,
stefan

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-01 12:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-01 12:17 ioplug plugin programming: HW_PERIOD_BYTES and HW_PERIODS constraints ? Stefan Schoenleitner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.