On 01/07/11 17:12, Mark Brown wrote:
On Fri, Jul 01, 2011 at 03:50:35PM +0100, Liam Girdwood wrote:
On 01/07/11 02:48, Sangbeom Kim wrote:
if (res >= snd_pcm_lib_buffer_bytes(substream))
res = 0;
Is it likely that your DMA pointer will go beyond the buffer size ? If this happens then I suspect you have something wrong in your DMA config ?
This is actually quite common - the normal case where it happens is that the DMA controller reports one location beyond the last location it read so when it hits the end of the buffer you see it report just beyond the end of the buffer (which is hit quite often since this tends to also generate an interrupt which causes a pointer() query). Replacing the check with an == should be enough for that, though.
I agree, but I think he should really also have a comment here stating this condition if it exists.
Liam