On Thu, 21 Sep 2006 12:16:25 +0200
Tomas Carnecky <[EMAIL PROTECTED]> wrote:

> Clemens Ladisch wrote:
> > Tomas Carnecky wrote:
> >> The thing is, in my application I can't set period time to anything else 
> >> than 21333 and that is, well, kinda bad.
> > 
> > Your application must be able to handle any period size.
> > 
> > Why does the period size matter at all?
> 
> My app can handle that now, but the way how I had to do it defeats the 
> 'zero-copy' paradigm.
> 
> The situation is this: the application requests a 16kb buffer, at 2 
> channels / U16LE this makes a 4096 frames. It's a streaming buffer and 
> the app writes in the data in chunks of 4096 bytes. I can't map the alsa 
> mmap'ed buffer to the application (because of the different size) so I 
> have to create my own temporary buffer and then copy the data to the 
> mmap'ed buffer.
> 
> tom
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Alsa-user mailing list
> Alsa-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-user
> 

I might be wrong, but it seems that 4096 bytes limit comes from these
facts:

1) on Linux page size is 4096 bytes;
2) if one allocate more than 4096 bytes, the system cannot guarantee the
pages are contiguous;
3) ALSA uses DMA whenever the card supports it;
4) DMA needs contiguous buffer, so we are back to one page 4096 bytes
buffer.

--Sergei.

-- 
Visit my http://appsfromscratch.berlios.de/ open source project.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to