* Scatter Gather and odd period sizes.
@ 2003-03-16 7:10 Manuel Jander
2003-03-17 16:14 ` Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: Manuel Jander @ 2003-03-16 7:10 UTC (permalink / raw)
To: alsa-devel
Hello,
I'm writing Scatter Gather support for the Aureal Vortex,
and the problem is that i get period sizes that dont match
the page size. That is not so bad, but the page count doesnt
match the period count either.
How are the pages mapped on the buffer ?? I dont see any chance
that could work. Why arent the page count at least equal to the
period count ?
I tried several combinations to map the SG pages, but i cant find any
that works OK.
Best Regards
Manuel Jander.
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Scatter Gather and odd period sizes.
2003-03-16 7:10 Manuel Jander
@ 2003-03-17 16:14 ` Takashi Iwai
0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2003-03-17 16:14 UTC (permalink / raw)
To: Manuel Jander; +Cc: alsa-devel
At Sun, 16 Mar 2003 03:10:15 -0400,
Manuel Jander wrote:
>
> Hello,
>
> I'm writing Scatter Gather support for the Aureal Vortex,
> and the problem is that i get period sizes that dont match
> the page size. That is not so bad, but the page count doesnt
> match the period count either.
>
> How are the pages mapped on the buffer ?? I dont see any chance
> that could work. Why arent the page count at least equal to the
> period count ?
you can define such a hw_constraint function.
but...
normal ALSA drivers use a phyiscally or virtually linear pcm buffer.
most of drivers allocate a phyically continous buffer, and the drivers
supporting sg-buffer, such as emu10k1 or via82xx, map the distinct
kernel pages (its size depending on the architecture, 4Kbyte on i386)
onto the virtually linear address. emu10k1 and trident have its own
page table and can use the sg-buffer simply as a linear buffer.
meanwhile, via82xx (and intel8x0) have the buffer-descriptor, and on
ALSA driver, the periods are split to 4k byte boundary if the size
isn't aligned to 4k page size.
however, a driver does NOT have to use a linear buffer; this
condition is necessary only for supporting mmap. if your driver
doesn't support mmap, it's ok to use a completely non-contiguous
buffer. you'll need to define copy/silence callbacks appropriately
for copying the play/capture data and setting the silence data.
i'm not sure how the aureal driver works. IIRC, it can use up to 4 x
4k pages, right? if its size is really only 4 pages, i'd recommend to
use a simple phyically linear buffer.
Takashi
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Scatter Gather and odd period sizes.
[not found] <200303171612.AA25887592@embedded.cl>
@ 2003-03-18 11:33 ` Takashi Iwai
0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2003-03-18 11:33 UTC (permalink / raw)
To: mjander; +Cc: alsa-devel
At Mon, 17 Mar 2003 16:12:24 -0400,
mjander wrote:
>
> hi,
>
> >
> >i'm not sure how the aureal driver works. IIRC, it can use up to 4 x
> >4k pages, right? if its size is really only 4 pages, i'd
> recommend to
> >use a simple phyically linear buffer.
> >
> >
> >Takashi
> >
>
> In the meanwhile i managed to use SG buffer by simply setting the
> period max and minimal size to 0x1000 (4KiB). I even implemented a
> page extender, such like the CSxxx patch that extends 2 physical
> (4 in this case) periods into unlimited periods, but i couldn't
> measure any improvement (less skipping on high load or the
> like). So i think i better stay with linear buffers, and map the
> physical pages in a linear fashion.
> Using this approach the buffer size extender mechanism for more
> periods is still possible.
yes.
> What I still don't understand, after my experiments: Why should i
> use Scatter Gather ? As far as i can tell, it doesnt provide any
> advantage, except that you can use smaller chunks of memory when
> larger ones arent avaiable.
correct. the only advantage is the memory usage.
> Someone talked about "the faster
> Scatter Gather"...
> Why "faster"?
most likely it's a misunderstanding.
for the hardware, it won't make difference regarding the speed (except
for very tiny issues like cache, etc :)
for the driver, as you noticed, it will even increase the work you
need to do.
ciao,
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink?
You could win a Tablet PC. Get a free Tablet PC hat just for playing.
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-03-18 11:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200303171612.AA25887592@embedded.cl>
2003-03-18 11:33 ` Scatter Gather and odd period sizes Takashi Iwai
2003-03-16 7:10 Manuel Jander
2003-03-17 16:14 ` Takashi Iwai
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.