From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yu-hsuan Hsu Subject: Re: A question about period Date: Fri, 3 Aug 2018 16:09:30 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by alsa0.perex.cz (Postfix) with ESMTP id 19EA8267365 for ; Fri, 3 Aug 2018 10:09:42 +0200 (CEST) Received: by mail-oi0-f53.google.com with SMTP id j205-v6so8381070oib.4 for ; Fri, 03 Aug 2018 01:09:42 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: tiwai@suse.de Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 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 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 > > >