From patchwork Wed Feb 1 13:49:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammad Rafi Shaik X-Patchwork-Id: 650151 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 18023C636D3 for ; Wed, 1 Feb 2023 14:55:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1E54386F; Wed, 1 Feb 2023 15:54:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1E54386F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675263339; bh=hA45/WFRIXTRXOtA4228m8pLAsrZhlH073CJU8/KKNY=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=fIDKAwr8uwXUJyRouolvweayFuvgxXHRNlDFXt6xx9+AAPJhil3lBE6JORlVBWTYa 9p51g4g/W3iEa3qE8Amvh/KirrW991BHUWMZq8sql4hWm+Jii7oQX0laieu+1IYdTh hRfGGjPyt/OznPq6EoFO/K+VQdw+VVtikO6EK62o= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CE9A4F80578; Wed, 1 Feb 2023 15:52:56 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3CA4FF80423; Wed, 1 Feb 2023 14:51:42 +0100 (CET) Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B1617F80246 for ; Wed, 1 Feb 2023 14:51:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B1617F80246 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=l6Z+sZlR DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1675259499; x=1706795499; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gS3pWCRLJFPc0ueQ3n5YfLnR8R+V6sqtxnfm0b570DU=; b=l6Z+sZlRA0Koq0BumCzfCzAxaEBt2QHSxXKgCzNYzYhm1tlXCrgpSazD 8HlslWlO8OEFoRuGY0yMqqLujLbgAvua1YTYryhSXqV1lMOHEeqiBKzch jKjIPSFjPP6e8r9IA668Adhuz2S1c8+Lz7mlX86O/78s6myw6R3atEvQ3 I=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 01 Feb 2023 05:51:34 -0800 X-QCInternal: smtphost Received: from nalasex01b.na.qualcomm.com ([10.47.209.197]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2023 05:51:34 -0800 Received: from hu-mohs-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 1 Feb 2023 05:51:29 -0800 From: Mohammad Rafi Shaik To: , , , , , , , , , , , , , , , , Subject: [PATCH 01/14] ALSA: compress: Update compress set params for gapless playback Date: Wed, 1 Feb 2023 19:19:34 +0530 Message-ID: <20230201134947.1638197-2-quic_mohs@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230201134947.1638197-1-quic_mohs@quicinc.com> References: <20230201134947.1638197-1-quic_mohs@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-Mailman-Approved-At: Wed, 01 Feb 2023 15:52:51 +0100 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Mohammad Rafi Shaik Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Update compress set params for supporting next track settings during gapless playback. Update the runtime state to setup state only if it's in open state. Allow parameter change only when stream has been opened and running state. Signed-off-by: Mohammad Rafi Shaik Co-developed-by: Srinivas Kandagatla Signed-off-by: Srinivas Kandagatla --- sound/core/compress_offload.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 243acad89fd3..9b951d76c120 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -589,7 +589,8 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg) struct snd_compr_params *params; int retval; - if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) { + if (stream->runtime->state == SNDRV_PCM_STATE_OPEN || + stream->runtime->state == SNDRV_PCM_STATE_RUNNING) { /* * we should allow parameter change only when stream has been * opened not in other cases @@ -612,10 +613,13 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg) if (retval) goto out; - stream->metadata_set = false; - stream->next_track = false; + if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) { + stream->metadata_set = false; + stream->next_track = false; + + stream->runtime->state = SNDRV_PCM_STATE_SETUP; + } - stream->runtime->state = SNDRV_PCM_STATE_SETUP; } else { return -EPERM; }