Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Mike Gorse <mgorse@mgorse.dhs.org>
Cc: alsa-devel@alsa-project.org
Subject: Re: [patch] dmix skipping first set of samples
Date: Mon, 10 Mar 2008 12:03:24 +0100	[thread overview]
Message-ID: <s5hlk4qx2mb.wl%tiwai@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0803091816001.10825@mgorse.dhs.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
> 

      reply	other threads:[~2008-03-10 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-09 22:20 [patch] dmix skipping first set of samples Mike Gorse
2008-03-10 11:03 ` Takashi Iwai [this message]

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=s5hlk4qx2mb.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=mgorse@mgorse.dhs.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox