From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lennart Poettering Subject: Re: snd_pcm_status_get_tstamp() Date: Mon, 7 Jan 2008 16:21:55 +0100 Message-ID: <20080107152155.GC14386@tango.0pointer.de> References: <20071231165340.GA17734@tango.0pointer.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from tango.0pointer.de (tango.0pointer.de [85.214.72.216]) by alsa0.perex.cz (Postfix) with ESMTP id 34D2E24932 for ; Mon, 7 Jan 2008 16:21:57 +0100 (CET) Content-Disposition: inline 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: Takashi Iwai Cc: ALSA Development Mailing List List-Id: alsa-devel@alsa-project.org On Mon, 07.01.08 12:10, Takashi Iwai (tiwai@suse.de) wrote: > > The documentation for snd_pcm_status_get_tstamp() is not really > > enlightening. After a call to snd_pcm_status() what data does the > > tstamp field actually carry? Some kind of system clock timestamp when > > the data in the status struct was valid, or some kind of sound card > > clock timestamp that is relative to the point in time where the device > > was opened/started? > > In the normal mode, it's the timestamp at the moment snd_pcm_status() > is processed. OTOH, the trigger_tstamp is the time that the trigger > callback was called (e.g. the stream starts / stops). > The time is the system-wide time, equivalent with the normal > gettimeofday(). So I figure this is always CLOCK_REALTIME? I am currently using CLOCK_MONOTONIC for most timekeeping in PulseAudio. Would it be possible to add an API to ALSA to allow getting those timestamps in CLOCK_MONOTONIC instead of CLOCK_REALTIME? Maybe by adding two new time stamp modes, changeble via snd_pcm_sw_params_set_tstamp_mode()? Also, may I suggest to add the explanation you wrote above to the doxygen docs? Thanks, Lennart -- Lennart Poettering Red Hat, Inc. lennart [at] poettering [dot] net ICQ# 11060553 http://0pointer.net/lennart/ GnuPG 0x1A015CC4