Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp34491lqo; Wed, 15 May 2024 07:05:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkw9W5+Bbn64pHIxzW3x9WRw8r5XxMlvqLPSJz8THDUHeD87T/74bH2B0WUZNkdR0fYAmeItdba2ear1Y9+8vcMdFDXB7TDLP0RaGM/g== X-Google-Smtp-Source: AGHT+IFlHGRe1ZqqHd87HDiggjWA2i3GQcd3qKjC67xfYPq/ezPOMjRu85Kk9pFpVDPIGAKEgzlR X-Received: by 2002:a05:6808:1154:b0:3c7:351f:b3ff with SMTP id 5614622812f47-3c997057fd0mr20790889b6e.14.1715781900381; Wed, 15 May 2024 07:05:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715781900; cv=pass; d=google.com; s=arc-20160816; b=KWoZpYhBGo2T6615FnB7ThA5z2spa3p2uD0fqAbYkRLiKbOhh4Z6MDEeDKiqS+UILc e5+P9RExWG4nJOLcOPsG5g0L8jzUIZqAN/zkE8UpksSUEWUKJ/u1f6Y1gNSNfsiezakY 4ZiQlFQozGO3lJrYUao4WGMTDxb++SDpmwrJelF1n7ygQ2XwKsiIOZciSpqh6dmeU27/ GxclbQsuRxE7EkyOG92N0iz1t+HNvL9hT8IPnhnmzyyEVoZYKqHuocqUGmTLP74DzdXC Rfbj9HKCu6GyYVG6wveBBAlhXvW5VxAA+Eb4ERmfqjLGo8ZTjcGX7jnj2b2XQ7Wcp8z0 GqJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=STBCXX+YxOubTtmyOhc2nt2H6foNhK1GIU1SepTim7w=; fh=Vfi7X7wk5auoPmVIk0Ad1kCTr8kNgeGY/09ydAyO5yQ=; b=0zt5gNK1T1+lZH/Bp7/wVYfLucntMDtjp94zk/eQG6aqSZJHlpevH8NeJZeafkHVZ4 vSJiZ+QHhiI1v0pO4j6WijrMV42J2HfT+pEfvCzs55Xc6KLVYP1g0BfpdcQ7qEQu/uFN Ls2vABU3lzgvOmt05A2p6U7loNxet2Jpml8V2NxuYFty0KutU0jmfXpvpSyWayXQPlEZ blE/siI8QyngtnhLQvMSBKlFXbGqdKQ2IRBMn1xGVN7hvVc7DQOnp7bGTzmKHMRgrxL/ Jos7QfFkl2A/h43zWR5YRsv+mwbnIXnpjiL86qfDdVf9bU60o15QmLkCWeVYHv3WcCx7 GCBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="ZwY79/UJ"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-179969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179969-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a1e0cc1a2514c-7fb72e59829si1289534241.152.2024.05.15.07.05.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 07:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="ZwY79/UJ"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-179969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179969-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 16B351C21455 for ; Wed, 15 May 2024 14:05:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9885B13F42D; Wed, 15 May 2024 14:04:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZwY79/UJ" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24AD06214D; Wed, 15 May 2024 14:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715781888; cv=none; b=f0kXX0kbCgmr2XGWNfVmE1CSwuw50CYvAm0dm8l8IfctBStPDVNqpWDq+okgU/mnSJn1ag66S8MVrVVh/Y0BJ2BZrFQMeqhDBlgiCS7y3zZGXlZe6AmyiErNl3ifoH18mwJCFVV+Ek6gvhPcyCTalNUmrrLvrfCzPFpnOhfLuMU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715781888; c=relaxed/simple; bh=Is9J5YRpNzvklFE+cfQ23ylGaJ3nXqCLhHCxIrAy0f4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BpAEwhHXtgMQeJWvXRw0ezEYu/LT5OcgwXuuOFofMdjvTaJ5Nw2QPpLSzmUIyY1fWdoXzVz7KEn6//x3dhht+l/BY4Zqo6i+hPyD6S6oSdgfsLucSiIIhvyaZsPXube7zTTLI4b/MqxWjbYpfxh/d9SGhzPqbknJzvsgziOzr7U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ZwY79/UJ; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715781887; x=1747317887; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Is9J5YRpNzvklFE+cfQ23ylGaJ3nXqCLhHCxIrAy0f4=; b=ZwY79/UJODTXIOszgPAvXlQCE2CI+RHkktzaQ6hozv8XtIR+cj7P++B/ Ukrtl1Knv2Hvs2pxJeTPV+IbK8jdFBCe0siPMBEiTak303RVReFZFue3Y alUfMac48hun+x0VO7EYb8ZhJzs6u8yXHzFShYmK1PSGVlezPS3YSVcjP k+PEfkKj5vj2/npxoJdWCWZz/RIiwxNLfSHNNwffplHLM2tdllH5y2gzY mxqaSRt0wuiz6wZqS/3QVwtgnhsXCOkTfYwyROZ6Rmfq84rN60fRJmilV XWxA8tXBOVs/PbZZCGDhDCqmKh/nrntH3zzQ2NJJBEjhvEQ/Ac27yJFed A==; X-CSE-ConnectionGUID: +MS07ncgTK6Y9I9m1WYj9g== X-CSE-MsgGUID: EM2rUlSOTAiVu94RnD8guw== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="23234031" X-IronPort-AV: E=Sophos;i="6.08,162,1712646000"; d="scan'208";a="23234031" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 07:04:44 -0700 X-CSE-ConnectionGUID: ureli23YTFOv+UNUpcaPtw== X-CSE-MsgGUID: 4mxvp+5zQbCHGtglpG+BDA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,162,1712646000"; d="scan'208";a="35778478" Received: from wtcline-desk12.amr.corp.intel.com (HELO [10.125.108.49]) ([10.125.108.49]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 07:04:42 -0700 Message-ID: <4170720a-f7bb-484e-9235-a8720cec92c1@linux.intel.com> Date: Wed, 15 May 2024 09:04:41 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v15 00/16] Add audio support in v4l2 framework To: Jaroslav Kysela , Shengjiu Wang , =?UTF-8?Q?Amadeusz_S=C5=82awi=C5=84ski?= Cc: Hans Verkuil , Mauro Carvalho Chehab , Mark Brown , Takashi Iwai , Sebastian Fricke , Shengjiu Wang , sakari.ailus@iki.fi, tfiga@chromium.org, m.szyprowski@samsung.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org References: <1710834674-3285-1-git-send-email-shengjiu.wang@nxp.com> <20240430082112.jrovosb6lgblgpfg@basti-XPS-13-9310> <20240430172752.20ffcd56@sal.lan> <87sez0k661.wl-tiwai@suse.de> <20240502095956.0a8c5b26@sal.lan> <20240502102643.4ee7f6c2@sal.lan> <20240503094225.47fe4836@sal.lan> <22d94c69-7e9f-4aba-ae71-50cc2e5dd8ab@xs4all.nl> <51408e79-646d-4d23-bc5b-cd173d363327@linux.intel.com> <2f771fe9-7c09-4e74-9b04-de52581133fd@linux.intel.com> <28d423b1-49d8-4180-8394-622b1afd9cd9@perex.cz> Content-Language: en-US From: Pierre-Louis Bossart In-Reply-To: <28d423b1-49d8-4180-8394-622b1afd9cd9@perex.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 5/9/24 06:13, Jaroslav Kysela wrote: > On 09. 05. 24 12:44, Shengjiu Wang wrote: >>>> mem2mem is just like the decoder in the compress pipeline. which is >>>> one of the components in the pipeline. >>> >>> I was thinking of loopback with endpoints using compress streams, >>> without physical endpoint, something like: >>> >>> compress playback (to feed data from userspace) -> DSP (processing) -> >>> compress capture (send data back to userspace) >>> >>> Unless I'm missing something, you should be able to process data as fast >>> as you can feed it and consume it in such case. >>> >> >> Actually in the beginning I tried this,  but it did not work well. >> ALSA needs time control for playback and capture, playback and capture >> needs to synchronize.  Usually the playback and capture pipeline is >> independent in ALSA design,  but in this case, the playback and capture >> should synchronize, they are not independent. > > The core compress API core no strict timing constraints. You can > eventually0 have two half-duplex compress devices, if you like to have > really independent mechanism. If something is missing in API, you can > extend this API (like to inform the user space that it's a > producer/consumer processing without any relation to the real time). I > like this idea. The compress API was never intended to be used this way. It was meant to send compressed data to a DSP for rendering, and keep the host processor in a low-power state while the DSP local buffer was drained. There was no intent to do a loop back to the host, because that keeps the host in a high-power state and probably negates the power savings due to a DSP. The other problem with the loopback is that the compress stuff is usually a "Front-End" in ASoC/DPCM parlance, and we don't have a good way to do a loopback between Front-Ends. The entire framework is based on FEs being connected to BEs. One problem that I can see for ASRC is that it's not clear when the data will be completely processed on the "capture" stream when you stop the "playback" stream. There's a non-zero risk of having a truncated output or waiting for data that will never be generated. In other words, it might be possible to reuse/extend the compress API for a 'coprocessor' approach without any rendering to traditional interfaces, but it's uncharted territory.