Re: mapping externally allocated Scatter Gather DMA buffers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 10 Nov 2010, Manu Abraham wrote:

On Wed, Nov 10, 2010 at 8:35 PM, Jaroslav Kysela <perex@xxxxxxxx> wrote:
On Wed, 10 Nov 2010, Manu Abraham wrote:
   Â/* enable stream */
   Â/* initializing 8 buffer with "pages" pages each .. */
   Âstream = saa7231_stream_init(saa7231, AUDIO_CAPTURE, ADAPTER_INT,
0, pages);
   Âif (!stream) {
       Âdprintk(SAA7231_ERROR, 1, "ERROR: Registering stream");
       Âreturn -ENOMEM;
   Â}
   Âaudio->stream = stream;
   Âbuffer = stream->dmabuf;
   Âsaa7231_add_irqevent(saa7231, 43, SAA7231_EDGE_RISING,
saa7231_audio_evhandler, "AS2D_AVIS");
   Âdprintk(SAA7231_DEBUG, 1, "Mapping %d buffers with %d pages each",
XS2D_BUFFERS, pages);

Unfortunately, I don't understand the role of XS2D_BUFFERS. The ALSA bufsize
is the whole DMA area (you should use params_buffer_bytes() to get this
value instead of calculating this using periods * period_size).

It means: Just allocate number of pages required for buffer_bytes. Don't
play with periods (except the interrupts).


There are 8 SG buffers for the hardware; the maximum size of each
buffer can be 512 pages,
the minimum can be a single page.

Could you describe more the whole DMA layout, including IRQ acks?

It seems to me:

SG PAGE 1 points to 1 - 512 data pages (4096 bytes long)
SG PAGE 2 .....
    ....
SG PAGE 8 .....

How you can program interrupts? Only when the whole page is finished or the interrupt does not depend on the DMA buffer position, but a hw clock timer?

Could you limit how much data (samples) are fetched from the one data page or the hw operates with whole pages only?

Note that the stream processing rate is usually independent from the DMA layout in most hw.

						Jaroslav

-----
Jaroslav Kysela <perex@xxxxxxxx>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux