Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2997831ybt; Mon, 29 Jun 2020 12:28:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsrLKyszJQAxX7mJjmYR9L93wMjxV5kA7G3zmvduxKElD+imhUhCbScgQHv7o1/GBDDpFc X-Received: by 2002:a17:907:7245:: with SMTP id ds5mr15184067ejc.1.1593458912341; Mon, 29 Jun 2020 12:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593458912; cv=none; d=google.com; s=arc-20160816; b=CHH0feAvOvewhP+KSl3s0PegPbGRfxSrDa4XP7x2ZjSVA84vAfbwP2y/Ouk7Qp6Nkl Gm9kODSX6NUigdk/3c8Rxb9ZgKtB/kg+js0nDI6kjkn0MUIs4cWM1m346xf0Yarexbb6 868/Yx6If+HutAonnz/+9fZuUMpNBIyiPWl098Ewy3bX+7E8tfe/+2zAltG9ICiiNGRK NdzsgFhjF3eUKVnypxjFGh0PM1bAr40pR/skd7EZDIqBJsay6WQ9CBD5K4SUUI4cUkSL 4HcdWIa0O45gLK25+k0Ol5sTalIgz1nzPOGCLWUDO3Zk4nbLX5a4fRrA4txjFsIktuIT ezNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=wafQg8KNGfhiM6NnlDHPGG5ZT6Jz4CIed1ngtjh5yOM=; b=TE9WHlhkvpSQ+n+eKuNKmNbb4nFzzx6vQbsR9rvuntFUCQSgl/cuNWk1S9hURxjx80 DCBxF7Cla0So+EL7eCvV8ZvvnNAkwuE3U1Et5K6185f9rgOgZ5hzPat+ZXqn1zg8Ik+w Q1bMMYAxfceeBrH318YDm8aN5L6i7w5ZYl3a2Kxr+jcovH92l4I2nRp28ys74EHY8B3p Sg13tNYGwWt/kFn5l5yTi0k8crUWdoz4i+qE5ZPvrNHBHbz7hSSOQInrL/qhTwjTJpuM STskcUXBhQdnIudP2dH2V7/FkWrD34gCCHrr6IzsL5Yit2HZiowmIp+6V9OM+LZ8ko2P xidQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt16si443287ejc.525.2020.06.29.12.28.09; Mon, 29 Jun 2020 12:28:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732258AbgF2T2E (ORCPT + 99 others); Mon, 29 Jun 2020 15:28:04 -0400 Received: from mga14.intel.com ([192.55.52.115]:4711 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732389AbgF2T2A (ORCPT ); Mon, 29 Jun 2020 15:28:00 -0400 IronPort-SDR: axONr3dzOZxBB0FcL2BR7NmIdsILfZE04A+GUKmzHhzldvE/d5s2GLDgQi1Qo6M8v5YqjpIAks AayGYxLav09w== X-IronPort-AV: E=McAfee;i="6000,8403,9666"; a="144994055" X-IronPort-AV: E=Sophos;i="5.75,294,1589266800"; d="scan'208";a="144994055" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 02:05:54 -0700 IronPort-SDR: IHiZZ/2uBuE5q2uzoxtbPOUbIzaP7Wo9/jcAKm7ZJOpzRcmOePKvJX5Ce58yg769rkZSCPsxuC /y1DUk+xeuiQ== X-IronPort-AV: E=Sophos;i="5.75,294,1589266800"; d="scan'208";a="424751636" Received: from aslawinx-mobl1.ger.corp.intel.com (HELO [10.249.138.39]) ([10.249.138.39]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 02:05:52 -0700 Subject: Re: [PATCH v4 1/3] ALSA: compress: document the compress audio state machine To: Vinod Koul , Takashi Iwai , Jaroslav Kysela Cc: alsa-devel@alsa-project.org, Charles Keepax , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, Srinivas Kandagatla References: <20200629075002.11436-1-vkoul@kernel.org> <20200629075002.11436-2-vkoul@kernel.org> From: =?UTF-8?Q?Amadeusz_S=c5=82awi=c5=84ski?= Message-ID: Date: Mon, 29 Jun 2020 11:05:38 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200629075002.11436-2-vkoul@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/29/2020 9:50 AM, Vinod Koul wrote: > 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 > > Reviewed-by: Charles Keepax > Signed-off-by: Vinod Koul > --- > .../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() | > + | | | | > + | | | | > + | | +----------+ | > + | | | | 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 > ================ > Line containing compr_free (between SETUP and FREE) seems to be misaligned? If you move prepare to the left and drain in place of drain, it feels like you won't need this weird indirection with A Something like: >> + v >> + compr_free() +----------+ >> + +------------------------------------| | >> + | | SETUP | >> + | +------------------------>| |<-------------------------+ >> + | | compr_write() +----------+ | >> + | | ^ | >> + | | | compr_drain_notify() or | >> + | | | compr_stop() | >> + | | | | >> + | | | | >> + | | +----------+ | >> + | | | | | >> + | | | DRAIN | | >> + | | | | | >> + | | +----------+ | >> + | | ^ | >> + | | | | >> + | | | compr_drain() | >> + | | | | >> + | | | | >> + | +----------+ +----------+ | >> + | | | compr_start() | | compr_stop() | >> + | | PREPARE |------------------->| RUNNING |--------------------------+ >> + | | | | | | >> + | +----------+ +----------+ | >> + | | | ^ | >> + | | compr_free() | | | >> + | | compr_pause() | | compr_resume() | >> + | | | | | >> + | v v | | >> + | +----------+ +----------+ | >> + | | | | | compr_stop() | >> + +--->| FREE | | PAUSE |---------------------------+ >> + | | | | >> + +----------+ +----------+ >> + but this makes me question PREPARE state, how do you enter it?