[alsa-devel] [PATCH v4 4/4] ASoC: SAMSUNG: Add I2S0 internal dma driver
sbkim73 at samsung.com
Tue Jul 5 04:43:12 CEST 2011
On Monday, July 04, 2011 6:45 PM, Liam Girdwood :
> 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.
You are right. DMA pointer can not be beyond buffer size.
But This condition is just added for handling end of buffer.
As mark said, an == condition seems more preferable.
More information about the Alsa-devel