From: Takashi Iwai Subject: Re: DMA buffer gets played only once Date: Wed, 05 Sep 2007 14:55:47 +0200 Message-ID: References: <46DE4AB1.20206@hrz.tu-chemnitz.de> <1188983079.7844.1208974467@webmail.messagingengine.com> <46DE7422.5020900@hrz.tu-chemnitz.de> 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 (mail.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 71F831038AB for ; Wed, 5 Sep 2007 14:55:48 +0200 (CEST) In-Reply-To: <46DE7422.5020900@hrz.tu-chemnitz.de> 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: Markus Franke Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Wed, 05 Sep 2007 14:47:22 +0530, Markus Franke wrote: > > Clemens Ladisch wrote: > > Markus Franke wrote: > >> It seems like that after the 8th period is transferred > >> pcm_trigger(TRIGGER_STOP) isn't getting called. > > > > Indeed. The stop trigger is called when the entire stream is > > to be stopped. > > Well, start and stop trigger get always called mutually. In pseudo code > it would look like this: > > ---snip--- > TRIGGER_START > > transfer one period via DMA > > TRIGGER_STOP > > update DMAC settings in DMA transfer finished callback and call > snd_pcm_period_elapsed() > > TRIGGER_START > > transfer one period via DMA > > TRIGGER_STOP > > update DMAC settings in DMA transfer finished callback and call > snd_pcm_period_elapsed() > > ....and so on. > ---snap--- > > At least this is the behaviour I experienced. It's your mis-interpretation of START/STOP concenpt in the ALSA framework. The trigger START and STOP mean the start/stop of the whole streaming operation. It's basically called from the outside, i.e. the application starts/stops the stream. If you need to keep some DMA start/stop operations internally, do it in the driver lowlevel side internally. Takashi