From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [patch] dmix skipping first set of samples Date: Mon, 10 Mar 2008 12:03:24 +0100 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns1.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 053DA24431 for ; Mon, 10 Mar 2008 12:03:27 +0100 (CET) In-Reply-To: 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: Mike Gorse Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Sun, 9 Mar 2008 18:20:47 -0400 (EDT), Mike Gorse wrote: > > There was a change in alsa-lib 1.0.16 which looks like it was designed to > make dmix skip samples in the case of underruns, but it causes the first > sample to be skipped since dmix->slave_hw_ptr == dmix->slave_appl_ptr. > The following patch fixes this and fixes a small typo in the comment: A good catch! Applied to HG tree now. Thanks. Takashi > > --- src/pcm/pcm_dmix.c.orig 2008-01-18 20:00:10.000000000 -0500 > +++ src/pcm/pcm_dmix.c 2008-03-09 18:01:13.000000000 -0400 > @@ -311,9 +311,9 @@ > if (size >= pcm->boundary / 2) > size = pcm->boundary - size; > > - /* the slave_app_ptr can be far behing the slave_hw_ptr */ > + /* the slave_app_ptr can be far behind the slave_hw_ptr */ > /* reduce mixing and errors here - just skip not catched writes */ > - if (dmix->slave_hw_ptr < dmix->slave_appl_ptr) > + if (dmix->slave_hw_ptr <= dmix->slave_appl_ptr) > slave_size = dmix->slave_appl_ptr - dmix->slave_hw_ptr; > else > slave_size = dmix->slave_appl_ptr + (dmix->slave_boundary - dmix->slave_hw_ptr); > > Thanks, > -- Mike Gorse / AIM:linvortex / http://mgorse.freeshell.org -- > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >