From alsa-devel-owner@alsa.jcu.cz  Mon Jul 27 22:51:11 1998
Received: from smtp2.xs4all.nl (smtp2.xs4all.nl [194.109.6.52])
	by marvin.jcu.cz (8.8.8/8.8.8) with ESMTP id WAA16992
	for <alsa-devel@jcu.cz>; Mon, 27 Jul 1998 22:51:10 +0200
Received: from mazur.xs4all.nl (root@mazur.xs4all.nl [194.109.83.90])
	by smtp2.xs4all.nl (8.8.8/8.8.8) with ESMTP id WAA25083
	for <alsa-devel@jcu.cz>; Mon, 27 Jul 1998 22:51:09 +0200 (CEST)
Message-ID: <XFMail.980727225147.mazur@xs4all.nl>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
In-Reply-To: <Pine.LNX.3.96.980726204041.19648E-100000@entry.jcu.cz>
Date: Mon, 27 Jul 1998 22:51:47 +0200 (MEST)
From: Stefan Linnemann <mazur@xs4all.nl>
To: alsa-devel@jcu.cz
Subject: Re: trigger functionality in ALSA
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list


On 26-Jul-98 Jaroslav Kysela wrote:
> Solution:

> Use system clock for synchronization of playback & record. ALSA should
> give to application very precise time when the playback or record was
> started and at which time will be next sample played or get from record
> stream.

> Algorithm (example):

> 1. start playback with some small silence
> 2. start record (via select)
> 3. get and compare start time and compute delay + remove some samples
>    from record stream until first playback sample will be played
> 4. after some time synchronize record & playback via status record
> 5. goto step 4.

> Problems:

> If system clock is changed, synchronization should fail :-((

> Good thing:

[snip]

> Questions/ideas?

You say "if the system clock is changed...": I'm basically a sound luser, so is
a NTP slew (minor adjustment in the millisecond area, usually), big enough to
be a problem?  If so, any host using xntp to keep the time synchronised to the
'net will not be happy with this scheme.  I'd have to check what the range of
slews are nowadays, if that information is needed.

Kind regards,
Stefan.
---
Stefan Linnemann                Work:    mazur@sara.nl
Systems programmer Unix         Private: mazur@xs4all.nl
                                http://www.xs4all.nl/~mazur/

