From: Takashi Iwai <tiwai@suse.de>
To: Jaroslav Kysela <perex@suse.cz>
Cc: Tobias Peters <tpeters@uni-oldenburg.de>,
alsa-devel@lists.sourceforge.net
Subject: Re: hw_pointer error message triggered without need
Date: Tue, 21 Oct 2003 19:55:59 +0200 [thread overview]
Message-ID: <s5h8ynecw5s.wl@alsa2.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.53.0310211910520.1483@pnote.perex-int.cz>
At Tue, 21 Oct 2003 19:24:04 +0200 (CEST),
Jaroslav wrote:
>
> On Tue, 21 Oct 2003, Takashi Iwai wrote:
>
> > At Tue, 21 Oct 2003 17:37:30 +0200,
> > Tobias Peters wrote:
> > >
> > > I'm using linux-2.4.22 with alsa drivers 0.9.7c. Sound card driver in
> > > use was intel 8x0 (but I doubt it's responsible in this case).
> > >
> > > ALSA ../alsa-kernel/core/pcm_lib.c:216: Unexpected hw_pointer value
> > > (stream = 0, delta: -255, max jitter = 256): wrong interrupt acknowledge?
> > >
> > > If I understand the relevant code correctly, then this error message is
> > > triggered unnecessarily if the hardware buffer is only two periods in
> > > size. It is triggered when the hardware pointer has already been
> > > increased by one sample since the last period completed.
> > >
> > > Not so if there are more periods per buffer.
> >
> > well, it's not unnecessary but too strict.
> > especially, if the hardware generates too late (often seen on onboard
> > chips), and if only two periods are used, this situation can happen.
> >
> > i think delta < (runtime->period_size/2) would be enough to check the
> > negative (invalid) hwptr rather than delta < (runtime->buffer_size/2)
> > as it is.
>
> Nope. This check will be wrong because we will fall to the wrap point and
> increase hw_ptr_base with buffer_size.
the problem is that this check is too strict when only two periods are
used. since buffer_size/2 == period_size, if the update of hwptr is
delayed even for one sample, it won't pass.
> Looking to code, it seems that an interrupt was lost. Its quite impossible
> to create a realiable check for lost interrupts when you have only two
> periods in the midlevel code. Or the interrupt was generated too early.
there is a little difference between snd_pcm_update_hw_ptr() and
snd_pcm_update_hw_ptr_interrupt(), and this problem doesn't happen in
the former but only in the latter function, which is invoked by
snd_pcm_lib_write1().
in the former function, delta is the difference between the expected
pointer (lastptr + period_size) and the current pointer. meanwhile,
in the latter function, delta is the difference between the last
pointer and the new pointer.
hence, the calculation of delta in the latter function can be easily
less than buffer_size/2 when nperiods = 2.
> Anyway, I think that we should leave the check as is for debugging
> purposes (we should know that something is failing).
sure, it's harmless message (as long as it comes from
snd_pcm_update_hw_ptr()) but too annoying. there are too many
sloppy hardwares...
Takashi
-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
next prev parent reply other threads:[~2003-10-21 17:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-21 15:37 hw_pointer error message triggered without need Tobias Peters
2003-10-21 16:59 ` Takashi Iwai
2003-10-21 17:24 ` Jaroslav Kysela
2003-10-21 17:55 ` Takashi Iwai [this message]
2003-10-22 2:00 ` Manuel Jander
2003-10-22 8:25 ` Tobias Peters
2003-10-22 9:18 ` Takashi Iwai
2003-10-22 8:16 ` Tobias Peters
2003-10-22 11:54 ` Takashi Iwai
2003-10-23 7:31 ` Tobias Peters
2003-10-23 15:01 ` Takashi Iwai
2003-10-22 10:58 ` Jaroslav Kysela
2003-10-22 11:19 ` Takashi Iwai
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=s5h8ynecw5s.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=perex@suse.cz \
--cc=tpeters@uni-oldenburg.de \
/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.