Thanx for the details....let me just figure out the full flow and then come
with some more queries ;)...

-----Original Message-----
From: Giuliano Pochini [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 4:23 PM
To: Gupta, Kshitij
Cc: [EMAIL PROTECTED]
Subject: Re: [Alsa-devel] Dma query




On Wed, 25 Feb 2004, Gupta, Kshitij wrote:

> hi,
>       I have a very trivial question about the dma transfers with respect
> to ALSA framework.
>
> Let me first explain a scenario
> We have a Circularly linked Buffer pool
>
> buf1    buf2    buf3     buf4  .... bufn
>
> In very simple terms playing an audio stream is reading from these buffers
> and continuously dma'ing it to the audio device (let's assume we have a
read
> and write register with the audio device).  And in this circulary linked
> audio buffer the user fills the data and the driver empties it to the
> device.
>
> Now I am not able to fit this scenario in the ALSA framework.  I am
> referrring to alsa-kernel/arm/sa11xx-uda1341.c file as a reference for my
> driver.  And here I don't understand where do we specify the the exact dma
> parameters (like the start address of buffer and the destination address).

You should do most of the hw setup in the .hw_params callback. You get
pointers to the substream and hw_params structures and you have to setup
the hw and the buffer as requested. These macros may be useful
params_period_bytes(), params_buffer_bytes(), snd_pcm_substream_sgbuf(),
snd_sgbuf_get_addr(). There are many others, look at the sources :)


--
Giuliano.


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to