From: Lennart Poettering <mznyfn@0pointer.de>
To: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: Timer instability
Date: Mon, 23 Feb 2009 03:42:34 +0100 [thread overview]
Message-ID: <20090223024233.GA1901@tango.0pointer.de> (raw)
In-Reply-To: <20090222031453.GA24365@tango.0pointer.de>
On Sun, 22.02.09 04:14, Lennart Poettering (mznyfn@0pointer.de) wrote:
> I wrote this little test to track down all kinds of timer issues: it
> opens and sets up a sound device. Then it will constantly query
> _avail(), _delay() and _htstamp() in a busy loop writing a single
> sample at a time. The three values are then printed along with a
> system timestamp. The data generated like this can be opened in
> gnumeric and a nice graph be drawn.
Hmm, did some more testing with this tool on other cards:
On es1969 snd_pcm_avail() sometimes returns values like
1073728596 samples. This smells a lot like an overflow given that this
times four (i.e. the sample size in bytes) is near to 2^32.
Here's an output of this tool for an emu10k1 card:
http://www.nopaste.pl/9vi
Check out line 4417: This is when the devcie starts playback. avail
goes rightfully to 0 (i.e column 4 -- don't get confused by the line
numbers the nopaste adds here), but the playback time suddenly jumps
from 100113 us down to 702 us (column 4 which is the written sample
counter minus the delay transformed to us). This is because in
contrast to most other drivers for this one writing a sample has no
direct effect on snd_pcm_delay while the device is stopped.
Also this shows that the data from _avail() and _status() together is
not atomic: the columns for avail delay change in
different rows when we don't get scheduled often enough.
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
next prev parent reply other threads:[~2009-02-23 2:42 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-19 2:46 Timer instability Lennart Poettering
2009-02-19 6:52 ` Takashi Iwai
2009-02-20 1:22 ` Lennart Poettering
2009-02-20 1:26 ` Lennart Poettering
2009-02-20 1:50 ` Lennart Poettering
2009-02-20 7:26 ` Takashi Iwai
2009-02-20 20:34 ` Lennart Poettering
2009-02-21 16:36 ` Takashi Iwai
2009-02-22 3:14 ` Lennart Poettering
2009-02-23 2:42 ` Lennart Poettering [this message]
2009-02-23 2:56 ` Lennart Poettering
2009-02-23 19:20 ` Lennart Poettering
2009-02-23 19:24 ` Colin Guthrie
2009-02-24 3:21 ` Lennart Poettering
2009-02-23 7:47 ` Takashi Iwai
2009-02-24 16:27 ` Takashi Iwai
2009-02-24 18:46 ` Lennart Poettering
2009-02-24 18:59 ` Takashi Iwai
2009-02-24 19:04 ` Jaroslav Kysela
2009-02-24 19:26 ` Lennart Poettering
2009-02-24 20:37 ` Takashi Iwai
2009-02-25 10:08 ` Takashi Iwai
2009-02-25 10:22 ` Takashi Iwai
2009-02-25 12:34 ` Clive Messer
2009-02-25 13:36 ` Takashi Iwai
2009-02-25 15:11 ` Clive Messer
2009-02-25 15:51 ` Takashi Iwai
2009-02-25 16:24 ` Clive Messer
2009-02-25 16:39 ` Takashi Iwai
[not found] ` <200902251656.47813.clive@vacuumtube.org.uk>
2009-02-25 16:59 ` Takashi Iwai
2009-02-25 17:36 ` Clive Messer
2009-02-25 18:13 ` Takashi Iwai
2009-02-25 18:16 ` Clive Messer
2009-02-25 18:34 ` Clive Messer
2009-03-03 16:05 ` Takashi Iwai
2009-03-03 17:41 ` Takashi Iwai
2009-03-09 11:13 ` Clive Messer
2009-03-09 11:20 ` Takashi Iwai
2009-03-09 13:09 ` Takashi Iwai
2009-02-25 15:04 ` Takashi Iwai
2009-02-25 10:44 ` Lennart Poettering
2009-02-24 21:16 ` Lennart Poettering
2009-02-25 10:48 ` Takashi Iwai
2009-02-25 10:57 ` Jaroslav Kysela
2009-02-25 11:04 ` Takashi Iwai
2009-02-25 11:10 ` Jaroslav Kysela
2009-02-25 11:17 ` 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=20090223024233.GA1901@tango.0pointer.de \
--to=mznyfn@0pointer.de \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox