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=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 620CDC63697 for ; Thu, 26 Nov 2020 12:36:02 +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 E3D1C20DD4 for ; Thu, 26 Nov 2020 12:35:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="ZI4zxvN7"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Vsu9iMem" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3D1C20DD4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com 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 5196217BA; Thu, 26 Nov 2020 13:35:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5196217BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1606394157; bh=sNY/so2lf9CzsoHjVsJs3vxsBksPAtotlP+e5fBBlzA=; h=From:To:Subject:Date:References:Cc:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From; b=ZI4zxvN72C0hkJqQ4Stl+6hPI8yIsKaXfBs9Ns0JfdBi7X/XEcaNTY4ryFgtJ8Y8g bhemaTZ1swc3Vs1ajryvcxK4qaqN3CrJmk5JXBPSQhU7t+6viZJYyOsV7ro/rEKR5e 94TDua2NWKGtqCQPSig/9rJd1v/q7MPA38J/BVP4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B4AA0F80164; Thu, 26 Nov 2020 13:35:06 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 22BF5F80165; Thu, 26 Nov 2020 13:35:04 +0100 (CET) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6EA1FF80128 for ; Thu, 26 Nov 2020 13:34:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6EA1FF80128 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Vsu9iMem" Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20201126123444epoutp028810ac689825e2e57fee936bf7f45616~LDuiRwnQs2331323313epoutp02M for ; Thu, 26 Nov 2020 12:34:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20201126123444epoutp028810ac689825e2e57fee936bf7f45616~LDuiRwnQs2331323313epoutp02M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1606394084; bh=a3IycIHgDlNF/3I0Sh0LSCcWupf0A7rGm8jrAGxrAA8=; h=From:To:Cc:Subject:Date:References:From; b=Vsu9iMemy9I5IGCEn4Ex5Y0P+xJKh4IfLYsE4JMDLwNEi3Q/RQ64eHl/YlC5wHBTB 77/a6vEYXOhCUHfka8nERCZtHExD7jqyBuvA/qCYEV8EfuvLUJ1xOVRlbvZxTjaxPP djYul1RRh+Hsu/61AN2DrkgN0as7eq7bEckgNTZ8= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20201126123442epcas2p24ebadf0cbec68388cdb2d19c1b2ff5e6~LDuhCscYu1670816708epcas2p2L; Thu, 26 Nov 2020 12:34:42 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.190]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4Chcds4WQqzMqYkZ; Thu, 26 Nov 2020 12:34:41 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 03.06.56312.1E0AFBF5; Thu, 26 Nov 2020 21:34:41 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20201126123440epcas2p3f38035952f571b3be7e86225dc5a2745~LDuedGaMt0958509585epcas2p3Y; Thu, 26 Nov 2020 12:34:40 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201126123439epsmtrp20aa70b7df2c96f3cb2feea4483379184~LDueZY3SA0679306793epsmtrp2z; Thu, 26 Nov 2020 12:34:39 +0000 (GMT) X-AuditID: b6c32a46-1d9ff7000000dbf8-bd-5fbfa0e1d002 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 2E.ED.13470.FD0AFBF5; Thu, 26 Nov 2020 21:34:39 +0900 (KST) Received: from KORDO025540 (unknown [12.36.182.130]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201126123439epsmtip22f47600451ac8777b996caf626724fa9~LDueGQlmH0561305613epsmtip2P; Thu, 26 Nov 2020 12:34:39 +0000 (GMT) From: "Gyeongtaek Lee" To: "'Vinod Koul'" Subject: [PATCH v3 0/1] ALSA: compress: allow pause and resume during draining Date: Thu, 26 Nov 2020 21:34:39 +0900 Message-ID: <000001d6c3f0$82250580$866f1080$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdbD7inK7M1ppD6oQROJKVAjHlS2fQ== Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHJsWRmVeSWpSXmKPExsWy7bCmqe7DBfvjDaYdlrW4cvEQk8XdH+YW M7Z1s1g03pvAZrH66hYmi29XOpgsfv1/xmRx9OJiJouGu83sFhu+r2W0eLn5DZPFkcYpTBY7 75xgduD12PC5ic1j56y77B6bVnWyecw7GejRt2UVo8f6LVdZPDafrg5gj8qxyUhNTEktUkjN S85PycxLt1XyDo53jjc1MzDUNbS0MFdSyEvMTbVVcvEJ0HXLzAE6VkmhLDGnFCgUkFhcrKRv Z1OUX1qSqpCRX1xiq5RakJJTYGhYoFecmFtcmpeul5yfa2VoYGBkClSZkJOxeN4ploKfohX9 8/4yNTD+EOxi5OSQEDCR2Ph8B0sXIxeHkMAORon9z5czQTifGCV2du6Hcr4xSjw53ckI0/L6 7mo2iMReRok1X9dA9b9klHjfOY8ZpIpNQFfiy707YLaIgKrElicPwDqYBe4xSTS+eMsEkhAW CJDY2nMcyObgYAEqetggDBLmFbCUWLv1CzOELShxcuYTFhCbWUBeYvvbOcwQVyhI/Hy6jBVi vp7E1JafzBA1IhKzO9uYQXZJCGzhkDgx4wIbRIOLxOwpD1ghbGGJV8e3sEPYUhKf3+1lg2ho ZpR4d/YPVGIKo0RntxCEbSyxZe4psEOZBTQl1u/SBzElBJQljtyCuo1PouPwX3aIMK9ERxtU o5LExlP/mCDCEhLzNkDN9pA4uWQ26wRGxVlInpyF5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WGeanl esWJucWleel6yfm5mxjBEaaluYNx+6oPeocYmTgYDzFKcDArifC6C++NF+JNSaysSi3Kjy8q zUktPsQozcGiJM57o3BhnJBAemJJanZqakFqEUyWiYNTqoEp+MOLL5cshJj//2O9HczJklxy 4LRibNv5jT7reQSmyakLhESeL5RXSr/z/2yA4PfChd+/2K64UBt91Kxf4t+zCTHmnxw3fXwa /XSG+jbG+OpNi0rMJx95eEHpovtzpRmvGnV+WCiXJif//tu0m8fT2djcrCn1aPglUde7okFH RaQvM0/YsO6UTfcXodlrGQ+Lu2jZRMZHpS1NUePt3es+efb6ItFDk5xuZAj/Lok4GRfhtsZz zg1VXzFtvr8Lqk7LvVA7dPHmpEylqRZpZxa/to7ePP3bg+r/B1ZWn+L/yFWoN/tQvdOqnvMf V6tOObLlzkndeQd84ytaLBKP/nrD93Ijm28Ew+6+nW5Suh/ilViKMxINtZiLihMBDEfzzx8D AAA= X-CMS-MailID: 20201126123440epcas2p3f38035952f571b3be7e86225dc5a2745 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201126123440epcas2p3f38035952f571b3be7e86225dc5a2745 References: Cc: alsa-devel@alsa-project.org, khw0178.kim@samsung.com, lgirdwood@gmail.com, 'Takashi Iwai' , 'Pierre-Louis Bossart' , tiwai@suse.com, kimty@samsung.com, donggyun.ko@samsung.com, hmseo@samsung.com, s47.kang@samsung.com, pilsun.jang@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 Wed, 25 Nov 2020 16:28:05 +0530, Vinod Koul wrote: >On 27-10-20, 10:57, Gyeongtaek Lee wrote: >> diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c >> index 0e53f6f31916..a071485383ed 100644 >> --- a/sound/core/compress_offload.c >> +++ b/sound/core/compress_offload.c >> @@ -708,11 +708,24 @@ static int snd_compr_pause(struct snd_compr_stream *stream) >> { >> int retval; >> >> - if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING) >> + switch (stream->runtime->state) { >> + case SNDRV_PCM_STATE_RUNNING: >> + retval = stream->ops->trigger(stream, >> + SNDRV_PCM_TRIGGER_PAUSE_PUSH); > >this seems to fit single line with new 100char limit and makes it a >better read, can we please do that here and few places below .. The line >split is making it look bit ugly IMO > >> + if (!retval) >> + stream->runtime->state = SNDRV_PCM_STATE_PAUSED; >> + break; >> + case SNDRV_PCM_STATE_DRAINING: >> + if (!stream->device->use_pause_in_draining) >> + return -EPERM; > >I am expecting patches to tinycompress to handle pause while drain. Esp >this case.. > >> + retval = stream->ops->trigger(stream, >> + SNDRV_PCM_TRIGGER_PAUSE_PUSH); >> + if (!retval) >> + stream->pause_in_draining = true; >> + break; >> + default: >> return -EPERM; >> - retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH); >> - if (!retval) >> - stream->runtime->state = SNDRV_PCM_STATE_PAUSED; >> + } >> return retval; >> } >> >> @@ -720,11 +733,25 @@ static int snd_compr_resume(struct snd_compr_stream *stream) >> { >> int retval; >> >> - if (stream->runtime->state != SNDRV_PCM_STATE_PAUSED) >> + switch (stream->runtime->state) { >> + case SNDRV_PCM_STATE_PAUSED: >> + retval = stream->ops->trigger(stream, >> + SNDRV_PCM_TRIGGER_PAUSE_RELEASE); >> + if (!retval) >> + stream->runtime->state = SNDRV_PCM_STATE_RUNNING; >> + break; >> + case SNDRV_PCM_STATE_DRAINING: >> + if (!stream->device->use_pause_in_draining || >> + !stream->pause_in_draining) >> + return -EPERM; > >does this condition make sense for resume part..? We have already >checked for this while going into pause. I am not expecting drain state >to change while we are paused :) > I have fixed the patch as your review comment and send version 3. For your comment about tinycompress, I'll try to make a patch after study about tinycompress. Thanks, Gyeongtaek Gyeongtaek Lee (1): ALSA: compress: allow pause and resume during draining include/sound/compress_driver.h | 16 ++++++++++++++ sound/core/compress_offload.c | 39 ++++++++++++++++++++++++++------- 2 files changed, 47 insertions(+), 8 deletions(-) base-commit: 418baf2c28f3473039f2f7377760bd8f6897ae18 -- 2.21.0