From: Anuj Aggarwal Subject: Re: Application supporting forward/rewind APIs Date: Tue, 29 Sep 2009 14:43:58 +0530 Message-ID: <2ee9e08d0909290213r3ca53b6cq5909bcf79752a26c@mail.gmail.com> References: <2ee9e08d0909240034t6fdab6aftc24e733621638f09@mail.gmail.com> <4f3252890909240057l1a2b5b88m861dea551f69afce@mail.gmail.com> <2ee9e08d0909240201l5cf5675m111b6da1434cff60@mail.gmail.com> <4f3252890909252059t3d8cc2aaqffc880991d148e56@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-yx0-f196.google.com (mail-yx0-f196.google.com [209.85.210.196]) by alsa0.perex.cz (Postfix) with ESMTP id 8D563103817 for ; Tue, 29 Sep 2009 11:14:19 +0200 (CEST) Received: by yxe34 with SMTP id 34so5627926yxe.16 for ; Tue, 29 Sep 2009 02:14:18 -0700 (PDT) In-Reply-To: <4f3252890909252059t3d8cc2aaqffc880991d148e56@mail.gmail.com> 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: Raymond Yau Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org I found the solution, one can use mplayer to test forward/rewind feature of ALSA library. Regards, Anuj Aggarwal On Sat, Sep 26, 2009 at 9:29 AM, Raymond Yau wrote: > It seem that the current implementation , it seem that the application can > rewind the application pointer to hardware pointer , rewrite the next > sample.for all drivers > > > =A0static snd_pcm_sframes_t snd_pcm_hw_rewindable(snd_pcm_t *pcm) > { > =A0 =A0return snd_pcm_mmap_hw_avail(pcm); > } > > However this is almost impossible for any sound cards since the hardware > register just report the number of samples processed. this mean that the > sound card is already processing the next sample. > > > > > 2009/9/24 Anuj Aggarwal > >> Yeah, I am looking for some sample application to test forward/rewind >> functionality. >> >> Regards, >> Anuj >> >> On Thu, Sep 24, 2009 at 1:27 PM, Raymond Yau >> wrote: >> > Do you mean that there is no test program to verify the implementation= is >> > correct ? >> > >> > Some sound card 's hardware has FIFO buffer. >> > >> > For example , au88x0 >> > >> > according to patent 6167465 >> > >> > Additionally, a first-in-first-out (FIFO) buffer is established for the >> DMA >> > channel. Then a DMA request is generated in order to begin filling the >> FIFO >> > buffer with data from the first data segment 150(0) using the informat= ion >> > provided by CPU 210. >> > >> > >> > The FIFO buffer may be any suitable size capable of handling bus >> latencies >> > while small enough such that the memory requirement is not overly >> > burdensome. In one embodiment of the present invention, the FIFO buffer >> is >> > 32 samples or words in depth, which would withstand a maximum bus late= ncy >> of >> > about 4 microseconds. By way of example, if 48 DMA channels trigger >> > simultaneously, with a trigger level set at half the buffer size (16 >> > samples), each DMA channel can wait 16 samples (20 microseconds per >> sample), >> > or approximately 320 microseconds before running out of data. >> > >> > >> > It seem that alsa-lib should not allow application to rewind the >> application >> > pointer to hardware pointer since you cannot write the next sample >> because >> > of FIFO buffer even using mmap read/write >> > >> > or bug in *snd_pcm_rewindable() ?* >> > >> > >> > 2009/9/24 Takashi Iwai >> > >> >> At Thu, 24 Sep 2009 13:04:24 +0530, >> >> Anuj Aggarwal wrote: >> >> > >> >> > Hi, >> >> > >> >> > I want to try the forward/rewind APIs supported by the ALSA library. >> >> > Can someone point to an ALSA application which exercises these APIs? >> >> >> >> Pulseaudio is using snd_pcm_rewind(). >> >> About snd_pcm_forward(), I don't know of... >> >> >> >> >> >> Takashi >> >> _______________________________________________ >> >> Alsa-devel mailing list >> >> Alsa-devel@alsa-project.org >> >> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >> >> >> > _______________________________________________ >> > Alsa-devel mailing list >> > Alsa-devel@alsa-project.org >> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >> > >> >> >> >> -- >> Best Regards, >> Anuj Aggarwal >> > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel > -- = Best Regards, Anuj Aggarwal