From patchwork Wed Aug 17 08:05:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Daniel Baluta (OSS)" X-Patchwork-Id: 12945620 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 556B2C25B08 for ; Wed, 17 Aug 2022 08:07:53 +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 85037163E; Wed, 17 Aug 2022 10:07:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 85037163E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1660723671; bh=fEJBkkqze7pbI/oszJFhlwpwwT871tx3a3vM3vYVygE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lXAIlSUI86M/hHJYej2pc05TErMFl8fdQ8OyRvt5/4GxMxCFzbT42saDbUvmqSULv DisCLmWpq1ePXbOWe3DrwICH+Hs8aWnLTNqEwvqPpGZsm8j0JB5T4w1JP6Co/JP7q/ 1Oumzl3vXFkcLEFi7VE0EI24vJ2oWaYEBNHnofdM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E4879F80551; Wed, 17 Aug 2022 10:06:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 27309F80557; Wed, 17 Aug 2022 10:06:07 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60088.outbound.protection.outlook.com [40.107.6.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B3AECF800DA for ; Wed, 17 Aug 2022 10:06:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B3AECF800DA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="B+kuO2lG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QPPFVxdPB4MYUqab+YpQ5Lsg+9g85Kac43q4O2/WoocAeOipSy8e+oVN0UZDb6cKCYOHPSsR7Ao/GU+DQSf1bAillM+an+nYZVUdZXNsNM4vhKaXk/LRH4WaLoR4c2AURwTwW6Nk9F17L9HE6Etai3+PEhcfdtXyoCa6JQQvQ47ugylWZ+rHA1S4J2vH17URBqf4FOaMN9YSICaRhJHZohhGT+zlX2UkkAUGrkYYNQ6iNhjFplcd7A0q7fd6Gf2JnIrh3M+UoDcv2C0BUNqCKgLStIjld7CCEhQF5lLKb1tkyEyrtiWYILJcIzqtklo7osaVwHZ60/2XoDg9M1iyXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YPCbYavTz6yP22PnXyNly+qjuf36NzYb8mbE573ucGc=; b=bC5Q+x63X9mgCEbNk9NDbL87N/Bd3XbMggVmR4g9CiUwz7281GvjRdkuEsYm0jCt5v8ji1YA8EvM3kL1DU/tzttxOOOF1yQ/UvmmqgR6YXiSLA1CxdmZqcNBoPXK1XQf6qaz7e7/71kgGHpo10Qmg6gdoVR+UFgYIhRoSuGL2ikgvxck51RqIN6jHV1L9XVXMkfxEDwWJQkwtjDVv+VEgZR6WnKZGO14/Gg4GaI6bKi8YAs+3slL4a1I6xRKn+8BwOeqpjuDVDKh3NqDMmgd4W8npox50TL/iMEIVIo+dLA/6LcXN6ThCbNgXnWSdaX+3ozpGwKIHJ+h/78uB1nXcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YPCbYavTz6yP22PnXyNly+qjuf36NzYb8mbE573ucGc=; b=B+kuO2lGd4+2KwHMI0B+OIpR2cZ36HobpeKYc7PSR7+GYrNchOIZhciCgv64bRgnMLQQoTZKC64b3/UIuMwVMgP2kZxcLneAcifXXAO5/49Em/JLc2M6HWihFm1TOjAcVcdCF60Yv+doSLpp5CCIey/BQ0vMs7oWt2dVQkE/8EI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) by AM9PR04MB7617.eurprd04.prod.outlook.com (2603:10a6:20b:286::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Wed, 17 Aug 2022 08:05:56 +0000 Received: from VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::68e3:e10a:8232:10e5]) by VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::68e3:e10a:8232:10e5%5]) with mapi id 15.20.5525.019; Wed, 17 Aug 2022 08:05:56 +0000 From: Daniel Baluta To: broonie@kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 3/4] ASoC: SOF: compress: Save channel count and sample bytes Date: Wed, 17 Aug 2022 11:05:28 +0300 Message-Id: <20220817080529.10864-4-daniel.baluta@oss.nxp.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220817080529.10864-1-daniel.baluta@oss.nxp.com> References: <20220817080529.10864-1-daniel.baluta@oss.nxp.com> X-ClientProxiedBy: FR0P281CA0145.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:96::18) To VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 843a1442-6c51-47b5-fe17-08da8027504f X-MS-TrafficTypeDiagnostic: AM9PR04MB7617:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SzV+JVI7UiGXjpZ4Du2+MSzuSjhZMgOws2Mya4YzqOLUvsT2o9LggRXm+OonuVBuiJqA11/2vYFjHtknetJ98D8KsaWPmYIFXUF0dztB6ORDEAIrOYUItcgPjiSVKJhM7r1lPghqow0upTtQiWV6o7GMpJRqQ+eFo5e7VWoLDWut/RbC4p47rySsdboYlNzAfixGst4EUsls+kUvdCc+HObJ6iUpFERFBiMN6Y6AqRB6kANz6V1kM4nG1o3Mln0fKeD3gjhWxRcr1cz26p3NZ+ljTHgyYWc5G4Z30Vh6hFYJatRS45z/lfFYH9/ePG4CJHj46Heepe7jfdrrTrLYkuQXOlzSj3EHZuJpquQ7+5RQwDf2Hc3b3Xf6htKk+T2zgLTMWEdbi0csJ7mWoTfmzDUe9FeY/UohokTtTEgPYmvXddEC629d/GB6VBdbhqUcv5tfKr2qstl0yTQo59iIBHgbDLg41aSC78BdZ0qtuoOYROcTYgYGvBssvlxBibJBJAye7dk7Shdi62K9CumDPRQzdb8DWE0bsu9MIuSshONGinrOSLOnSpxAwI3W4/+c932jf6EluNbejdOc/+CGhdQlzQG9bqAMZvwfQdobjgpwowC5gPMFceEgXDGbYSzQgI9n2xb6lyMoLr1Z9WYhlV3eEwg2Vot7DCVxCIZBLbfyTt6fC4RcGLCOywuNCt8CIX4/49CQAY9BueiokbjhOuVASzOowGCQxeNEmhvgxu2pvMGBnoh5wVQ3z/pfg8nnPNRK1dgbR5Gr14wdJtlBhtWwqmNeUtgjkjFbMWUjQCP4gSHaQP7EU+iJx0vxeHkd X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5151.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(136003)(346002)(396003)(376002)(366004)(8676002)(316002)(4326008)(66476007)(54906003)(66556008)(66946007)(2906002)(44832011)(7416002)(8936002)(38100700002)(5660300002)(38350700002)(86362001)(186003)(41300700001)(6486002)(6506007)(52116002)(6666004)(26005)(6512007)(1076003)(83380400001)(478600001)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: s2QMNK5gby2/ReQZ3MIE3RGlO0I+zvm44nAf/MQlczR69hw3skFv9r9+WvISw/AItYXZUAX9X6vTq0517ikminiklYUN95CCg6eZECmu8MoPg7UtdWFvJRu7l3Ht8M2MZDPhsKAFVKz2t66XBoYzlMloEzKE3G7uZKoiNubLdokjA+uMgELLTRm6/fkchxT/iQ33bCUqzcFXMmDMiPBUNJ8B6wESQsXCZxQj2kQRA9Spoyna7DyVDGjJXCOd8uAMeI7w1tWem3Bpjid6ii7Hcq7pEueN0JYjLfr7n6ZlylpX+hzCsgAvnGQWJNX3xMJyOTsqNK+9YwbgI4pqNS6t7KOcFpBik6zBKn99GaNtqh7JakwHx1Lq0ifqYEkmhRPvLPY+g3PZCubH82h1DWRLNKcsx5wDM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Ek3bbicmcRFe2SlNo9+nxZvp+G/l4A4N9wro15FXR4bxZHOzx3ykhXwsTRw5nNiFFZbsgQ9yxCgGazj5L0vI67LbB05oZ2EsbkdhOy0m6Df6aYX8/4 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 843a1442-6c51-47b5-fe17-08da8027504f X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2022 08:05:56.8658 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 11ZbvgCsQ97SNGi//OQDPrJGV7gYQr4ltiSsIqq6gAF5snKXaAYNEynL5KW3CRxTHtFxUyTujZNEoZVla3DLQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7617 Cc: Daniel Baluta , pierre-louis.bossart@linux.intel.com, daniel.baluta@gmail.com, kai.vehmanen@linux.intel.com, peter.ujfalusi@linux.intel.com, lgirdwood@gmail.com, laurentiu.mihalcea@nxp.com, linux-kernel@vger.kernel.org, ranjani.sridharan@linux.intel.com, Paul Olaru , yung-chuan.liao@linux.intel.com 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" From: Laurentiu Mihalcea The purpose of this change is to enable the saving of the channel count and sample container bytes format parameters for later use to compute the timestamps. This is done when setting the compress stream parameters (in sof_compr_set_params). Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Signed-off-by: Laurentiu Mihalcea Signed-off-by: Daniel Baluta --- sound/soc/sof/compress.c | 2 ++ sound/soc/sof/sof-priv.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c index e990fa093bb5..ac79b46ce3b9 100644 --- a/sound/soc/sof/compress.c +++ b/sound/soc/sof/compress.c @@ -238,6 +238,8 @@ static int sof_compr_set_params(struct snd_soc_component *component, } sstream->sampling_rate = params->codec.sample_rate; + sstream->channels = params->codec.ch_out; + sstream->sample_container_bytes = pcm->params.sample_container_bytes; spcm->prepared[cstream->direction] = true; diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index 42f112030fb8..33165299a20f 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -108,6 +108,8 @@ enum sof_debugfs_access_type { struct sof_compr_stream { u64 copied_total; u32 sampling_rate; + u16 channels; + u16 sample_container_bytes; }; struct snd_sof_dev;