Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1879593lqa; Tue, 30 Apr 2024 01:47:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDsOgimf9jNllhcxcGf/OxA2JlDOmM1FJuMa3Wcg2LydxYywN30qVHkbEGCParWZJ/T3xr3zt1Z0KPV8CHcqAwXuAnFw7Pm/zI87Pofg== X-Google-Smtp-Source: AGHT+IGWmsWenxqwUs+gqdeXqNKGrPqBUERWRHKIuW3yrcgCmqd4iOwocOwnIumrUZwfesYjRznQ X-Received: by 2002:a50:ab53:0:b0:570:17a:b1f6 with SMTP id t19-20020a50ab53000000b00570017ab1f6mr2100629edc.6.1714466854943; Tue, 30 Apr 2024 01:47:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714466854; cv=pass; d=google.com; s=arc-20160816; b=dZp0jKNEYYSbCOBjjr1JmjNaBoFymIflzapVNRSKnLzqFcITbxTQvdQaOo352gaHAi TsDl4C1T4XApMJCPjgSk+02SWfF819Vg+nYGvfFQN4oYnJElSp/Bbu7I6fQz2zgCxnQY 6YQLSA0j0MJ42V8CjmZlImsgcH9N36Xevf9QFLq9U6Gnjx9xnx35T+zNargZKSODjmx6 h2jcU2/8mCjtWzq/bDB5/grBHRkgZxi/0isp5j2ilfd61COhqxcGoBBkrfcbO/JqjIAL joosDiVrcLiep+88xZZkPo3DUOaaPzBEMBfSHcoyVNVRhRPKI4QVXGqri0uQEpZmD8h+ 107g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=ut3PXyh2iJuDC5dWagty85x4oUKE8/KXdGwXkKxohMY=; fh=TZLQpKLnjPS+TYOiw+wwdTOC6qOPwk3SiKPWLYfOMX4=; b=uRTwNBdQzbO64hhKjiKdY8IoPFw0bnKssOjhNH9UsmXfmPuRGuoisxIPRIfWgusT0+ c2/EUa7SSQ6LqUpQy8KWuVIJlPh7MOexgCUUHfUA/NTH4GdhRdnO9UlYB8QUPqMFDhin Yn0Sjr018ipJu/kOxUdhbd+iNx99t02tqniec+iTSjhGjR2/c8SnrUMo4mSZWjm6AidA 3yMilL2ujiAAWjyGbj0MKJex/c1RPd/oAUq9XLlK1isUKsr4rpiUGzeXSB5MV/S0eoXE r78Hn4A/QLg9OjuSWfUr0Wahd+GCBIVb+ywBMpKp/qGwKBE2kSoKS0gLOkFgurPYpnm4 3I4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-163572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163572-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l15-20020a056402124f00b005727dc27af6si2563228edw.189.2024.04.30.01.47.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 01:47:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-163572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163572-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl 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 am.mirrors.kernel.org (Postfix) with ESMTPS id A7A681F23E48 for ; Tue, 30 Apr 2024 08:47:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D28D6127B68; Tue, 30 Apr 2024 08:47:19 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 25E673AC16; Tue, 30 Apr 2024 08:47:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466839; cv=none; b=S6uMT2yB48R3/SrejRyDrrxmFKAqjqHdPqGNewneH7oyBzWI+4bVR5JgNOlbaGDL95YCzOCNcfT5+REuhg8T7GPTRM8R2zR3o+0fXN4wobnPGrgjmEXTfNkW1eTb0np+0GvHEaCCgbrWzuw+lPl6kEQPgS7WBA4np8YJwM6TrtY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466839; c=relaxed/simple; bh=778E1c8iAZG0ACA+zRws4wbilA1ZAtTXpb/AFIFHd3E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aVuwi6iqsFK6e4grFOgrTmG+MZ7eeeLcNsdX2EXk9xOcIOUxoZYxRtAEvn2yqCPV2Vtbi+1dFuKJzDhTK9wx4qWsqEI+XvmGRkx+YkuCSr98hVIMC138+37b/1FyxX9WL54lB3zLpvWVzx6ELnOjyxpJ+SDxCI1JtKI+kxyDrAg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C809C2BBFC; Tue, 30 Apr 2024 08:47:14 +0000 (UTC) Message-ID: <32d0c83c-4d0c-4d22-b2f1-d03d075f4898@xs4all.nl> Date: Tue, 30 Apr 2024 10:47:13 +0200 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 Content-Language: en-US, nl To: Sebastian Fricke , Shengjiu Wang Cc: sakari.ailus@iki.fi, tfiga@chromium.org, m.szyprowski@samsung.com, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, 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> From: Hans Verkuil Autocrypt: addr=hverkuil@xs4all.nl; keydata= xsFNBFQ84W0BEAC7EF1iL4s3tY8cRTVkJT/297h0Hz0ypA+ByVM4CdU9sN6ua/YoFlr9k0K4 BFUlg7JzJoUuRbKxkYb8mmqOe722j7N3HO8+ofnio5cAP5W0WwDpM0kM84BeHU0aPSTsWiGR yw55SOK2JBSq7hueotWLfJLobMWhQii0Zd83hGT9SIt9uHaHjgwmtTH7MSTIiaY6N14nw2Ud C6Uykc1va0Wqqc2ov5ihgk/2k2SKa02ookQI3e79laOrbZl5BOXNKR9LguuOZdX4XYR3Zi6/ BsJ7pVCK9xkiVf8svlEl94IHb+sa1KrlgGv3fn5xgzDw8Z222TfFceDL/2EzUyTdWc4GaPMC E/c1B4UOle6ZHg02+I8tZicjzj5+yffv1lB5A1btG+AmoZrgf0X2O1B96fqgHx8w9PIpVERN YsmkfxvhfP3MO3oHh8UY1OLKdlKamMneCLk2up1Zlli347KMjHAVjBAiy8qOgu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rAV36SvLFfuMhyCAxV6WBlQc85ArOiQZB Wm7L0repwr7zEJFEkdy8C81WRhMdPvHkAIh3RoY1SGcdB7rB3wCzfYkAuCBqaF7Zgfw8xkad KEiQTexRbM1sc/I8ACpla3N26SfQwrfg6V7TIoweP0RwDrcf5PVvwSWsRQp2LxFCkwnCXOra gYmkrmv0duG1FStpY+IIQn1TOkuXrciTVfZY1cZD0aVxwlxXBnUNZZNslldvXFtndxR0SFat sflovhDxKyhFwXOP0Rv8H378/+14TaykknRBIKEc0+lcr+EMOSUR5eg4aURb8Gc3Uc7fgQ6q UssTXzHPyj1hAyDpfu8DzAwlh4kKFTodxSsKAjI45SLjadSc94/5Gy8645Y1KgBzBPTH7Q== In-Reply-To: <20240430082112.jrovosb6lgblgpfg@basti-XPS-13-9310> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 30/04/2024 10:21, Sebastian Fricke wrote: > Hey Shengjiu, > > first of all thanks for all of this work and I am very sorry for only > emerging this late into the series, I sadly didn't notice it earlier. > > I would like to voice a few concerns about the general idea of adding > Audio support to the Media subsystem. > > 1. The biggest objection is, that the Linux Kernel has a subsystem > specifically targeted for audio devices, adding support for these > devices in another subsystem are counterproductive as they work around > the shortcomings of the audio subsystem while forcing support for a > device into a subsystem that was never designed for such devices. > Instead, the audio subsystem has to be adjusted to be able to support > all of the required workflows, otherwise, the next audio driver with > similar requirements will have to move to the media subsystem as well, > the audio subsystem would then never experience the required change and > soon we would have two audio subsystems. > > 2. Closely connected to the previous objection, the media subsystem with > its current staff of maintainers is overworked and barely capable of > handling the workload, which includes an abundance of different devices > from DVB, codecs, cameras, PCI devices, radio tuners, HDMI CEC, IR > receivers, etc. Adding more device types to this matrix will make the > situation worse and should only be done with a plan for how first to > improve the current maintainer situation. > > 3. By using the same framework and APIs as the video codecs, the audio > codecs are going to cause extra work for the video codec developers and > maintainers simply by occupying the same space that was orginally > designed for the purpose of video only. Even if you try to not cause any > extra stress the simple presence of the audio code in the codebase is > going to cause restrictions. > > The main issue here is that the audio subsystem doesn't provide a > mem2mem framework and I would say you are in luck because the media > subsystem has gathered a lot of shortcomings with its current > implementation of the mem2mem framework over time, which is why a new > implementation will be necessary anyway. > > So instead of hammering a driver into the wrong destination, I would > suggest bundling our forces and implementing a general memory-to-memory > framework that both the media and the audio subsystem can use, that > addresses the current shortcomings of the implementation and allows you > to upload the driver where it is supposed to be. > This is going to cause restrictions as well, like mentioned in the > concern number 3, but with the difference that we can make a general > plan for such a framework that accomodates lots of use cases and each > subsystem can add their routines on top of the general framework. > > Another possible alternative is to try and make the DRM scheduler more > generally available, this scheduler is the most mature and in fact is > very similar to what you and what the media devices need. > Which again just shows how common your usecase actually is and how a > general solution is the best long term solution. > > Please notice that Daniel Almeida is currently working on something > related to this: > https://lore.kernel.org/linux-media/3F80AC0D-DCAA-4EDE-BF58-BB1369C7EDCA@collabora.com/T/#u > > If the toplevel maintainers decide to add the patchset so be it, but I > wanted to voice my concerns and also highlight that this is likely going > to cause extra stress for the video codecs maintainers and the > maintainers in general. We cannot spend a lot of time on audio codecs, > as video codecs already fill up our available time sufficiently, > so the use of the framework needs to be conservative and cause as little > extra work as possible for the original use case of the framework. I would really like to get the input of the audio maintainers on this. Sebastian has a good point, especially with us being overworked :-) Having a shared mem2mem framework would certainly be nice, on the other hand, developing that will most likely take a substantial amount of time. Perhaps it is possible to copy the current media v4l2-mem2mem.c and turn it into an alsa-mem2mem.c? I really do not know enough about the alsa subsystem to tell if that is possible. While this driver is a rate converter, not an audio codec, the same principles would apply to off-line audio codecs as well. And it is true that we definitely do not want to support audio codecs in the media subsystem. Accepting this driver creates a precedent and would open the door for audio codecs. I may have been too hasty in saying yes to this, I did not consider the wider implications for our workload and what it can lead to. I sincerely apologize to Shengjiu Wang as it is no fun to end up in a situation like this. Regards, Hans