From: Takashi Iwai Subject: Re: my driver can't reproduce continuously Date: Mon, 27 Jul 2009 08:17:49 +0200 Message-ID: References: <20090723100640.GB25013@sirena.org.uk> 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 216E7244DD for ; Mon, 27 Jul 2009 08:17:49 +0200 (CEST) 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: Kuninori Morimoto Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 27 Jul 2009 09:58:19 +0900, Kuninori Morimoto wrote: > > > Dear Takashi > > Thank you for your comment > > > My rough guess is that your pointer callback returns a wrong value. > > The pointer callback is supposed to give the currently played position > > offset in a ring buffer, and ranged from 0 to buffer_size-1. > > When the first snd_pcm_period_elapsed() is called, it should be > > (ideally) pointing at period_size, at the succeeding calls, > > period_size*2, period_size*3, then 0 again. > > The criminal is my wrong understanding... > OK. > > But I still have trouble now. > > follows the log > ------------ > trigger called > hw_prt_base = 0, hw_prt = 127, appl_prt = 8192 > hw_prt_base = 0, hw_prt = 255, appl_prt = 8319 > (snip) > hw_prt_base = 0, hw_prt = 3845, appl_prt = 11888 > hw_prt_base = 0, hw_prt = 3995, appl_prt = 12037 > call elapsed // 2nd call > hw_prt_base = 0, hw_prt = 4123, appl_prt = 12037 > hw_prt_base = 0, hw_prt = 4272, appl_prt = 12187 > call elapsed // 3rd call > hw_prt_base = 0, hw_prt = 6202, appl_prt = 12288 > call elapsed // 4th call > hw_prt_base = 8192, hw_prt = 8192, appl_prt = 12288 > <<< driver stopped here... >> > ------------ > > when 1st buffer was send, > driver stop. > 2nd trigger function isn't called. Check the raw value returned from the pointer callback, too. This can be the real cause. Takashi