All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yu-hsuan Hsu <yuhsuan@google.com>
To: tiwai@suse.de
Cc: alsa-devel@alsa-project.org
Subject: Re: A question about period
Date: Fri, 3 Aug 2018 16:09:30 +0800	[thread overview]
Message-ID: <CAEy1m_CgOCi4sUcju7Ydzt+iGHHg+0ZHjc-m2W2QJdKVSaHVCg@mail.gmail.com> (raw)
In-Reply-To: <s5ha7q3x5wy.wl-tiwai@suse.de>

Thank for your answer!

The other question is if we set period_size to N, but the frames it
consumes once is 5N. Can it said it supports period_size N? How do we check
whether the period_size can be set correctly?

On Fri, Aug 3, 2018 at 3:31 PM Takashi Iwai <tiwai@suse.de> wrote:

> On Fri, 03 Aug 2018 08:28:37 +0200,
> Yu-hsuan Hsu wrote:
> >
> > Hi all,
> >
> > I have a question about the period we set in hw_params. I found different
> > boards may have different explanations about it. I have two guesses about
> > its meaning.
> >
> > 1. The period_size is the size of each hardware's consumption. If we set
> > period size to N, the pcm will consume N frames each time.
> >
> > 2. The period_size is the size to control when hardware call interrupt.
> If
> > we set period size to N, the pcm consume frames in its step. When the
> > number of frames it consumes more than N, it will call interrupt.
>
> 2 is the correct answer.
>
>
> HTH,
>
> Takashi
>
> > We can use snd_pcm_avail function to check the real available frames in
> > the device. If guess 1 is correct, the size of consumption should be
> fixed.
> > Else, setting period_size is nothing to do with hardware's
> > consumption. I've checked some boards and found that each board has
> > different behavior (Most of them meet guess 2). I'm confuse which one is
> > correct. Thanks!
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel@alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> >
>

  reply	other threads:[~2018-08-03  8:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03  6:28 A question about period Yu-hsuan Hsu
2018-08-03  7:31 ` Takashi Iwai
2018-08-03  8:09   ` Yu-hsuan Hsu [this message]
2018-08-03  8:30     ` Takashi Iwai
2018-08-03 10:04       ` Yu-hsuan Hsu
2018-08-03 10:14         ` Takashi Iwai
2018-08-03 17:24           ` Yu-hsuan Hsu
2018-08-03 18:31             ` Takashi Iwai
2018-08-06  5:57               ` Yu-hsuan Hsu

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=CAEy1m_CgOCi4sUcju7Ydzt+iGHHg+0ZHjc-m2W2QJdKVSaHVCg@mail.gmail.com \
    --to=yuhsuan@google.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /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.