Subject: Re: a mmap'able audio device??
To: Lennart Augustsson <augustss@cs.chalmers.se>
From: Brett Lymn <blymn@awadi.com.AU>
List: tech-kern
Date: 03/05/1996 20:30:26
According to Lennart Augustsson:
>
>Of course I don't take it personally. The NetBSD audio stuff is
>far from perfect. But having the DMA buffer mmap'ed and fiddling
>with buffer pointers seems to like such a poor abstraction to me.
>There must be a better way.
>
Firstly let me say that I got it slightly wrong with the pointers -
they are not part of the mmap'ed data, which makes sense.
Having the dma buffer as an mmap'able object does have the major
benefit of not having to copy data over the user/kernel boundary.
This is a major performance win. The audio driver, as it stands,
keeps a buffer anyway and just feeds the audio card from that. All
you do when you do a write to the audio card is put data into this
buffer. The driver blocks this data up and dma's it to the sound
card. All you are actually doing by allowing the user to mmap the
driver's buffer is cut the overhead of the write call and the
associated data copy - which is highly desirable especially
considering the amount of data that needs to be shifted at the higher
sample rates!!
--
Brett Lymn, Computer Systems Administrator, AWA Defence Industries
===============================================================================
"Upgrading your memory gives you MORE RAM!" - ad in MacWAREHOUSE catalogue.