From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Monitoring ALSA's write pointer (appl_ptr)? Date: Tue, 04 Nov 2008 17:33:42 +0100 Message-ID: References: <20081103234028.PAVUM.84220.imail@fed1rmwml28> 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 F009624358 for ; Tue, 4 Nov 2008 17:33:42 +0100 (CET) In-Reply-To: <20081103234028.PAVUM.84220.imail@fed1rmwml28> 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: brian-welch@cox.net Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 3 Nov 2008 23:40:28 -0500, wrote: > > Hello List, > > My first post, so excuse any ignorance. > > Is there a definitive/safe way to monitor ALSA's write pointer in the > dma_area? It seems like the ack callback and the appl_ptr is the > correct way, but I was told by another developer that appl_ptr doesn't > work in all cases. > > As a future optimization for my hardware, I may want to tell ALSA to use > a specific area of physical memory for it's dma_area, what is the best > way to do that? A good question. The ack callback is called only when the explicit read/write method is used. When mmap access is used, it won't be called. One hack would be to check appl_ptr in the pointer callback. This callback is called in snd_pcm_hwsync(), too. So, if you watch the appl_ptr change as frequently as possible, it'd be a good place for that. Takashi