From: Takashi Iwai Subject: Re: ALSA always writes _whole_ periods, right? Date: Thu, 14 Jun 2007 12:39:50 +0200 Message-ID: References: <1181751818.5752.13.camel@localhost> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 22FA810387A for ; Thu, 14 Jun 2007 12:39:59 +0200 (CEST) In-Reply-To: <1181751818.5752.13.camel@localhost> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Joachim =?ISO-8859-1?Q?F=F6rster?= Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Wed, 13 Jun 2007 18:23:38 +0200, Joachim F=F6rster wrote: > = > Hi ALSA devs, > = > I have a quick question regarding the filling of the usual ring buffer > in RAM (used by sound controllers via DMA), just to be really sure: > = > Is it true, that ALSA always writes (via mmap'ing) _whole_ periods? The whole buffer is, of course, used. Otherwise you'll get obvious noises :) But if you're asking about the timinig, then no. How much data is written at which timing isn't strictly defined in mmap mode. The PCM core just checks the available size at each snd_pcm_period_elapsed(), and reports XRUN if needed. That's all. > I took snd-dummy and modified it to use "ack()" method and tried to > confirm, if the above is true _without_ memory mapping (classical > read/write). It seem's to be true, ALSA is "filling up" the last (not > always complete) period - e.g. if the played wav file is not a multiple > of periodsize in length. > But well, with mmap, I cannot see the copying action (done by ALSA > library, right?) ... so, thus my question ;-) . Right, copy / ack aren't involved with mmap mode... Takashi