From patchwork Thu Jun 25 15:46:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 11625665 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDED660D for ; Thu, 25 Jun 2020 16:27:53 +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 73BE1204EA for ; Thu, 25 Jun 2020 16:27:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="gGpJdLmq"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="vBvmjOSi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73BE1204EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 070941924; Thu, 25 Jun 2020 18:27:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 070941924 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1593102472; bh=L9ED3CmPmrCq6aX9512m6F+JVxfMbMf1Yg5lgmCu1Dc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gGpJdLmq5PZN694tOGz4SK20L8iDs5LpVEgGPhWyl8Spx1ZPv3WfCddbm+8QES9de jFfcZnHFTmg0Uh6hFUGlSiOxIBcI8y5W8935cFMSuVi/hfBM3k3lzoQc9TxpylEreU z26G8W9DgtwMjD3IGXABM3hweKe5IzLlRzN2G0qU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 33462F800B2; Thu, 25 Jun 2020 18:25:28 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3E800F80277; Thu, 25 Jun 2020 18:25:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E54D2F80137 for ; Thu, 25 Jun 2020 18:25:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E54D2F80137 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="vBvmjOSi" Received: from localhost.localdomain (unknown [171.61.66.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D198A2081A; Thu, 25 Jun 2020 15:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593100028; bh=L9ED3CmPmrCq6aX9512m6F+JVxfMbMf1Yg5lgmCu1Dc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vBvmjOSiGpHUKSnl9WcOnpYbcnN0Jt2U3/xWMuaG9IbOSiOusHErTQPD0+0SCy10f gMO56qo/BsGaIQ0P3597NMz4p9qC+KPD0RAMXEiGWhLcGn+3ZzGDpDXkpNJa0IcGBy YuQ+23VJM6VXNy+cY6WR118g8yiYygJcCu6k7ygU= From: Vinod Koul To: Takashi Iwai , Jaroslav Kysela Subject: [PATCH v3 1/3] ALSA: compress: document the compress audio state machine Date: Thu, 25 Jun 2020 21:16:49 +0530 Message-Id: <20200625154651.99758-2-vkoul@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200625154651.99758-1-vkoul@kernel.org> References: <20200625154651.99758-1-vkoul@kernel.org> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Charles Keepax , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, Vinod Koul , Srinivas Kandagatla 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" So we had some discussions of the stream states, so I thought it is a good idea to document the state transitions, so add it documentation Signed-off-by: Vinod Koul Reviewed-by: Charles Keepax --- .../sound/designs/compress-offload.rst | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/Documentation/sound/designs/compress-offload.rst b/Documentation/sound/designs/compress-offload.rst index ad4bfbdacc83..b6e9025ae105 100644 --- a/Documentation/sound/designs/compress-offload.rst +++ b/Documentation/sound/designs/compress-offload.rst @@ -151,6 +151,57 @@ Modifications include: - Addition of encoding options when required (derived from OpenMAX IL) - Addition of rateControlSupported (missing in OpenMAX AL) +State Machine +============= + +The compressed audio stream state machine is described below :: + + +----------+ + | | + | OPEN | + | | + +----------+ + | + | + | compr_set_params() + | + v + compr_free() +----------+ + +------------------------------------| | + | | SETUP | + | +------------------------>| |<-------------------------+ + | | compr_drain_notify() +----------+ | + | | or | | + | | compr_stop() | | + | | | compr_write() | + | | | | + | | v | + | | +----------+ | + | | | | compr_free() | + | | | PREPARE |---------------> A | + | | | | | + | | +----------+ | + | | | | + | | | | + | | | compr_start() | + | | | | + | | v | + | +----------+ +----------+ | + | | | compr_drain() | | compr_stop() | + | | DRAIN |<-------------------| RUNNING |--------------------------+ + | | | | | | + | +----------+ +----------+ | + | | ^ | + | A | | | + | | compr_pause() | | compr_resume() | + | | | | | + | v v | | + | +----------+ +----------+ | + | | | | | compr_stop() | + +--->| FREE | | PAUSE |---------------------------+ + | | | | + +----------+ +----------+ + Gapless Playback ================