At Mon, 17 Mar 2003 10:17:04 +0100 (CET),
Giuliano Pochini wrote:
> 
> 
> > When an interrupt arrives and I call snd_pcm_period_elapsed(), what
> > function gets from alsa middle layer the new block to play and sets up
> > the hardware ?
> 
> Ok, nobody answered, perhaps my question was too stupid :))

both of Jaroslav and I were absent since the last friday to attend at
the LAD meeting...

> I still haven't found in the docs how can I get from ALSA the
> address of the blocks to play/record, or how to tell ALSA where
> it the space I allocated so it knows where it has to write the
> audio data to be played.

first, the data is not necessarily as a block on ALSA.
and second, you don't have to copy the data as long as the hardware
supports DMA on the host memory.  the alsa middle layer does this
job.

usually in the interrupt handler, you need to just send "ack" to the
middle layer by calling snd_pcm_period_elapsed().  then, the
middle-layer checks the current position by calling pointer callback,
and copy/send/set-silence in the necessary area.

the pointer callback, thus, must return the current position of the
hardware pointer, i.e. the position offset (in frames) in the DMA
buffer, where the DMA is working right now (or the last finished
positoin, if you cannot get the current DMA pointer due to the
hardware limitation).


Takashi


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to