From patchwork Mon Dec 5 13:21:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 631056 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 07DEDC4321E for ; Mon, 5 Dec 2022 13:23:24 +0000 (UTC) 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 30A701872; Mon, 5 Dec 2022 14:22:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 30A701872 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1670246602; bh=MaNqeEkhD6uFBQiZvZCRdckHPwLavdJwvT3+JYV4DYA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mPgcIVhC2ykF0gUBmCq6NXGnM6B9sBGM7o42MGvtsGEImQT+lU4/5IsTL806V5Una 4WYYCMkji/LklQbV+yzNJ9Pzpg7pzdiK0VSx4myi+SY+cFUz+RJ0eIOtneVJazaZT8 PUhorDgLB0qW/xVGy8urXi16LEQ1PhwzUPE+Deq0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 59DD2F80568; Mon, 5 Dec 2022 14:21:40 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 37928F80236; Mon, 5 Dec 2022 14:21:39 +0100 (CET) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A92A3F80236 for ; Mon, 5 Dec 2022 14:21:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A92A3F80236 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="JGd2wW5U"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="QA0xh0Hx" Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5B528225C0; Mon, 5 Dec 2022 13:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1670246487; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kqBVOyE88h6z4FJ0V7WQNfew9pfDbQ4nz1o5y0mrLF8=; b=JGd2wW5UGbqdqXX4fKXriT3MNBRHxPRoz9KOeZq3X3Q8pO9Xz+VLCsBXDuZ99L7aO+VTH1 O35vZf2ViU/9p/qXim70bkHeEH0slTa4gKU65F3EZAYTeUZ/WVg0uks08flULs3mhX5+0v OS4DL33pR/Rso8FFds30rOJ594uuUjA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1670246487; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kqBVOyE88h6z4FJ0V7WQNfew9pfDbQ4nz1o5y0mrLF8=; b=QA0xh0HxJsNeUX4qRVqC6M9fk+8ZW/R2EAaIhOeetiVOCvLFhc4pcuOKSxHxMvcAKmT5rM QiTrkEV+nvdrUgDg== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 37E601369C; Mon, 5 Dec 2022 13:21:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id gAI/DFfwjWOZagAAGKfGzw (envelope-from ); Mon, 05 Dec 2022 13:21:27 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 1/3] ALSA: pcm: Set missing stop_operating flag at undoing trigger start Date: Mon, 5 Dec 2022 14:21:22 +0100 Message-Id: <20221205132124.11585-2-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221205132124.11585-1-tiwai@suse.de> References: <20221205132124.11585-1-tiwai@suse.de> MIME-Version: 1.0 Cc: Carl Hetherington 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" When a PCM trigger-start fails at snd_pcm_do_start(), PCM core tries to undo the action at snd_pcm_undo_start() by issuing the trigger STOP manually. At that point, we forgot to set the stop_operating flag, hence the sync-stop won't be issued at the next prepare or other calls. This patch adds the missing stop_operating flag at snd_pcm_undo_start(). Fixes: 1e850beea278 ("ALSA: pcm: Add the support for sync-stop operation") Link: https://lore.kernel.org/r/b4e71631-4a94-613-27b2-fb595792630@carlh.net Signed-off-by: Takashi Iwai --- sound/core/pcm_native.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index ba6e44d02faa..e3deec62b9a1 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1432,8 +1432,10 @@ static int snd_pcm_do_start(struct snd_pcm_substream *substream, static void snd_pcm_undo_start(struct snd_pcm_substream *substream, snd_pcm_state_t state) { - if (substream->runtime->trigger_master == substream) + if (substream->runtime->trigger_master == substream) { substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP); + substream->runtime->stop_operating = true; + } } static void snd_pcm_post_start(struct snd_pcm_substream *substream,