Re: [PATCH] ASoC: amd: Buffer Size instead of MAX Buffer

From: vishnu
Date: Wed Feb 12 2020 - 04:08:57 EST




On 11/02/20 9:08 PM, Mark Brown wrote:
On Tue, Feb 11, 2020 at 06:42:28PM +0530, Ravulapati Vishnu vardhan rao wrote:

Because of MAX BUFFER size in register,when user/app give small
buffer size produces noise of old data in buffer.
This patch rectifies this noise when using different
buffer sizes less than MAX BUFFER.

In what way does this patch fix the issue? I looks like it's moving a
buffer size setting from DMA to I2S but it's not clear why or how this
fixes the issue, or indeed what the actual issue that's causing what are
presumably underruns is?

prior to this fix the value in Tx/Rx Ring Buffer Size register ACP_BT_TX_RINGBUFSIZE,ACP_BT_RX_RINGBUFSIZE and same in I2S RINGBUFSIZE registers was statically set to maximum which is wrong.
Buffer size must be equal to actual allocated.

Due to which When I play any audio:aplay -Dhw:2,0 test.wav and then stop and play aplay -Dhw:2,0 -c2 -fS16_LE -r48000 /dev/zero --buffer-size=2048 I hear some part of old audio.


So after adding above fix the issue is not reproduced.