Cyclic DMA - callback properties and tx_status residue
Mark Brown
broonie at opensource.wolfsonmicro.com
Mon May 7 06:40:57 EDT 2012
On Wed, May 02, 2012 at 03:45:55PM +0100, Russell King - ARM Linux wrote:
> Alternatively, we could document that for cyclic transfers, one callback
> will be made after the expiry of a period or number of periods. In
> other words, if two periods expire before we issue the callback, the
> user will only get _one_ callback issued. In that case, we definitely
> need some way to determine the DMA position...
One callback is fine for audio providing it's possible to read the
position to at least some extent. If we've been delayed long enough to
miss delivering the callback then we've already lost anyway and things
should recover as well as they're going to by just looking at the
postition.
> useful. What would be more useful is if this was defined as the number
> of bytes to the end of the cyclic buffer - or something similar. That
> then would allow the current DMA position to be determined for applications
> like ASoC to know how much of the buffer it could refill with new data.
Yes, ideally we'd want to know where we are in the buffer. In practice
all some hardware can give you is the last buffer processed but that
should be adequate providing the cycle can be split into multiple
buffers but that's going to be required anyway for audio.
More information about the linux-arm-kernel
mailing list