From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Clemens Ladisch" Subject: Re: Broken playback Date: Wed, 21 Nov 2007 16:28:27 +0100 Message-ID: <1195658907.11141.1222567701@webmail.messagingengine.com> References: <1195644962.10939.1222529331@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by alsa0.perex.cz (Postfix) with ESMTP id CAB0E24C56 for ; Wed, 21 Nov 2007 16:28:28 +0100 (CET) Content-Disposition: inline In-Reply-To: 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: Gabriele Melia Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org Gabriele Melia wrote: > i have already tried to read and decode some data in order to accumulate > 1 second of data to prevent broken audio, > but nothing change, analysing the issue i have found that broken audio > comes when the snd_pcm_writei is called with a size that is 5000. So it > takes time to dispach all this size. Try non-blocking mode (see the snd_pcm_nonblock function). In non- blocking mode, the writei call will only write as much data as can be written without waiting (or returns -EAGAIN if the buffer is already full at the moment). HTH Clemens