Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1668870ybt; Thu, 25 Jun 2020 11:13:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ/gSw+qeIbUae/88XSlSQMSTXJqXCvac4QX8ZNzggmhJuJO0zMqR2A6Y21fDFR2ock0zb X-Received: by 2002:a17:906:5799:: with SMTP id k25mr11395638ejq.540.1593108823343; Thu, 25 Jun 2020 11:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593108823; cv=none; d=google.com; s=arc-20160816; b=IdXOA7M7q/VBFSqWfNmVWM4GBj6Ob4RY3htxi85UOkkaTc/SXTlJR9Z7Y1jBHsEI5e QpgsptBHC+nA1Lx1Gh9LFsNZf10Pgk+9k1Ixz+qfdEbUaEjHho4MWw/Mp93QDgXvnaOI XN+g8cLWFncAisJ5ZNYF6l1tSpj+7KZOWCx4PWN6M+CzSmq0xlVNea/+IeZoymJWoWDT SY0bAoeoW6sRWoiKasnc7/H04rrvbSHLWH1Khd6h7CVefoVEHiGGYJl+umjbz8SWJAZB /qKXlmpsOG0p2qhQ8u32+FdhU4WhVVhVtCckeamQMdgr9L0LLVmdNkD60LynAhskS+Vb iDfA== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=gSKeyD8xmJ+tVqiLqYsBNVQNj1P3VQgQOUE5Z0kXp4s=; b=fs09U/s2HPbYlb5C09S7ImGsSyGEf+9SUOFgakbjIxRou7HYf/dieKVcPl80kO2SVC SvrumJAl5E57nJoliGll+i9sHtkCLipsB6EC3uiaFb6wLIGbdECEDYaLGyWPPNEWWKEQ cMeBGWgGdtHC9Lywl7VVssSs4DVMdHh1H5GGhpNpf85Gl0A0PaeZf5AVkyESrX/7XOo3 REGK6as447uo5TWD8BKRBTJNers83z5xsKyGGyv6DuglkgAluBxKeujlEdi+tymr9EMh DX8btF4g5CuTd/n5pNEw+KB7omlR+VxBuob8W5OSkesO08wBdEgFaeI9biebAtMviAjJ h7OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1fc9KQbR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd10si14849088edb.245.2020.06.25.11.13.20; Thu, 25 Jun 2020 11:13:43 -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; dkim=pass header.i=@kernel.org header.s=default header.b=1fc9KQbR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390004AbgFYPrF (ORCPT + 99 others); Thu, 25 Jun 2020 11:47:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:44368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389551AbgFYPrF (ORCPT ); Thu, 25 Jun 2020 11:47:05 -0400 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 7C87E207E8; Thu, 25 Jun 2020 15:47:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593100025; bh=p2m3B49vDTXiteO5iNtcCF9X6XFjZuQykWs5KqLaLPo=; h=From:To:Cc:Subject:Date:From; b=1fc9KQbR086I5+qM5iVP52kq+GJLcfydg0p/EXgxGuhPK7g5D/toyXtHGlRAe6VNM cKqmLEMpWoLHwCK6Q1Fw5Lz6N11XPX+hFTXyr3zAsHb4MO5t8Z/eOoef6RxtDb1a9L SPWl3IRUcCEs1/kJilPUNn8ysOJSpP8SfE8bjcf0= From: Vinod Koul To: Takashi Iwai , Jaroslav Kysela Cc: Vinod Koul , Srinivas Kandagatla , Pierre-Louis Bossart , Charles Keepax , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/3] ALSA: compress: Document stream states and fix gapless SM Date: Thu, 25 Jun 2020 21:16:48 +0530 Message-Id: <20200625154651.99758-1-vkoul@kernel.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Srini found issue with gapless implementation which prompted to look deeper into SM for compressed stream. So documenting SM was first step, so first two patches add that. Last patch fixes the issue by keeping track on partial_drain and then moving state to 'running' in snd_compr_drain_notify() for partial_drain case on success. While at it, noticed snd_compr_drain_notify() is lockless state change, so fixed that as well. I have tested this on Dragon board RB3, compressed audio works out of the box on that platform and Srini will send driver and fcplay patches for gapless soon. Changes in v3: - Add pause->stop->free transition - Add setup->free transition - remove running->free as that goes thru stop Changes in v2: - Added tested tag by Srini - Update compress SM with Free state and compr_stop() transitions Vinod Koul (3): ALSA: compress: document the compress audio state machine ALSA: compress: document the compress gapless audio state machine ALSA: compress: fix partial_drain completion state .../sound/designs/compress-offload.rst | 83 +++++++++++++++++++ include/sound/compress_driver.h | 12 ++- sound/core/compress_offload.c | 4 + 3 files changed, 98 insertions(+), 1 deletion(-) -- 2.26.2