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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5F186C54EBC for ; Thu, 12 Jan 2023 11:16:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4EF0E713A; Thu, 12 Jan 2023 12:15:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4EF0E713A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1673522190; bh=xu67CKRYcIeWxPWa6uuAhl4U1ci6zO82QrjSgqyRjeE=; h=Date:From:To:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=V359I+vqBwK4HsEfw/T63CmuXFGESydGPPV83ylhp6MzlFIPLd530dt6vARwRZrOP pmzKgaKsE+tlyn9rvn5Y6BozrG59kZYuZipjdem0xeikUw9m2tAAJYc9TpeZSR/eta jfrd5xHa18pNYxw4cJDoyfhXfBaI6g1GdPLJyWYI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D6312F804BD; Thu, 12 Jan 2023 12:15:39 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E6200F804C1; Thu, 12 Jan 2023 12:15:38 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 08233F8013D for ; Thu, 12 Jan 2023 12:15:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 08233F8013D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=F8IHt4AY; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=T0sEUhdO Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2530D3FC8F; Thu, 12 Jan 2023 11:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1673522136; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6cNCT0QTgoQmto8fANglKfkjFp5jf/v47qI+q2qRbSw=; b=F8IHt4AYUdEbemFHCHOpMuNufXOX3OLKdg4WgGXOlni2lVUcdUGKHByl32fbG7EwjSijgY vOEE8+C7p8DW1JxTlh10Nae1KL3rkv1s1XJrUsdphUNsZg5LRI559bJHzAPJAKXYHBcowW vItueh59Z+DOijHaAuP+VT+8vFGTHC8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1673522136; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6cNCT0QTgoQmto8fANglKfkjFp5jf/v47qI+q2qRbSw=; b=T0sEUhdOxqT4SAdh74q7ccTACsCogImCyKmNKcqmKkfRufW+V5rMaX9qxsOd9T96bEGwcL OXbMmqBOGHF9yKDg== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 04FB813958; Thu, 12 Jan 2023 11:15:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id znVvANjrv2NaRAAAGKfGzw (envelope-from ); Thu, 12 Jan 2023 11:15:36 +0000 Date: Thu, 12 Jan 2023 12:15:35 +0100 Message-ID: <87h6ww6m20.wl-tiwai@suse.de> From: Takashi Iwai To: Takashi Sakamoto Subject: Re: [PATCH 0/3] ALSA: firewire-lib: report extra delay of PCM runtime In-Reply-To: <20230110134933.322794-1-o-takashi@sakamocchi.jp> References: <20230110134933.322794-1-o-takashi@sakamocchi.jp> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: alsa-devel@alsa-project.org, clemens@ladisch.de Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 10 Jan 2023 14:49:30 +0100, Takashi Sakamoto wrote: > > For reasons, all drivers in ALSA firewire stack have never reported extra > delay for the runtime of PCM substream. The main reason is that the > meaning of extra delay differs depending on driver design. Another > technical reason is that no kernel API was provided to know the current > hardware time. > > I realized that the extra delay is helpful to user space PCM applications > in the case of packet-oriented drivers since the drivers have a gap > between the current transmission cycle and the latest transmission cycle > to which the packet is processed (for PCM capture) or scheduled (for PCM > playback). The amount of PCM frames delivered during the gap is usually > invisible from the application as is in reported delay. > > A commit baa914cd81f5 ("firewire: add kernel API to access CYCLE_TIME > register") was already merged into Linux kernel v5.19 or later, and the > unit drivers can read hardware time and calculate the current isochronous > cycle. Moreover, a commit f0117128879b ("ALSA: firewire-lib: keep history > to process isochronous packet") enables to keep the recent history of > packets, including cycle count and data block count. > > It is ready at last. This patchset adds computation of the extra delay. > > Takashi Sakamoto (3): > ALSA: firewire-lib: move parameter for pcm frame multiplier from > context payload processing layer > ALSA: firewire-lib: obsolete return value from context payload > processing layer > ALSA: firewire-lib: compute extra delay for runtime of PCM substream Thanks, applied now. Takashi