All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jassi Brar <jassisinghbrar@gmail.com>
Cc: Sangbeom Kim <sbkim73@samsung.com>,
	alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com,
	lrg@slimlogic.co.uk, Seungwhan Youn <claude.youn@gmail.com>
Subject: Re: [PATCH v5 4/4] ASoC: SAMSUNG: Add I2S0 internal dma driver
Date: Wed, 13 Jul 2011 09:57:50 +0200	[thread overview]
Message-ID: <s5hk4bmfw8x.wl%tiwai@suse.de> (raw)
In-Reply-To: <CABb+yY1GXVXnWL2sdTWm5_d4SQtbJ3FpZe8_XyFrsHODG5GRag@mail.gmail.com>

At Wed, 13 Jul 2011 11:44:03 +0530,
Jassi Brar wrote:
> 
> On Wed, Jul 13, 2011 at 11:24 AM, Takashi Iwai <tiwai@suse.de> wrote:
> >> >> +       .channels_min = 2,
> >> >> +       .channels_max = 2,
> >> >> +       .buffer_bytes_max = MAX_IDMA_BUFFER,
> >> >> +       .period_bytes_min = 128,
> >> >> +       .period_bytes_max = MAX_IDMA_PERIOD,
> >> >
> >> > In this case, MAX_IDMA_BUFFER is 160k and MAX_IDMA_PERIOD is 128k,
> >> > buffer is not twice of period. If you set like this, many of general
> >> > ALSA applications return error on initial buffers.
> >> I don't think so. Did you see any such problem ?
> >> In my opnion, ALSA will always use 2 periods of approx. MAX_IDMA_BUFFER/2 bytes
> >
> > It's not guaranteed unless you set explicitly a hw_constraint, such as
> >    snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
> >
> > The ALSA API itself allows a buffer size not aligned to a period size.
> Sure it does and we do set the constraint in Samsung's normal DMA
> driver where periods_max is quite large.

OK, I just want to be sure.

> An important part missing in Claude's quote is
> +       .periods_min = 1,
> +       .periods_max = 2,
> 
> When the periods_max is only 2, the calculations in ALSA mid-layer
> seem to always
> decide on using two equal size periods.
> 
> I didn't dig in the logic but wasn't able to get any application to
> configure something
> like {Period_size = 90% of Buffer_size}  which is actually beneficial for
> Low-Power-Audio-Mode.

Even you don't set the integer constraint, right?
Does it happen with aplay with -Dhw?

In the driver side, there is a define RULES_DEBUG in
sound/core/pcm_native.c, which will enable debug prints of hw-refines.
A similar flag is found in alsa-lib/src/pcm/pcm_params.c, too.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2011-07-13  7:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13  1:25 [PATCH v5 4/4] ASoC: SAMSUNG: Add I2S0 internal dma driver Sangbeom Kim
2011-07-13  3:08 ` Seungwhan Youn
2011-07-13  5:41   ` Jassi Brar
2011-07-13  5:54     ` Takashi Iwai
2011-07-13  6:14       ` Jassi Brar
2011-07-13  6:18         ` Jassi Brar
2011-07-13  7:57         ` Takashi Iwai [this message]
2011-07-13 14:20           ` Jassi Brar
2011-07-18 23:44     ` Seungwhan Youn
2011-07-18 11:49 ` Jassi Brar
2011-07-18 12:38   ` Liam Girdwood
2011-07-19 15:04     ` Mark Brown

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=s5hk4bmfw8x.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=claude.youn@gmail.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=lrg@slimlogic.co.uk \
    --cc=sbkim73@samsung.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.