All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Revell <rlrevell-2FmhHzymoG5BDgjK7y7TUQ@public.gmane.org>
To: A list for linux audio users
	<linux-audio-user-oG0YroN0ZiqENrSoib9kfje48wsgrGvP@public.gmane.org>
Cc: alsa-devel
	<alsa-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: Again on sudden and occasional	Jack	crackling sound
Date: Wed, 10 Aug 2005 15:38:38 -0400	[thread overview]
Message-ID: <1123702719.24369.24.camel@mindpipe> (raw)
In-Reply-To: <1123639951.21956.5.camel@mindpipe>

On Tue, 2005-08-09 at 22:12 -0400, Lee Revell wrote:
> On Tue, 2005-08-09 at 16:49 -0400, Paul Davis wrote: 
> > as far as we can tell, this is an ALSA (kernel) driver issue. it does
> > not affect other backends, and does not affect (we think) every ALSA
> > supported piece of h/w. it would be nice for it to be either fixed or at
> > least tracked down conclusively.
> > 
> 
> OK, here's an idea.  Say there was an off-by-one error or some other bug
> in the ALSA middle layer that caused the reported value of the hardware
> pointer to be off by one.  So snd_pcm_avail_update would report 64
> frames available while there were actually 63.  If JACK gets scheduled
> within the space of one frame (quite possible especially with the RT
> kernel, it's a ~20us window at 48KHz) then we could overwrite the wrong
> part of the buffer - a frame or two ahead of the hardware pointer.
> AFAICT this would introduce a crackle, but no xruns would be reported.

Hmm, I think I might be on to something.  This sounds like the exact
same bug, but they can produce it without JACK:

http://www.winehq.org/hypermail/wine-patches/2005/08/0173.html

The WINE developer had the same idea:

      //* /*FIXME*/: snd_pcm_mmap_hw_ptr() should not be accessed by a user app. *//
      //*        It will NOT return what why want anyway. *//
      hw_ptr = _snd_pcm_mmap_hw_ptr(wwo->pcm);

  I thought, maybe it is not returning the correct information for 
  GetPosition, so that is why the crackling exists, since new samples are 
  off-position from what they should be in order to guarantee a smooth 
  sound

So in both cases we're operating in mmap mode and ALSA is returning a
slightly incorrect hardware pointer which leads to crackling.

Lee

  reply	other threads:[~2005-08-10 19:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <42F02BB2.3000201@virgilio.it>
     [not found] ` <42F62AE8.60604@virgilio.it>
     [not found]   ` <87r7d4xmxm.fsf@localhost.localdomain>
     [not found]     ` <42F7D849.3030000@virgilio.it>
     [not found]       ` <87ll3byh42.fsf@localhost.localdomain>
     [not found]         ` <1123557715.25617.32.camel@localhost.localdomain>
     [not found]           ` <42F8A6AE.6010609@virgilio.it>
     [not found]             ` <7q8xzb5ekw.fsf@io.com>
     [not found]               ` <42F92B60.9020909@virgilio.it>
     [not found]                 ` <1123620561.25617.58.camel@localhost.localdomain>
2005-08-10  2:12                   ` [linux-audio-user] Again on sudden and occasional Jack crackling sound Lee Revell
2005-08-10 19:38                     ` Lee Revell [this message]
2005-08-11 15:33                       ` Lee Revell

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=1123702719.24369.24.camel@mindpipe \
    --to=rlrevell-2fmhhzymog5bdgjk7y7tuq@public.gmane.org \
    --cc=alsa-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=linux-audio-user-oG0YroN0ZiqENrSoib9kfje48wsgrGvP@public.gmane.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 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.