Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: John Shepherd <g99s2711@campus.ru.ac.za>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: accessing sw data buffers in card driver?
Date: Tue, 05 Nov 2002 18:21:11 +0100	[thread overview]
Message-ID: <s5hpttk7x14.wl@alsa2.suse.de> (raw)
In-Reply-To: <007301c284e4$c833c0c0$2b7be792@ict.ru.ac.za>

Hi,

At Tue, 5 Nov 2002 18:02:46 +0200,
John Shepherd wrote:
> 
> hi,
>  
> um ....how do i extract the audio buffers from memory inside say a card driver, like
> the snd-dummy.  i am just experimenting with ALSA to see if it is possible to stream
> the audio data to the 1394 bus...

for accessing from the user space, usually you need to call mmap from
the application.
and, perhaps you misunderstand about snd-dummy.  snd-dummy does
nothing.  it works just like /dev/null, simply ignores the data.


> so i just need to know how to get the data out of the buffer...
>  
> i assume a call to this gets the size out:
>  
> snd_pcm_lib_buffer_bytes(substream);
> 
> what pcm_function will return the *buffer?  do i access it through runtime->dma_area?

snd_pcm_lib_buffer_bytes() returns the size of the buffer in bytes.
in general, the sizes are handled in frames on ALSA.  note that
	bytes per frame = # channels * sample-width-in-bytes

unfortuantely, there are really no documents about the ALSA kernel
API, although the API is fairly easy to understand...

you can find my post with a very brief explanation of pcm API in past
on this ML from the archive.  it would help a bit for understanding.


Takashi


-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en

      reply	other threads:[~2002-11-05 17:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-05 16:02 accessing sw data buffers in card driver? John Shepherd
2002-11-05 17:21 ` Takashi Iwai [this message]

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=s5hpttk7x14.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=g99s2711@campus.ru.ac.za \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox