linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: peda@lysator.liu.se (Peter Rosin)
To: linux-arm-kernel@lists.infradead.org
Subject: prealloc_buffer_size and buffer_bytes_max
Date: Thu, 21 May 2015 14:35:32 +0200	[thread overview]
Message-ID: <555DD114.3000500@lysator.liu.se> (raw)
In-Reply-To: <555DCF69.9090008@lysator.liu.se>

On 2015-05-21 14:28, Peter Rosin wrote:
> Hi!
> 
> I got my hopes up when I read the commit message for c14e2591bf54
> ASoC: atmel-pcm-dma: increase buffer_bytes_max. Quoting it:
> 
> 	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.
> 
> However, as I (think I) request a bigger buffer it still caps out at 64kB.
> I'm using the latency argument of snd_pcm_set_params to control the buffer:
> 
> 	snd_pcm_set_params(pcm,
> 		SND_PCM_FORMAT_S32_LE,
> 		SND_PCM_ACCESS_RW_INTERLEAVED,
> 		2,      /* channels */
> 		250000, /* rate */
> 		0,      /* do not resample */
> 		90000); /* latency in us */
> 
> But snd_pcm_hw_params_get_buffer_size "only" returns 8192 frames (64kB)
> even if I request 9us * 250kHz * 2 * 4 = 180kB. If I change the prealloc

Bzzzt, s/9us/90ms/

> from 64kB to 256kB I get a bigger buffer (and it works better too!).
> 
> Admittedly I backported this patch on top of the linux-3.18-at91
> branch from the Atmel git repo, so there might be some support
> missing that has gone in after 3.18?
> 
> Or have I completely misunderstood, and these are unrelated buffers?
> 
> Any insight in how I can get a big enough buffer without hacking the
> prealloc is appreciated!
> 
> Cheers,
> Peter
> 

  reply	other threads:[~2015-05-21 12:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 12:28 prealloc_buffer_size and buffer_bytes_max Peter Rosin
2015-05-21 12:35 ` Peter Rosin [this message]
2015-05-21 12:59 ` Alexandre Belloni
2015-05-21 14:40   ` Peter Rosin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=555DD114.3000500@lysator.liu.se \
    --to=peda@lysator.liu.se \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).