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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 4474BC4363A for ; Mon, 26 Oct 2020 17:02:36 +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 7BD7A206D4 for ; Mon, 26 Oct 2020 17:02:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="oeM+elOd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BD7A206D4 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 BABEC16AD; Mon, 26 Oct 2020 18:01:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BABEC16AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1603731752; bh=vetpXnwvb01GbeboLwvkCjEedJti1xo8I1GlxsljmeA=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=oeM+elOdSsvDb9fp8bufPRprRy6ciokZ5CMLJeMztzw8pgfZNw0v1eTJms24rbJlY 87b687D/q5IHz9XfUp2TdpDehdPiq4e9TqWnB0NyfyV6h1fLdJxO3vRrlMxvCBDk6m 1tk5VCMkxCDaSdil1GGZaUUJZB4znmxaW+Zj5zDI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 42E00F801D8; Mon, 26 Oct 2020 18:01:42 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6634FF80086; Mon, 26 Oct 2020 18:01:41 +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 9D764F80086 for ; Mon, 26 Oct 2020 18:01:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9D764F80086 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 D4A33ACF5; Mon, 26 Oct 2020 17:01:33 +0000 (UTC) Date: Mon, 26 Oct 2020 18:01:33 +0100 Message-ID: From: Takashi Iwai To: "Gyeongtaek Lee" Subject: Re: [PATCH] ALSA: compress: allow pause and resume during draining In-Reply-To: <001801d6ab78$fcfe0760$f6fa1620$@samsung.com> References: <20201006062105.GQ2968@vkoul-mobl> <4bbc385b-d35a-8766-7981-034455287225@linux.intel.com> <000d01d69d58$4e2db6f0$ea8924d0$@samsung.com> <831bbfcf-9720-9100-8633-65932b415cab@perex.cz> <20201012052525.GH2968@vkoul-mobl> <20201012122423.GJ2968@vkoul-mobl> <5b26cdd5-8a15-fa26-86af-13bfbfad5341@perex.cz> <20201012135540.GK2968@vkoul-mobl> <777e0046-1e3a-e702-c070-cac4c0525ccd@perex.cz> <0afa7a39-84d5-0b9b-5453-8e7848a30bb6@perex.cz> <000001d6a2e0$8e6f4840$ab4dd8c0$@samsung.com> <001801d6ab78$fcfe0760$f6fa1620$@samsung.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, pilsun.jang@samsung.com, khw0178.kim@samsung.com, lgirdwood@gmail.com, kimty@samsung.com, tiwai@suse.com, 'Pierre-Louis Bossart' , 'Vinod Koul' , hmseo@samsung.com, s47.kang@samsung.com, tkjung@samsung.com 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 Mon, 26 Oct 2020 10:18:38 +0100, Gyeongtaek Lee wrote: > > With a stream with low bitrate, user can't pause or resume the stream > near the end of the stream because current ALSA doesn't allow it. > If the stream has very low bitrate enough to store whole stream into > the buffer, user can't do anything except stop the stream and then > restart it from the first because most of applications call draining > after sending last frame to the kernel. > If pause, resume are allowed during draining, user experience can be > enhanced. > To prevent malfunction in HW drivers which don't support pause > during draining, pause during draining will only work if HW driver > enable this feature explicitly by calling > snd_compr_use_pause_in_draining(). > > Signed-off-by: Gyeongtaek Lee > Cc: stable@vger.kernel.org Could you restart the new thread? It's been hanging too deeply and hard to read through. Since it's the revised patch, please give the revision number (v2 or such) and show what's different from the previous patches. About the changes: > +/** > + * snd_compr_use_pause_in_draining - Allow pause and resume in draining state > + * @substream: compress substream to set > + * > + * Allow pause and resume in draining state. > + * Only HW driver supports this transition can call this API. > + */ > +static inline void snd_compr_use_pause_in_draining( > + struct snd_compr_stream *substream) > +{ > + substream->device->use_pause_in_draining = true; > +} How to set the flag is an open question. A natural way would be to set it somehow at creating the component object, but currently there seems no way to pass any flags. thanks, Takashi