Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2776561ybt; Mon, 22 Jun 2020 06:48:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd5tAj0Ciw6A/3r2W5+kD9tTiKUoNKPsCo9ck0X0X7+Wnh3zq7Dv7j8IMN4IUC/9PimWv5 X-Received: by 2002:a17:906:5e06:: with SMTP id n6mr15367137eju.504.1592833732392; Mon, 22 Jun 2020 06:48:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592833732; cv=none; d=google.com; s=arc-20160816; b=dBjXVfKa9PjDqcO1sY744VxU9sO6o+l7lg6LXVgkjMXXYlPb7xrfXdNKXRvV35zr/o zXe+ALyhz/RSZMpcDm24O8UE+7BIg3zb0HQM00V0zHMesry4MMPT0RO275n5NQFuevhz VD7Wb7cE7QSc31pLqRNzsayq5IHqsaqtggs5Ytsav4pHAWduHLCIB4ZL1xlU091kWLOo 2N/fpkGohsJUTS83DnMxqXqIxozXhwi2quEBwD427CxO/RBZXQSHsSUQ7KxIK5+ZcGAn 6ftyAhGZRgPy3e4IrWojtpBbG4py+y1wZctvLDqIOQBukSRawwECqYqQkPKR2O3B08HA 5JRw== 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=+uR7dEh0aYZYyn9mIuIUtAetal9wtCFAbxtHPxsim0k=; b=lRmsHPq4z3Rsg+vdTuMCd+aAUfj70RdZvc3r6tRy0jMQu5tJyvAc2iJNboYZXXSg6X OHx5pxqwApt1TDRDJwwLRJjyjPyd7WeExtp+RrsST5Que9ft/UOYGwMluRDTbOe/eKPd gvLF0I7SC79Jyz95t1/4cC5HVZDiGXx6PfW+0rirWp89Bpz1dXJytuhYIWPvkLXpYpfY /r/SMur2zTMcJbb09JJzKzxdJZgmu1ylRgUiat1x6qJYlArcTTOBpJwxQvVecl6LHbwJ LH85scA8c9D7Fh0R3tL0dxVny/ndSe1d6qFbniYCLT9QMQEyuW8cTnc1ZSGktD0pGF5i 5k9w== 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 g8si9230826ejo.221.2020.06.22.06.48.28; Mon, 22 Jun 2020 06:48:52 -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 S1728972AbgFVNqp (ORCPT + 99 others); Mon, 22 Jun 2020 09:46:45 -0400 Received: from mga09.intel.com ([134.134.136.24]:29044 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728449AbgFVNqp (ORCPT ); Mon, 22 Jun 2020 09:46:45 -0400 IronPort-SDR: ZoVnyPNsPsyW885V0cjoi4K1ureypVgEC+PZk1q3tzpwLV6gN78e5369MxBhUxkLi6clczgINv qQNAmG7tfn/w== X-IronPort-AV: E=McAfee;i="6000,8403,9659"; a="145269603" X-IronPort-AV: E=Sophos;i="5.75,267,1589266800"; d="scan'208";a="145269603" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 06:46:44 -0700 IronPort-SDR: dKvK79inM4zSyJRZ2y4dBvRyTrKxultGjoc1LegHMIjo5FMhForkLdK7G7mqNZbzCgxwofb1wm vSlRraV+aGDg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,267,1589266800"; d="scan'208";a="262971334" Received: from agsoto-mobl.amr.corp.intel.com (HELO [10.251.3.142]) ([10.251.3.142]) by fmsmga007.fm.intel.com with ESMTP; 22 Jun 2020 06:46:43 -0700 Subject: Re: [PATCH v2 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 , linux-arm-msm@vger.kernel.org, Bjorn Andersson , Srinivas Kandagatla , linux-kernel@vger.kernel.org References: <20200622065811.221485-1-vkoul@kernel.org> <20200622065811.221485-2-vkoul@kernel.org> From: Pierre-Louis Bossart Message-ID: <800a2632-b263-500f-707e-c1ce94ce92d4@linux.intel.com> Date: Mon, 22 Jun 2020 08:28:48 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200622065811.221485-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/22/20 1:58 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 > > Signed-off-by: Vinod Koul > --- > .../sound/designs/compress-offload.rst | 52 +++++++++++++++++++ > 1 file changed, 52 insertions(+) > > diff --git a/Documentation/sound/designs/compress-offload.rst b/Documentation/sound/designs/compress-offload.rst > index ad4bfbdacc83..6f86db82298b 100644 > --- a/Documentation/sound/designs/compress-offload.rst > +++ b/Documentation/sound/designs/compress-offload.rst > @@ -151,6 +151,58 @@ 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() +----------+ | > + | | | | > + | | | | > + | | | compr_write() | > + | | | | > + | | v | > + | | +----------+ | > + | | | | | > + | | | PREPARE | | > + | | | | | > + | | +----------+ | > + | | | | > + | | | | > + | | | compr_start() | > + | | | | > + | | v | > + | +----------+ +----------+ compr_pause() +----------+ | > + | | | compr_drain() | |---------------->| | | > + | | DRAIN |<-------------------| RUNNING | | PAUSE | | > + | | | | |<----------------| | | > + | +----------+ +----------+ compr_resume() +----------+ | > + | | | | | > + | | | | | > + | | | | | > + | | | | compr_stop() | > + | | | +------------------------------------+ > + | | +----------+ | > + | | | | | > + +-----------+------>| |<-------+ > + compr_free() | FREE | compr_free() > + | | > + +----------+ > + Sorry, this confuses me even more... a) can you clarify if we can go from running to free directly? is this really a legit transition? There's already the option of doing a stop and a a drain. b) no way to go back to SETUP from PREPARE? What happens if the app never starts but want to tear down the resources? c) no way to stop a paused stream?