All of lore.kernel.org
 help / color / mirror / Atom feed
* Scatter Gather
@ 2004-02-27 18:17 Manuel Jander
  2004-03-01 12:52 ` Clemens Ladisch
  0 siblings, 1 reply; 8+ messages in thread
From: Manuel Jander @ 2004-02-27 18:17 UTC (permalink / raw)
  To: Alsa Devel list

Hi,

AFAIK, it seems that when using a scatter gather buffer, not every
period is located inside of a page. If for example i use a period size
of 3000 bytes and a Scatter Gather buffer, i would have this:

pages : page0, page1, page2 ...
periods: p0, p1, p2, p3, p4 ...

|...page0...||...page1...||...page3...|
|...p0...||...p1...||...p2...||...p3...|

The problem is that a DMA transfer can not go accross 2 different pages.
On Aureal hardware, even on contiguous buffers this causes all sort of
odd problems. Each DMA chunk must be on the same page.

So i would have to do this:

d0, d1, d2, d3 : DMA chunks programmed in hardware. There are 4 for each
DMA channel.

|...page0...||...page1...||...page3...|
|...p0...||..|.p1...||...p2...||...p3...|
|...d0...||d1||.d2..||d3||.d0.||..d1..|

That means that i would have to split each period that crosses a page
boundary into 2 DMA chunks, with all the complications involved because
of irregular sizes, offsets... ARghhh!

I could just leave the period size as a power of 2, on that way, a
period would never cross any page boundary, but most ALSA programs are
too picky to accept that kind of restrictions in most cases.


----------------------------------------------
Regarding the "Writing a ALSA driver" Docbook:

Regarding the Non contiguous buffers, that the sgbuf struct can be
derived as:

snd_pcm_sgbuf_t *sgbuf = (snd_pcm_sgbuf_t*)substream->dma_private;

But there is a problem: The substream->dma_private is only valid after 
snd_pcm_lib_malloc_pages() has been called. Maybe it would be nice to
hint about this small detail in the document.


Best Regards

Manuel




-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 8+ messages in thread
* scatter gather
@ 2010-08-18 12:21 Round Robinjp
  2010-08-18 19:24 ` Linus Walleij
  0 siblings, 1 reply; 8+ messages in thread
From: Round Robinjp @ 2010-08-18 12:21 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Is scatter gather supported on ARM linux?
I am trying to find out how to use it, but can find
only old info. Can I find uptodate info anywhere
which can be used with newer kernels?

Thanks
RR

--------------------------------------
GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
http://pr.mail.yahoo.co.jp/gyao/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-08-18 19:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-27 18:17 Scatter Gather Manuel Jander
2004-03-01 12:52 ` Clemens Ladisch
2004-03-02  4:09   ` Manuel Jander
2004-03-02  8:00     ` Jaroslav Kysela
2004-03-02 10:16     ` Giuliano Pochini
2004-03-02 10:23       ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2010-08-18 12:21 scatter gather Round Robinjp
2010-08-18 19:24 ` Linus Walleij

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.