diff mbox

ASoC: atmel-pcm-dma: increase buffer_bytes_max

Message ID 1427744437-14610-1-git-send-email-alexandre.belloni@free-electrons.com (mailing list archive)
State Accepted
Commit c14e2591bf54c45c9f80cf728fb90976c4e10384
Headers show

Commit Message

Alexandre Belloni March 30, 2015, 7:40 p.m. UTC
atmel-pcm-dma is not limited to a buffer size of 64kB like atmel-pcm-pdc.
Increase buffer_bytes_max to 512kB to allow for higher bit rates (i.e. 32bps at
192kHz) to work correctly. By default, keep the prealloc at 64kB.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 sound/soc/atmel/atmel-pcm-dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Lars-Peter Clausen March 31, 2015, 7:39 a.m. UTC | #1
On 03/30/2015 09:40 PM, Alexandre Belloni wrote:
> atmel-pcm-dma is not limited to a buffer size of 64kB like atmel-pcm-pdc.
> Increase buffer_bytes_max to 512kB to allow for higher bit rates (i.e. 32bps at
> 192kHz) to work correctly. By default, keep the prealloc at 64kB.

Patch per se looks good. But can you test if it works to just throw 
atmel_pcm_dma_hardware away completely and rely on the dmaengine PCM driver 
getting the capabilities directly from the DMA driver. Since the DMA driver 
now reports its capabilities I think it should work, and if it does that's 
the preferred solution.

- Lars
Mark Brown April 1, 2015, 8:33 p.m. UTC | #2
On Mon, Mar 30, 2015 at 09:40:37PM +0200, Alexandre Belloni wrote:
> atmel-pcm-dma is not limited to a buffer size of 64kB like atmel-pcm-pdc.
> Increase buffer_bytes_max to 512kB to allow for higher bit rates (i.e. 32bps at
> 192kHz) to work correctly. By default, keep the prealloc at 64kB.

Applied, but please look into Lars' suggestion - we should be able to
just figure everything out from the DMA controller.
Alexandre Belloni April 2, 2015, 8:13 a.m. UTC | #3
On 01/04/2015 at 21:33:42 +0100, Mark Brown wrote :
> On Mon, Mar 30, 2015 at 09:40:37PM +0200, Alexandre Belloni wrote:
> > atmel-pcm-dma is not limited to a buffer size of 64kB like atmel-pcm-pdc.
> > Increase buffer_bytes_max to 512kB to allow for higher bit rates (i.e. 32bps at
> > 192kHz) to work correctly. By default, keep the prealloc at 64kB.
> 
> Applied, but please look into Lars' suggestion - we should be able to
> just figure everything out from the DMA controller.

This is definitively on the TODO list.
diff mbox

Patch

diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c
index b8e7bad05eb1..b6625c8c411b 100644
--- a/sound/soc/atmel/atmel-pcm-dma.c
+++ b/sound/soc/atmel/atmel-pcm-dma.c
@@ -54,7 +54,7 @@  static const struct snd_pcm_hardware atmel_pcm_dma_hardware = {
 	.period_bytes_max	= 2 * 0xffff,	/* if 2 bytes format */
 	.periods_min		= 8,
 	.periods_max		= 1024,		/* no limit */
-	.buffer_bytes_max	= ATMEL_SSC_DMABUF_SIZE,
+	.buffer_bytes_max	= 512 * 1024,
 };
 
 /**
@@ -119,7 +119,7 @@  static int atmel_pcm_configure_dma(struct snd_pcm_substream *substream,
 static const struct snd_dmaengine_pcm_config atmel_dmaengine_pcm_config = {
 	.prepare_slave_config = atmel_pcm_configure_dma,
 	.pcm_hardware = &atmel_pcm_dma_hardware,
-	.prealloc_buffer_size = ATMEL_SSC_DMABUF_SIZE,
+	.prealloc_buffer_size = 64 * 1024,
 };
 
 int atmel_pcm_dma_platform_register(struct device *dev)