From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Courtier-Dutton Subject: Re: Re: Audio and Video sync. Getting Timestamps Date: Fri, 07 May 2004 11:52:11 +0000 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: <409B786B.3050607@superbug.demon.co.uk> References: <1083748400.4098b030eeb58@www.telecable.es> <002501c433c2$70a06b90$a6b06153@palmian> <409AD205.1010900@superbug.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: =?ISO-8859-1?Q?M=E5ns_Rullg=E5rd?= Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Måns Rullgård wrote: > James Courtier-Dutton writes: > > The OP was recording. > Oops. My explanation only covers playback, not capture. But if you use the snd_pcm_avail_update() just before you capture some samples from the buffer, then do a gettimeofday(), you will get an accurate measure of when the samples arrived in the buffer. If you also use a thread and get it to do poll(), you could also keep the latency down, with it calling the routine on each period elapsed. Summary: Use a method similar to the playback method, but just modify it a be for record. Cheers James ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3