accessing sw data buffers in card driver?
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... 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?
thanx,
john.
================================
John Shepherd
Dept. of Computer Science
Rhodes University
Grahamstown
South Africa
6140.
================================
Hi,
At Tue, 5 Nov 2002 18:02:46 +0200,
Quoted 6 lines · John Shepherd
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.
Quoted 7 lines
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_functionwill return the *buffer? do i access it throughruntime->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