[alsa-devel] hw_params function and OSS emulation
xyzzy at speakeasy.org
Fri Aug 24 00:17:33 CEST 2007
On Thu, 23 Aug 2007, Takashi Iwai wrote:
> At Thu, 23 Aug 2007 13:43:40 -0500,
> Timur Tabi wrote:
> > Takashi Iwai wrote:
> > > Err, usually, application = user-space application. Do you mean
> > > really this?
> > Yes. The application allocates a buffer, locks it down, and passes it to the
> > kernel. Since the buffer was allocated in user space, it is virtual
> > contiguous but not physically contiguous, hence the need for a list of
> > physical addresses. To the hardware, the buffer appears as a collection of
> > scattered buffers. Hence, scatter/gather.
> Hm, then it must be a really special application. I've never seen
> linux audio apps doing such things...
v4l2 suppoorts both kinds of memory mapped dma. Normally, the dma buffer
is allocated by the kernel and the user space application is given an
address to memory map. This way DMA-able memory can be allocated. For
some device, e.g. zr36060, it might even need to be physically contiguous.
The other kind is called "user pointer" and in this case user space
allocates the memory and passes a pointer to the kernel. It's defined in
the API, but I think few (any?) driver actually support it. One could use
this to place the dma buffer in a shared memory segment or some other
reason the application wants the buffer at a certain address.
More information about the Alsa-devel