From mboxrd@z Thu Jan 1 00:00:00 1970 From: Clemens Ladisch Subject: Re: snd_pcm_drain and partial periods Date: Fri, 25 Nov 2011 18:38:56 +0100 Message-ID: <4ECFD2B0.9050703@ladisch.de> References: <4ECE5206.4060408@ladisch.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by alsa0.perex.cz (Postfix) with ESMTP id 7BA26103EEC for ; Fri, 25 Nov 2011 18:38:02 +0100 (CET) Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 21CE5202E2 for ; Fri, 25 Nov 2011 12:37:59 -0500 (EST) 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: Trent Piepho Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org Trent Piepho wrote: > When the driver schedules the final period, couldn't it check if the > device is draining, and if so try to end playback at the right time. The ALSA framework was designed for cards where DMA doesn't need to be scheduled continuously, so it is assumed that stopping happens asynchronously. You could try to check the PCM state, but it's possible that the call to snd_pcm_drain() happens after you've scheduled the final period. Regards, Clemens