From: Takashi Iwai Subject: Re: [PATCH] Alsa-plugins: Pulse: Fix snd_pcm_avail returning 0 in some cases Date: Tue, 26 Apr 2011 16:39:40 +0200 Message-ID: References: <4DB02F8A.4040001@canonical.com> <4DB67BD3.7090706@canonical.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 mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 7A3702450A for ; Tue, 26 Apr 2011 16:39:41 +0200 (CEST) In-Reply-To: <4DB67BD3.7090706@canonical.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: David Henningsson Cc: Raymond Yau , Maarten Lankhorst , ALSA Development Mailing List List-Id: alsa-devel@alsa-project.org At Tue, 26 Apr 2011 10:01:23 +0200, David Henningsson wrote: > > On 2011-04-22 01:25, Raymond Yau wrote: > > 2011/4/21 David Henningsson > > > >> Due to a round-off error, snd_pcm_avail could in some cases > >> return 0 even though more data could be written to the stream. > >> > >> This was discovered by Maarten Lankhorst [1], and there is also a test > >> program available that triggers this error [2]. > >> > >> [1] > >> https://tango.0pointer.de/pipermail/pulseaudio-discuss/2011-April/009935.html > >> > >> [2] > >> https://tango.0pointer.de/pipermail/pulseaudio-discuss/attachments/20110420/3c852d6e/attachment.c > >> > > > > if the test program can force under-run occur with "hw" device and "pulse" > > device with his patch in > > https://tango.0pointer.de/pipermail/pulseaudio-discuss/2011-April/009918.html > > > > Is it normal that underrun does not occur with the test program and your > > patch > > Yes; underruns are not reported to the application due to the risk of > the underrun being obsolete at that time. As for Maarten's patch in the > post you refer to, > > 1) if underruns are being reported (this is configurable), it might be a > good idea to call "pulse_start". > > 2) it changes underruns to being reported by default, which is what I'm > opposed to. Applied now. Thanks. Takashi