From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: pointer callback question Date: Thu, 12 Feb 2009 18:54:40 +0100 Message-ID: References: <49946175.5070008@klingt.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id DE4511037F0 for ; Thu, 12 Feb 2009 18:54:40 +0100 (CET) In-Reply-To: <49946175.5070008@klingt.org> 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: Tim Blechmann Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 12 Feb 2009 18:50:45 +0100, Tim Blechmann wrote: > = > hi all, > = > one question about the pointer callback. > = > the docs say: > > This callback is called when the PCM middle layer inquires the current > > hardware position on the buffer. The position must be returned in > frames, > > ranging from 0 to buffer_size - 1. > = > i am using a ringbuffer to communicate with my audio device. but when > the position is reset to 0, alsa requests to stop the stream > (SNDRV_PCM_TRIGGER_STOP). > = > the brief log is (4 periods of 64 frames): > stream_pointer at 64 > stream_pointer at 128 > stream_pointer at 192 > stream_pointer at 256 This is invalid. The pointer callback must return 0 in this case. The value the pointer callback returns is between 0 and buffer_size-1. Takashi > stream_pointer at 0 > = > after returning 0, a stop is requested. > = > am i missing something? > thanks, tim > = > -- = > tim@klingt.org > http://tim.klingt.org > = > Contrary to general belief, an artist is never ahead of his time but > most people are far behind theirs. > Edgar Var=E8se > =