All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Giuliano Pochini <pochini@shiny.it>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Interrupt handler
Date: Mon, 17 Mar 2003 13:49:57 +0100	[thread overview]
Message-ID: <s5h1y16uphm.wl@alsa2.suse.de> (raw)
In-Reply-To: <XFMail.20030317101704.pochini@shiny.it>

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

  reply	other threads:[~2003-03-17 12:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-17  4:47 Sound-card question: HELP William W. Austin
2003-03-17  9:17 ` Interrupt handler Giuliano Pochini
2003-03-17 12:49   ` Takashi Iwai [this message]
2003-03-17 14:22     ` Giuliano Pochini
2003-03-18 13:32       ` Takashi Iwai
2003-03-19  1:15         ` Giuliano Pochini
2003-03-19  9:38           ` Giuliano Pochini
2003-03-17 16:28 ` Sound-card question: HELP Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2004-04-15 10:02 Interrupt handler MNH
2004-04-17 18:57 ` Karim Yaghmour
2003-03-15 21:38 Giuliano Pochini
2002-08-23 11:58 interrupt handler sanket rathi
2002-08-23 12:17 ` Richard B. Johnson
2002-08-23 16:17   ` Robert Love
2002-08-23 16:45     ` Richard B. Johnson
2002-08-23 16:52       ` Robert Love
2002-08-23 20:45         ` george anzinger
2002-08-23  6:22 Kerenyi Gabor
2002-08-23  5:45 Kerenyi Gabor
2002-08-23 13:07 ` Richard B. Johnson
2002-08-23  4:58 Kerenyi Gabor
2002-08-21 14:25 Interrupt Handler sanket rathi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5h1y16uphm.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=pochini@shiny.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.