From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15F34C64E7B for ; Wed, 2 Dec 2020 14:32:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FA9D221FA for ; Wed, 2 Dec 2020 14:32:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FA9D221FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 321C016C5; Wed, 2 Dec 2020 15:31:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 321C016C5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1606919563; bh=ouY3rctqd+qSZ8fSC5m8ks2FJ5bzPXaSpqzeKE5jCSE=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=W2iuTaDUWmPX+RLp3tufmIBruokv7rxdihM2xIzoeQ+iv+vicPs+q1qqICjn0yv8h k/8vN+eQoT96jTOaC2LfQqF2SYbunzdlA1EL+zAO764zgQYkncnrGqGeatcbuvUsP0 10BxoYavuK3liuDKhmesgLZStiTQcq7TuhSvQcDs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 94260F80082; Wed, 2 Dec 2020 15:31:51 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A5353F8026B; Wed, 2 Dec 2020 15:31:49 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F39C4F80082 for ; Wed, 2 Dec 2020 15:31:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F39C4F80082 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4833CAD5C; Wed, 2 Dec 2020 14:31:41 +0000 (UTC) Date: Wed, 02 Dec 2020 15:31:41 +0100 Message-ID: From: Takashi Iwai To: Jonas Holmberg Subject: Re: [PATCH] pcm: set the snd_pcm_ioplug_status() tstamp field In-Reply-To: <20201105142437.GA265496@axis.com> References: <20201104134956.260519-1-jonashg@axis.com> <20201105142437.GA265496@axis.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: "alsa-devel@alsa-project.org" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Thu, 05 Nov 2020 15:24:37 +0100, Jonas Holmberg wrote: > > On Wed, Nov 04, 2020 at 02:49:56PM +0100, Jonas Holmberg wrote: > > Set the status tstamp field so that it can be accessed with > > snd_pcm_status_get_htstamp(). > > > > Signed-off-by: Jonas Holmberg > > --- > > src/pcm/pcm_ioplug.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c > > index a437ca32..9b1b8ac3 100644 > > --- a/src/pcm/pcm_ioplug.c > > +++ b/src/pcm/pcm_ioplug.c > > @@ -115,6 +115,7 @@ static int snd_pcm_ioplug_status(snd_pcm_t *pcm, snd_pcm_status_t * status) > > snd_pcm_ioplug_hw_ptr_update(pcm); > > status->state = io->data->state; > > status->trigger_tstamp = io->trigger_tstamp; > > + gettimestamp(&status->tstamp, pcm->tstamp_type); > > status->avail = snd_pcm_mmap_avail(pcm); > > status->avail_max = io->avail_max; > > return 0; > > -- > > 2.26.2 > > > > Is there a reason that the tstamp field of snd_pcm_ioplug_status() is > always 0? I assumed that it was an oversight/bug so this patch sets it > so that applications can read it with snd_pcm_status_get_htstamp(). I > have tested it and it seems to work well. I guess it's an oversight. It's one of few places where the no real hardware slave PCM is present, and the other one (null plugin) already set it. Also maybe cause snd_pcm_htimestamp() worked without this change; it's updating the timstamp with a different code path. In anyway, I applied your patch now. Thanks! Takashi