linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: atmel-pcm-dma: increase buffer_bytes_max
@ 2015-03-30 19:40 Alexandre Belloni
  2015-03-31  7:39 ` [alsa-devel] " Lars-Peter Clausen
  2015-04-01 20:33 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Alexandre Belloni @ 2015-03-30 19:40 UTC (permalink / raw)
  To: Mark Brown, Bo Shen, Nicolas Ferre
  Cc: linux-arm-kernel, linux-kernel, alsa-devel, Alexandre Belloni

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(-)

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)
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: atmel-pcm-dma: increase buffer_bytes_max
  2015-03-30 19:40 [PATCH] ASoC: atmel-pcm-dma: increase buffer_bytes_max Alexandre Belloni
@ 2015-03-31  7:39 ` Lars-Peter Clausen
  2015-04-01 20:33 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2015-03-31  7:39 UTC (permalink / raw)
  To: Alexandre Belloni, Mark Brown, Bo Shen, Nicolas Ferre
  Cc: alsa-devel, linux-kernel, linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: atmel-pcm-dma: increase buffer_bytes_max
  2015-03-30 19:40 [PATCH] ASoC: atmel-pcm-dma: increase buffer_bytes_max Alexandre Belloni
  2015-03-31  7:39 ` [alsa-devel] " Lars-Peter Clausen
@ 2015-04-01 20:33 ` Mark Brown
  2015-04-02  8:13   ` Alexandre Belloni
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2015-04-01 20:33 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Bo Shen, Nicolas Ferre, linux-arm-kernel, linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

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.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: atmel-pcm-dma: increase buffer_bytes_max
  2015-04-01 20:33 ` Mark Brown
@ 2015-04-02  8:13   ` Alexandre Belloni
  0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2015-04-02  8:13 UTC (permalink / raw)
  To: Mark Brown
  Cc: Bo Shen, Nicolas Ferre, linux-arm-kernel, linux-kernel, alsa-devel

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.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-02  8:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-30 19:40 [PATCH] ASoC: atmel-pcm-dma: increase buffer_bytes_max Alexandre Belloni
2015-03-31  7:39 ` [alsa-devel] " Lars-Peter Clausen
2015-04-01 20:33 ` Mark Brown
2015-04-02  8:13   ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).