From patchwork Wed Aug 17 08:05:26 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: 12945618 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 617A5C25B08 for ; Wed, 17 Aug 2022 08:07:22 +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 153F61637; Wed, 17 Aug 2022 10:06:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 153F61637 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1660723640; bh=Zp+JAGV1Z7HYlFwwnE2hhGH10DXPSjPxUGN0RsDQo+s=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=c3TUU7JtxNY02p3XYi8qIYD4JPVVVO+phaWrYwW6XE1wR5lWVjAbT4GMeCOXIzug/ TqBwbV0VMyevWdT6hjttw2RIf1XaPJyGImZujcO0G9WzMjz94pqG/oTLrrRos+3rhQ A5Pr/g6A/Ge7+CnHO/xGEi0EW0Hbi7TY8y8cR9F8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 28AC0F80534; Wed, 17 Aug 2022 10:06:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 73E14F8025C; Wed, 17 Aug 2022 10:06:01 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60058.outbound.protection.outlook.com [40.107.6.58]) (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 6F7ECF800DA for ; Wed, 17 Aug 2022 10:05:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6F7ECF800DA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="G2+VU3FG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UtrniIcLMtfC9GuHc7o2d6rSkea9eyevxUzToOs3b4+WgGVHJN5bxYjh+aizdVkNiIDNf/qOi38TWSO63z6MZ/OCB4jQAaDqUURZMlmsbWepo6GdlNv8d/3gPmOMTCva9T/4FUqxzjYI2N66HvKQ+xBHXAFVky2tGBq7t/AZoUyR7r/E4hkPAnL5miOyjtb/QGtqKgQp0JpKq8fYi9QE3dhDSu7p195q5OAEE4LEW74KBLh4gDQ0TKd0F2C5+FFVSNcQDfE4TKmrQGKOLAODM1bWrHiZzOxh040ZeVVjTo/TVg9cDkDoSZoHZshWDTLy7rZ9psrsF29R0shhp9AHJA== 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=+29B8g6FWmsRTmm8MhWkeccZoIlYvU93XqkN5sZP7EA=; b=ER1tVGIE4Yi+jGYEcpjvj6L1Pin0g5A2uZi1yoOzqqRfPdzOiHDC2NBTMwSKIpL+3uopePWhcYzyqmBpebUJUJkMgsNzKn2YcKk+tBaNIjNZ3gk5KwW1nkmoOMG8NrlqEgvLPMebry1Jm5aU0pcMU96t8lgQhzlGLAbufzga/bnCwk4ndkc0dF+78N6qa18763pB17b6ASYLs8tJ/AN0oAsZphpwuf9Awow9V+a66ItOguNHOPFoIOHmCLSq3pkzVf5Ks1nQpEvhBvTuJTr2QxRUXcQwUQWOMWoEANT0ZD1g3spNu/kM5sQbyoLHmNk7hRtAz0IGEpuI3DxwQJCwqw== 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=+29B8g6FWmsRTmm8MhWkeccZoIlYvU93XqkN5sZP7EA=; b=G2+VU3FG2gQuCSS0JaEl2l6TfCQNzmnu2iUqqHvDZET0/d97Sa1q8LQZk9bB439X3GC1MWSCI3tIcGt263t9Vxeo7/+nbTLYCGdwelqzaHNTQauZo/NRrcGHsNgCCIF+Gw3CqatgVYB8lMfxNrPQ4cebRJQqART8vKVFF/rf6n4= 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:53 +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:53 +0000 From: Daniel Baluta To: broonie@kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 1/4] ASoC: SOF: compress: Remove byte offset computation Date: Wed, 17 Aug 2022 11:05:26 +0300 Message-Id: <20220817080529.10864-2-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: 698d4801-70c9-4ae5-44fe-08da80274e67 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: v7EkhFj6AT3/9t9zJJw9bZr71baUQAfHVmBsAXVt9U2qsNRuB6Qy+x2DSM68Z28cPvLpOZ1uauVSvD3edU6+Bxw9cde0sqjvfkf0lA219crt3avDFj8FD6w1DrOrejX/VnRfpToqlcNSdvRUwAL0/GS7TI4S7/xMqMLUP1nz/wX42djg/ULrhioUcKk3fTa4xSGGtN9bYIGK6x5CbI7IzGuiWZG4obDFiLWosdjB9OKuixptykYaRdqj60j6hp1dIUdnEB4BTWtZsJ3zoOUamiVUgFxXkZv2kpBFEl9CKjcXQpsrrDyYu9T9Ma126JfHw9Si6GRO/hyF5KMlfAwLyoWSU3gpmJwZQQCEMu9yU7BdZIWe1h3VVxBhiiFo7dvvKG5mIiyctKCl1KizEf/q3Ts6vtSUrzDXaJoAsPlljRh6lFX5Q1YPHJgXE2Rte34ehFD70Mm2aTXwnhBX8uG68bg73BIyK86A5pyq+MhEfi1MphBM1xDi1aFFIffgrtxslIk/uqMUfxKcDYBJX5QyDXLyhpDB49v4bErqx3hXxWHCC26ZsZVtSOze0B/ZR+WLdpDAz20LN3WJfxxTEnmIEvIukAs/vUkSzw9FPiDKitnbYMo+uFvLOSnT81Mj6Xj0zMdmq5M8bPtvPDbGsB6aHpUyssSYlOgnB2fNWavyh3D7VXEtypz4O74jTv0UwT3FPLgD0NhtPoOkpFYw9OWn80g2kO++OIiE+8263YZLjJl4U6FpQyLwCa6Q5ErJhG+HisK3/0LkevvhB0KEmTFwSaakunQ5WPZsEYPpbveAfgL6hzYLW415AZaULOL/Jy15 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)(4744005)(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: RUtGX8t3clGgr+Jwk2dQ+iAK0JlLUUEf4Qo1OxYuW+D50bjt0YfxfGGukHuS3nG3Fi/Ef4j3BYAbuPjpa5CWF60ymdrYfI2Cbr+9LUR/yTglSbHgRIK1hWC6v5UoOxZFJ6SG5LmbsMrgtKLqOCFXh7rpzK1za1LAhwPWSKYV7Bc9FlZ/2whgnPpEurzVWh65629XEenAPwOKBjWN2o+7yyn3Sal+wV6tWjLvd3gC4stpzHd8nm+Hm2LyPU48Fv8Noh0blfym7QNONloj12GMLMFFRZD7d1KMhgLsRHQqjcVzQ9aGqgFpUgAu4ta3Lwndqd8VEGQj3v3END40jp7hthXsLDKIuPsU54Y1PVyYqruBi9KC9Ogqxu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tkcLe864VlFyb8JWNGREEnPfYUk8gzWCvK20NZsz+42umeJXd8bEzgA8oCHj5cTxr7Lj1zxrLLxSk3tbdlTqD8KKzUzXgcCdgtWHTMobhhZuiOUn9WzjSlCq1hn+Qg+LSosmK7T79oAdHGKF8L X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 698d4801-70c9-4ae5-44fe-08da80274e67 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:53.7879 (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: Pmtk9pDi9GuFZAZ1fYfVUW+xjFDxaDY2fXGlNO/LFR+iDNwa2iESngPfvDKPubXtKL3jWU6Oz5f3vPeYEa54Rg== 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: Daniel Baluta Byte offset is the offset in the ring buffer to the DSP while posn_offset is an offset inside the stream_box where we keep position information. Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Signed-off-by: Daniel Baluta --- sound/soc/sof/compress.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c index 67139e15f862..760d6a4a5253 100644 --- a/sound/soc/sof/compress.c +++ b/sound/soc/sof/compress.c @@ -237,7 +237,6 @@ static int sof_compr_set_params(struct snd_soc_component *component, goto out; } - tstamp->byte_offset = sdev->stream_box.offset + ipc_params_reply.posn_offset; tstamp->sampling_rate = params->codec.sample_rate; spcm->prepared[cstream->direction] = true; From patchwork Wed Aug 17 08:05:27 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: 12945619 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 121B7C25B08 for ; Wed, 17 Aug 2022 08:07:46 +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 54D661640; Wed, 17 Aug 2022 10:06:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 54D661640 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1660723664; bh=f01cP3fiJitoFakWY/ckdJ4PIU0M2hy6N8Hkr6E1UVo=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Bmxrvm0zQj6R7BzRJbTSAyp6UPxN3FOwjIuHEXOJlDGiPOOixKlQy5pBNu3GjbDbI GlTEMHcF2WAAAMH8rNs56RrgpxzjV5Cz55j9efCGYGCFTadTT+AHPQa28t1FOb95V2 a2XdGXnXnS9ymyTsOy3fqtvUS/HAejyGUcAXsOUI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 349ADF800DA; Wed, 17 Aug 2022 10:06:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8D27EF80549; Wed, 17 Aug 2022 10:06:05 +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 7FD85F802D2 for ; Wed, 17 Aug 2022 10:05:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7FD85F802D2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="PtnVrJWl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LSu+smIPt4fOlab3FBh83cVckRX8KyJbsNwOqgUGeeEGg1oTgLzYsqBktKRl3bTPBKE9e+z7ES4Oh+pbicbP6Vig11GIRnCIgh2qkq2Bv4leaRRXxO84XezH9525KFFgS8EiwCWMhyKRVE1VwdxdPkVrxRiG5qa4azdfh1EcMK+Z9HwPDl8fQYTD+7APt62Lt8cH/oOW3j07hBOVm/knQKrOFuPaHPH01w2eYYPBV4RTZJ39g+SZLrfSjUJhoiFn1JMhrEeqO9mcTGj4qKdqOFSskqOE91/DiVJww17hWcgIxnUrdJvsHBBNtbQao2nnkXBdOFlRhBIkABSkaPZ1hg== 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=kWWVJMpPl/MqDcxHnpDFV3ubvAG0DGhWmip0gI/eHxs=; b=EOsCQhHPBLHnIsoDTxZbb0yV2ompsX0B2wX0iHX2JzmXYLIyHECqbu3Isvji+e0HJlLbO2m+hpJm29RMDjB/GGFhZ+2RRou7teXPn06V9jPIeATSNoRd0jOAvpr88T4fKGBGAURWQaBitGjXR0sd98YLnBSGN67lMOnaGdZtq3BMW6tfn39Te11jOBzpY3ZIo+T0f4DCCBPEYIqt5eH8CwoVJM+4vdUa38o9QMCT88bPm1EOpgkX2IOrN21uJLxwSw7AGUw9iDCS/TqdQJCi671FEiAxFAfS3EMVVXvywQ+jJS4CVLDvOIJ4ZdYh8jT3cb3pPR/0t2eFCpUD4E1eUQ== 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=kWWVJMpPl/MqDcxHnpDFV3ubvAG0DGhWmip0gI/eHxs=; b=PtnVrJWle60FbbI+OOHN3CbmRIkiAYYOoTbjum8I1hWzgIMw1dgeo4pj/ZV9+wLi3F+d7Hq0CEwLe0qrD/p0QPa2TfT8xa6zYkczF3+UTwVof4iqcsdA02aDP8dExjE+ulseoxJlGf7oVzrWQ2KE/gArGzxVaG/12r9Qjn9BLxM= 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:55 +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:55 +0000 From: Daniel Baluta To: broonie@kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 2/4] ASoC: SOF: compress: Introduce sof_compr_stream Date: Wed, 17 Aug 2022 11:05:27 +0300 Message-Id: <20220817080529.10864-3-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: 4946b95f-c1d6-4209-4770-08da80274f72 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: eRqA4ruhUBKYDghQL/Hxq8fUn2m3atDYtiARPYnEL2xR20mdj6/u+B1WT9cq0V5yDX+lFIbjTZrdoS4TQLQwRE4x3WhYbHpnJB/NlEuJx+jdayMXN+mMU9rwnlBOBlX7Wn5sDtDNcQc3g0VaNQ42t9ygmAiUnirBHCwhzpKlQI/vOEGhxWmYG2/OR/pTvAleSzvVHz4jD8a3OaqUd5K0xM3Vsz93mFzY9NXgNFZwyMscGB0KMbW/PVbu/zwNNwjuG8u/qIY0uYvNMUpKYrwX+4J/AZ+F2yWAYmnIImxZyu6g65r7tI1GintKVfDCpJASSd036iaw3bYEVCdxgoW6YW82Lb8kOo7PNQhOVr+U0BovVfcDstMt/Mcy7HqpkTbAWqS5ekRsxwg4UxoJyUlh30vsfDb9RLt91k8Nh/oC6s/ks52yf02jMl1avyI817n+su6yeJbSPHR/UCLi3t4NRLGE7jg3B45MK1ex7OM6d/urutdCnjNiMATrSUvxPnaUlfaEUOZE4Lne1Vw6B8x+zlcJPcvlnzbWdbNjsFC2ATTVP97cK9n83RYHW0Kvv8emChzGb+yHW8RWe19MwQOP+NkUf4MCmE4duAIf/xe5gtSFjJWD8nomyskk3A3CEm3ty2+ZxdhqvXiLswb0O8QuTwXUkcahRvW4ZIPSwUGyUf0wazvSVLhNXg4IW703E1xBWGEZSQd8cw03b6Vsoy5iYL2LAUW1YxRgrPAPqNo2CoDWw0X6zImekr5Y19TVDxmWkloO/kNWbb49Lgc/mIJhhY7WPx4EIQYFEqpwP4OcRgBxfTRCG7bnPImOBBw+HBDW 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: j4blRDoqvfSHaRtRVO3EGCMm/vZVPv4+d1IUHps2Wb6AGwtDJzHXDhWiKKuwLuoq32cdu5vz27koG9KHjXMNSvnbeCPCGL62lGE4cs9jkvqR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qSxAvU0eE5EZkM5BNp9h3ZXTcTW9VAAULbVrOxjllI+YSU5/TH/OAXGsCduwc944yyQ3tINdeK223uUwwYNozK+kgfHaGsV0fU8jr+LXvngqMQ2EFk35ZL2NEfyqifCLutju47GUAeJlyH0z0bNsU7sDGEbJLzs9HQL2wFeLx6wVCjog7nV1taTMl1EV/hxrhkhUaJc7usO9qVAsN3LUq9ArhxT8ftakgr2eNd8/nsiKEfXHn/C871ym/l0zEHjHw6AUlHKGZIOaKrei/Wh8RMfTRCzAUWBIXLoocnNJxBb9lfqIXOPjA7MoscBZEyeww0FEoTMIxjiOQapSZHfK57hsiv1Kkci1ae4F/Du443koEpFxpOCKd+1lAQ2/dXzMuKx+4947AnltGX1MSje3utev X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4946b95f-c1d6-4209-4770-08da80274f72 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:55.6003 (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: sNzvAl+Ho6tkXDlTYvL4MJZlHauXsodwJ3N2zrOrf1dj5xcmzkHYZwhUXe6BuLK80alE2DoFkgZhNfIpvQJnKQ== 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: Daniel Baluta This will keep SOF compress stream private data. So far we used snd_compr_tstamp to hold the private data but this is no longer enough as we need to hold other info like number of channels or sample bytes. Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Signed-off-by: Daniel Baluta --- sound/soc/sof/compress.c | 40 ++++++++++++++++++++-------------------- sound/soc/sof/sof-priv.h | 5 +++++ 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c index 760d6a4a5253..e990fa093bb5 100644 --- a/sound/soc/sof/compress.c +++ b/sound/soc/sof/compress.c @@ -11,20 +11,20 @@ #include "sof-priv.h" #include "sof-utils.h" -static void sof_set_transferred_bytes(struct snd_compr_tstamp *tstamp, +static void sof_set_transferred_bytes(struct sof_compr_stream *sstream, u64 host_pos, u64 buffer_size) { u64 prev_pos; unsigned int copied; - div64_u64_rem(tstamp->copied_total, buffer_size, &prev_pos); + div64_u64_rem(sstream->copied_total, buffer_size, &prev_pos); if (host_pos < prev_pos) copied = (buffer_size - prev_pos) + host_pos; else copied = host_pos - prev_pos; - tstamp->copied_total += copied; + sstream->copied_total += copied; } static void snd_sof_compr_fragment_elapsed_work(struct work_struct *work) @@ -49,7 +49,7 @@ void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream) struct snd_soc_pcm_runtime *rtd; struct snd_compr_runtime *crtd; struct snd_soc_component *component; - struct snd_compr_tstamp *tstamp; + struct sof_compr_stream *sstream; struct snd_sof_pcm *spcm; if (!cstream) @@ -57,7 +57,7 @@ void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream) rtd = cstream->private_data; crtd = cstream->runtime; - tstamp = crtd->private_data; + sstream = crtd->private_data; component = snd_soc_rtdcom_lookup(rtd, SOF_AUDIO_PCM_DRV_NAME); spcm = snd_sof_find_spcm_dai(component, rtd); @@ -67,7 +67,7 @@ void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream) return; } - sof_set_transferred_bytes(tstamp, spcm->stream[cstream->direction].posn.host_posn, + sof_set_transferred_bytes(sstream, spcm->stream[cstream->direction].posn.host_posn, crtd->buffer_size); /* use the same workqueue-based solution as for PCM, cf. snd_sof_pcm_elapsed */ @@ -96,24 +96,24 @@ static int sof_compr_open(struct snd_soc_component *component, { struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_compr_runtime *crtd = cstream->runtime; - struct snd_compr_tstamp *tstamp; + struct sof_compr_stream *sstream; struct snd_sof_pcm *spcm; int dir; - tstamp = kzalloc(sizeof(*tstamp), GFP_KERNEL); - if (!tstamp) + sstream = kzalloc(sizeof(*sstream), GFP_KERNEL); + if (!sstream) return -ENOMEM; spcm = snd_sof_find_spcm_dai(component, rtd); if (!spcm) { - kfree(tstamp); + kfree(sstream); return -EINVAL; } dir = cstream->direction; if (spcm->stream[dir].cstream) { - kfree(tstamp); + kfree(sstream); return -EBUSY; } @@ -122,7 +122,7 @@ static int sof_compr_open(struct snd_soc_component *component, spcm->stream[dir].posn.dai_posn = 0; spcm->prepared[dir] = false; - crtd->private_data = tstamp; + crtd->private_data = sstream; return 0; } @@ -131,7 +131,7 @@ static int sof_compr_free(struct snd_soc_component *component, struct snd_compr_stream *cstream) { struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); - struct snd_compr_tstamp *tstamp = cstream->runtime->private_data; + struct sof_compr_stream *sstream = cstream->runtime->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct sof_ipc_stream stream; struct sof_ipc_reply reply; @@ -155,7 +155,7 @@ static int sof_compr_free(struct snd_soc_component *component, cancel_work_sync(&spcm->stream[cstream->direction].period_elapsed_work); spcm->stream[cstream->direction].cstream = NULL; - kfree(tstamp); + kfree(sstream); return ret; } @@ -169,7 +169,7 @@ static int sof_compr_set_params(struct snd_soc_component *component, struct sof_ipc_pcm_params_reply ipc_params_reply; struct sof_ipc_fw_ready *ready = &sdev->fw_ready; struct sof_ipc_fw_version *v = &ready->version; - struct snd_compr_tstamp *tstamp; + struct sof_compr_stream *sstream; struct sof_ipc_pcm_params *pcm; struct snd_sof_pcm *spcm; size_t ext_data_size; @@ -184,7 +184,7 @@ static int sof_compr_set_params(struct snd_soc_component *component, return -EINVAL; } - tstamp = crtd->private_data; + sstream = crtd->private_data; spcm = snd_sof_find_spcm_dai(component, rtd); @@ -237,7 +237,7 @@ static int sof_compr_set_params(struct snd_soc_component *component, goto out; } - tstamp->sampling_rate = params->codec.sample_rate; + sstream->sampling_rate = params->codec.sample_rate; spcm->prepared[cstream->direction] = true; @@ -325,10 +325,10 @@ static int sof_compr_pointer(struct snd_soc_component *component, struct snd_compr_stream *cstream, struct snd_compr_tstamp *tstamp) { - struct snd_compr_tstamp *pstamp = cstream->runtime->private_data; + struct sof_compr_stream *sstream = cstream->runtime->private_data; - tstamp->sampling_rate = pstamp->sampling_rate; - tstamp->copied_total = pstamp->copied_total; + tstamp->sampling_rate = sstream->sampling_rate; + tstamp->copied_total = sstream->copied_total; return 0; } diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index 823583086279..42f112030fb8 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -105,6 +105,11 @@ enum sof_debugfs_access_type { SOF_DEBUGFS_ACCESS_D0_ONLY, }; +struct sof_compr_stream { + u64 copied_total; + u32 sampling_rate; +}; + struct snd_sof_dev; struct snd_sof_ipc_msg; struct snd_sof_ipc; 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+g3PZCubH82h1DWRLNKcsx5wDMbCCxuyDtKXf63Mp+5BJIMYgcOAxyiyZ9oOXgeNT5dWegTWIeTf3LS/IWIuXPZG8Z+yOB0E1n2LE93q11BUlyFpEwFOGya0W2vHIEivs/J/mNweVSK9AH6BIg/GQYUpUdm0ER25VNz/MAi3Z8STF6U0EHLvhbJZZTTkJAsNf+iHdpH3KLrJ8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da8027504f 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; From patchwork Wed Aug 17 08:05:29 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: 12945621 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 BC2A8C25B08 for ; Wed, 17 Aug 2022 08:08:13 +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 0B4F81616; Wed, 17 Aug 2022 10:07:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0B4F81616 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1660723692; bh=PXlAn1pz8WpNt7JBnMhtzs3n6reXFCRvHszSuVCD4O0=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=MwQC2UPjHX3ScKnOzgdyfTCzyfvbZN01I3T6PaSYwayPU6+4SwEEhOhOi1wlUtKE4 +8mXjQkxypUKf4PH3mRS22Qg4Ttgs6CQ+KUGdVhxprs95//cftjijJobiWIPkPmLJ5 Hbk8Wl+HCDvWdvc6INReYeZfTt/kG9KAockH0q+Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9D3D6F8055C; Wed, 17 Aug 2022 10:06:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 64A6FF80563; Wed, 17 Aug 2022 10:06:10 +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 E5A35F80518 for ; Wed, 17 Aug 2022 10:06:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E5A35F80518 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="iCP8DNku" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EOenMpZBDRWmX6+vvp0/ZK/jIVPvLwwwnL9PTJdt4Ble5dynw4Ho6n2rlrh9H1nfyaQj9MSuyu2ilCWIeSAwcfI4IL/ypk6YvfVuaSGKDMkQi0SUXUlupr7gvY2wBtewxZeZSRhiigjOoWQXQ6jOqKJ+70B8YlKWHJ68lhcaRqJ6U4DS8VhzzkO98LVw3cUYUQtpxHOoB2DsgDUXJ5CbNKkIGYd1uLzu4AhywKxll/JplDM8qOMAdq4cY/l+KzC5REfMqL7f8xDOfnO2gYn0+bN3IF86H4mlBsQGx9eiU3KIZIbQS8TNuKW0n2UhyYvzk7mAEqZdBxQFjTDm0NkUMw== 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=JwB8qZ+geAXbrM9yHUvBFqFHB9Vl+3ihNvrLr82/AQs=; b=gYUn7FEvwO1BfTJR4IGAczVnR+UxaFOhuA91ev/FEIfv9Wt1hp4Zkm1sIVz5xJsLjN2IYa7pi+EWFYMCS+fosGc6MjkFPTO77U+GTdJ6VBiaEnwNli+CRjEVUSsCPoAxTGCA0teo1ALnDKTxA/YTjtmzGRstSMFfZaFNOul42ocaiXNoZc0dH+NS17eZodGrRWLZ/iJb/reLpOatzoNKNxVXUcbnLAM34Cvxld7gA0V1kNBP+jJmmdrnTkvx/++Zga8K0Ati2Yjx6MtaFzkPx+jZAa6lv7elq+Rm/b07CRL6kEaRsdqPn+Zzp5xFI4DtvuE2adiaFi7yAgn7WDjpxg== 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=JwB8qZ+geAXbrM9yHUvBFqFHB9Vl+3ihNvrLr82/AQs=; b=iCP8DNkuvvy9R+Zlv9QA9kH41b5yNdkyLFdFbKCqq9YjdSRE2UuC4U3A6jzyZrrLSi4YdJJzpF75MoEp0bpSxvdZxyHJcaTlmsS1jvuDXBF3BsFzES3bG+agCcLzg5uFSEqragE7XM5E/DfwAb76u/G+ICaxK5bR+UgB6BgxhNw= 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:58 +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:58 +0000 From: Daniel Baluta To: broonie@kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 4/4] ASoC: SOF: compress: Add support for computing timestamps Date: Wed, 17 Aug 2022 11:05:29 +0300 Message-Id: <20220817080529.10864-5-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: 622d919c-930a-423b-3fe2-08da80275118 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: 9In50/yzPQWWhv/LVRwTFlFfdKWS0uTOkByoHBi2kW10H8fsUPpfeAYaEq5GHnotO1uN7O3E7556pQiYocx9RlNUMxrK1YUC+j4ogg7FhVc7oQr2kDnxLJIMtNihkEK/HDsjaiDc272xW2wWoPTv/XEuakuNnv8ed7shan7m9Cr1RFD0I3z5POfiuCRARcx6czAudRWF7Ml/4Aqe1ppeiQm+EurEpMS6E8umHOJp5liyW/BAhCYznI2/bieskMHC0pX3qmtsHaarsW4BkKrhHbRfz7/s99Y8C4gYGXZ8Wlxy5B8A/tNVO2/bofiTHmg6eXWDL6E3Z1nfiRjj+DURkTZ3BPUbymw+gHIR/JTqPgJz1I0FUGM6cHCQ91SLRzdfqnu1EoBaXo2tSeuFn24Ini/FIjQgVRMMBk8xrA8/qHKfc9roSSWKb/2XaWY2wTvUk2irRwzfk1Hq5gKw51R93zKIqHkHZVWMCsVd16PQCL9Kjcp6/zGT9qzK1bwZ7LqnQMcqbK+NfOWM7ZpA85CACyTNXkHeOhkA9HKNdSozHy4R+yQ55T8zApR5lpnsvEeDkPyJ90W3rao+U/9yXWI0/BwSLfYNG2VL4XxT0uKG0Zn1ReenZsr61WItJPiNRF5w1WXSd8JDV9lV6Q+y4s2Pb9b5fMcaHauofex8a81/6x4OoyiTswSI0ZfGlaXLBNPHK6lQfITa2VNJ4uVPyndlvQjF2ocfZuHM8zXScoVgUdzgQ9CJBBME1a09ETxANk1i8/1LXtmxx+TsXSfcku+Bvt3CtfJgrDehsg28CA3LLXRCSI3R1Ji7bXxFJc/bMA9g 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)(478600001)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +pwU2DPsqwB2xBT5UzGi7w5scpB8z+s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j2zMoa99PAkUIX1iedywUEBEvOHpDmIv30Jt8cvCaFDdiMn9+/CAL6ICXKZ9ddKxW/dgKjeX6FZEw+ZfTp96kO2d5R+lmf8UUFkoi45mzNDas/Qf7054l08v2T6Hoxc+HAc3+a9jUbRu9wQAY1nR/5KkIge1XeKrlnKVskajzVW1QrFS5ALhBdu7eocroPQEtMMaP7XQrsn6u2LCG2gE6t5QJEpsxY1J2d0BoPo6LY/CIKN2KXHrP0lmcDjiIqqYKar76yuQ0DBTsBy2uqAvcBDldcCZ7MS+1GBA/6xy8yj+mK3Z2yldN3Vtt33Zq1wnzXWW61GRS8jDPVs6R7GcdpT8U/JrxRoIzdXmDzNPGVjYlRLqXPixdZwAMypuNOnNKuNJla6jX8BHGnLt5pNhZpi54agTYTOFKL3nUwS5jsxAqaLVZfb/gT7985DXpGZz6OMt+on3bbqQQOPPWRY2dkj8AGF1HNGLY X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 622d919c-930a-423b-3fe2-08da80275118 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:58.1938 (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: 7Jd2XVwKZSz49gn8Xgz2iAFwUVZ0hFFHP16/ae1PqealbZ6MJWxAj+wXT6I13+eIHFcdvY9wD9f7nfGmJtNJPg== 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 We compute the number of pcm_io_frames by dividing the dai position to size of a frame (channels * sample size). Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Signed-off-by: Laurentiu Mihalcea Signed-off-by: Daniel Baluta --- sound/soc/sof/compress.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c index ac79b46ce3b9..174b3d8e67dd 100644 --- a/sound/soc/sof/compress.c +++ b/sound/soc/sof/compress.c @@ -327,10 +327,21 @@ static int sof_compr_pointer(struct snd_soc_component *component, struct snd_compr_stream *cstream, struct snd_compr_tstamp *tstamp) { + u64 dai_posn; + struct snd_sof_pcm *spcm; + struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct sof_compr_stream *sstream = cstream->runtime->private_data; + spcm = snd_sof_find_spcm_dai(component, rtd); + if (!spcm) + return -EINVAL; + + dai_posn = spcm->stream[cstream->direction].posn.dai_posn; + tstamp->sampling_rate = sstream->sampling_rate; tstamp->copied_total = sstream->copied_total; + tstamp->pcm_io_frames = div_u64(spcm->stream[cstream->direction].posn.dai_posn, + sstream->channels * sstream->sample_container_bytes); return 0; }