Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2969695ybt; Mon, 29 Jun 2020 11:45:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLjMFEUZGPjnau1v9cxzwHEW6rzlIrxKE1NCZ5KTJG4Qbj+q76wRQx9ypHscL3dJX4UPgM X-Received: by 2002:a05:6402:1777:: with SMTP id da23mr18691982edb.260.1593456316948; Mon, 29 Jun 2020 11:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593456316; cv=none; d=google.com; s=arc-20160816; b=Bj1HyA2/BjaMzzALj2Qz7QbIweThuZIN+TpOOcPRpZBmIqlBIZURuPq8U0KwfUYWRp AW67n0pQkYN0DDFiywle+Ij7BKQVAbmt74bgSS4J/U3oiINhtYkl8jJgVxecvqpZEGRJ oEJZTRLivnKWrkI7CBprdy1MwHk2DzR9h8PJ433HMjxheQblnrqb8S1kd8a3DHuW+mUn Ppcctvb5Un/EGYNl3jw6NYAvXWJXD21BHphjm6R2zdT0gh3+AgyT4a3i77HjnW79EEG5 0UTbG2cUDcjc0J6QPUCLi0imlPCf0DqDSouGzLHQsZKfDue6EboUkuIxW4bOoEMZ+EH1 mS4A== 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=eroJlHLrKuYbdlzRgiiLb1aEr6ojMhyD+7IVdRZdQgs=; b=YJ1geQsPygYq3LdxnnapUn8ZLV39TPnQ8tYH0lqsJ8lTVWnnLICeT0v3w5DcF3DIvZ gY/+y/gM5hKV9uNu6tXSudm/9BhRAxGqPfNjkYGwp9QCcpDjSCnsrPqMVa2axILJ2vEQ P9SaxBg9VDvpr7MLWezKNph4PyNYe+cxSG9LubYWqaITs+hgNIs4Y63zHaU/2L0tbUqH OniJubOaFTaGOpkRybVQ2qZ6xIn1jIdTFETQ+aFNZBGR9BrpNpKQXGfyqEFOFWffYsDb VZwnezHEJ7/qE5fIYqPRT5fmcchsRAEAwyqgkhgGzwAgrxEFlroYH3x821+hoHG2z4RC HuIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oPeNk1jp; 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 k91si219850edc.296.2020.06.29.11.44.54; Mon, 29 Jun 2020 11:45:16 -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=oPeNk1jp; 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 S1728906AbgF2Sm3 (ORCPT + 99 others); Mon, 29 Jun 2020 14:42:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:60608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728937AbgF2Sl0 (ORCPT ); Mon, 29 Jun 2020 14:41:26 -0400 Received: from localhost.localdomain (unknown [122.182.251.219]) (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 E3B3C23D67; Mon, 29 Jun 2020 13:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593438469; bh=XHtYOKJSfUA300e/p5ysfFZ8eKeqkxoTiM/IQ6Hezx8=; h=From:To:Cc:Subject:Date:From; b=oPeNk1jpTRqSnMK+lKozomFejz2j5aQRcZ4EeBGRNig7FvO3D2Q9ZHLKqOtHH4upq 9gTDalb6sl47L730CJbjlYTLIbUJ3ms6ulS2HEm64suB8CgUqMzhpA3cEJ1wWKckTz ZwF6yy5a5Fa2Gpc3DWLn0g21xIcI13O1tC6l6urI= From: Vinod Koul To: Takashi Iwai , Jaroslav Kysela Cc: Vinod Koul , =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= , Srinivas Kandagatla , Pierre-Louis Bossart , Charles Keepax , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 0/3] ALSA: compress: Document stream states and fix gapless SM Date: Mon, 29 Jun 2020 19:17:34 +0530 Message-Id: <20200629134737.105993-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 v5: - Update SM diagram as suggested by Amadeusz Changes in v4: - Add review tag by Charles - fix the lock deadlock pointed by Charles 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 | 10 ++- sound/core/compress_offload.c | 4 + 3 files changed, 96 insertions(+), 1 deletion(-) -- 2.26.2