From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: How does ALSA detect underrun in OSS emulation? Date: Mon, 25 Feb 2008 16:33:42 +0100 Message-ID: References: <47C2DD41.9070408@freescale.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id D035624389 for ; Mon, 25 Feb 2008 16:33:44 +0100 (CET) In-Reply-To: <47C2DD41.9070408@freescale.com> 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: Timur Tabi Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 25 Feb 2008 09:22:41 -0600, Timur Tabi wrote: > > Can someone explain to me the exact method that ALSA uses to detect underrun > with OSS emulation? I have a driver that reports underrun on almost every > period when I use OSS emulation and I'm playing with a non-supported sample > rate. So I'm assuming that maybe my hardware is playing the audio too fast or > too slow, and the driver is returning periods before ALSA expects them. What I > don't understand is: how does ALSA know that a period was finished too early. > Does it use a timer, or is it purely application driven? It's just as same as on ALSA native API, checks the validity of the current position reported by pointer callback in snd_pcm_period_elapsed(). Takashi