From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lennart Poettering Subject: Re: Timer instability Date: Mon, 23 Feb 2009 03:56:10 +0100 Message-ID: <20090223025610.GA7062@tango.0pointer.de> References: <20090219024611.GA7930@tango.0pointer.de> <20090220012220.GA11526@tango.0pointer.de> <20090220203417.GA19093@tango.0pointer.de> <20090222031453.GA24365@tango.0pointer.de> <20090223024233.GA1901@tango.0pointer.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from tango.0pointer.de (tango.0pointer.de [85.214.72.216]) by alsa0.perex.cz (Postfix) with ESMTP id 74C1E1037F2 for ; Mon, 23 Feb 2009 03:56:10 +0100 (CET) Content-Disposition: inline In-Reply-To: <20090223024233.GA1901@tango.0pointer.de> 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: alsa-devel@alsa-project.org Cc: Takashi Iwai List-Id: alsa-devel@alsa-project.org On Mon, 23.02.09 03:42, Lennart Poettering (mznyfn@0pointer.de) wrote: > > 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: [...] This is the end of the tool's output for HDA AD1989B: http://fpaste.org/paste/4240 The device is completely filled up (i.e. avail is 0, delay is 4416) and then after 2us suddenly the avail jumps to 4971973988617027465 and the delay to -4971973988617023049. Smells like an integer overflow to me ... Hmm, for now my little testing experiment I've now found es1969, ens1371, intel8x0, snd-emu10k1 and some intel-hda to have unreliable _avail() or _delay(). Lennart -- Lennart Poettering Red Hat, Inc. lennart [at] poettering [dot] net ICQ# 11060553 http://0pointer.net/lennart/ GnuPG 0x1A015CC4