![](https://secure.gravatar.com/avatar/5b19e9d0e834ea10ef75803718ad564b.jpg?s=120&d=mm&r=g)
At Wed, 22 Aug 2007 10:02:11 -0500, Timur Tabi wrote:
Takashi Iwai wrote:
Alternatively, you can remember the last allocated buffer-size and re-use the same buffer if the requested size is less than it. Since the buffer size change won't happen _so often_ (even via OSS emulation), this would work well in practice, too.
Hmm... Neither of these options is really that great.
... but no other way :) The buffer size is dynamically configurable, per design. That's all.
I think I like the idea of pre-allocating the buffer in .new. What is a reasonable maximum size for the DMA buffer? 32KB seems small to me.
AFAIK, 64kB seems sufficient in most cases.
When I was testing OSS emulation, the first call to .hw_params passed a DMA buffer size of over 1MB!
The driver should deny a too large size if it's unrealistic. But 1MB is realistic for many systems. So, the number depends on the system.
Takashi