Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 556CAC433E0 for ; Tue, 2 Feb 2021 08:13:35 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DAAE964EE9 for ; Tue, 2 Feb 2021 08:13:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DAAE964EE9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=axis.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 604101774; Tue, 2 Feb 2021 09:12:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 604101774 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1612253611; bh=SdbfCq6OO7kXXsjlO6G/ccKzfpcaIE1PianSX5xM2Ow=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eJigctW9LnILPWJEw53tuSHv1/kEp/rRBO3O/Y+Wk8NmAd9D9vOl+2G+XUFLy6j0S q1dJWmXyzjSzO2quZflBdhibxBAB2mEgUpbCas3CTJVzZUk1g09dtttDi9Fx5oC7Jd 7zx1E1+wvp+oFvGxU76Sr5SVSUl66mBaoudjdyNI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D9176F8013C; Tue, 2 Feb 2021 09:12:40 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 21F5DF80171; Tue, 2 Feb 2021 09:12:39 +0100 (CET) Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) (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 F055BF8013C for ; Tue, 2 Feb 2021 09:12:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F055BF8013C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=axis.com header.i=@axis.com header.b="eNL6GGdq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1612253554; x=1643789554; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=JomFmvAcqxcgt+Zf459veOHN7JFBnYNS2auowOkKYUQ=; b=eNL6GGdqcYbTgD8njStrVKlt7np0SPZUEkqtPqdKNIsD7hFlAC3PRfTg CoGOqph3F4K5khb7VMmK2Z1j36EgyTHcIpUR3sKuF+uhL85VckhpavvfU B5K1qCKMrwWJsBWk97wuiMnJMaDCydzfejgXRuac4lJqX8bSoTiEGMcLc OL9VlvDLH5Q+vruzsrkq+wqelX1P48NE1RFs8NUU32gnewnudhGH2pdDb yZQYzhoGVSP+woKKjNs30wwbvj4k97JY93YHZmJph9F5PrBR5xEJsi+Y3 oOS13U7TZTk1u/xIwahrbMNHHR3qOjRBT9pjuVmbH9ANBsk3oK9KYaodi g==; Subject: Re: [PATCH] Add support to expose controls of ladspa plugin To: Jaroslav Kysela , Camel Guo References: <20210201150352.6342-1-camel.guo@axis.com> From: Camel Guo Message-ID: <23722bcd-a592-662b-2179-a0c607117a96@axis.com> Date: Tue, 2 Feb 2021 09:12:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: XBOX04.axis.com (10.0.5.18) To xbox06.axis.com (10.0.15.176) Cc: Takashi Iwai , ALSA development 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" On 2/1/21 4:32 PM, Jaroslav Kysela wrote: > Dne 01. 02. 21 v 16:03 Camel Guo napsal(a): >> From: Camel Guo >> >> In order for external software components to adjust ladspa plugin >> dynamically, this commit adds an option to exposes the control array of >> input control ports of a ladspa plugin to a file, through which any >> applications with proper permission can control this plugin. > > It looks like a pure hack (although the implementation is interesting). The > controls may be exposed via the ctl (control) API like we do in > src/pcm/pcm_softvol.c for example. The floats can be mapped to integer64 > or we > may discuss to add the float type to the control API elements. If there are not so many input controls of a ladspa plugin, I think it is okay to implement it like pcm_softvol.c. But the problem is that some plugins might have more than 100 input controls. For every input control, there will be a system call ioctl in order to get its value. This will make performance really bad. If a ladspa plugin like this needs to support per-channel control, that will make it even worst. But with shared memory like this, it will become a pure memory read, this will make performance acceptable. Another benefit of exposing ladspa control array to shared memory is that it makes it possible for any algorithms to connect with these ladspa plugins. The ladspa control array is basically a float-array, which is exactly the input, output of lots of machine learning, deep learning algorithm. Imagine an algorithm listening to the audio stream automatically applies privacy masks on audio stream to mask human voice via ladspa plugins. > >                                                 Jaroslav > > -- > Jaroslav Kysela > Linux Sound Maintainer; ALSA Project; Red Hat, Inc.