From patchwork Fri Jan 22 08:20:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 369497 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=-23.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 65928C433DB for ; Fri, 22 Jan 2021 08:21:49 +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 E703C235FF for ; Fri, 22 Jan 2021 08:21:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E703C235FF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sakamocchi.jp 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 90D6B1AB1; Fri, 22 Jan 2021 09:20:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 90D6B1AB1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611303704; bh=xVpyiGavKzugtSEPjkndkzy7/xRspIzMV64OlFFGqvo=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=IvoXno+/IZFV+RhhKbbjnxzPhVaMJGNgM8o2qDjT5+CevID0vWGKmQUjuXK5vjx9Q bnHsIAB2Hysd1sVXksE85AdajSvz5WDqHJwpw6Bp2Qw6lV2smcSTvyLCKkpKtjw71e JrGIU48LC9F8F+VFTsBnAgRRp7qgY4EOencGvbV0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 75624F80164; Fri, 22 Jan 2021 09:20:53 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CF7BAF8016E; Fri, 22 Jan 2021 09:20:50 +0100 (CET) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 590B5F80164 for ; Fri, 22 Jan 2021 09:20:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 590B5F80164 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="inYVt6M3"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="SnpIsmJF" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 3B86419FE; Fri, 22 Jan 2021 03:20:39 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 22 Jan 2021 03:20:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=/Y2i0wkmpuKOZp4lxDb1+tBNwX JzAw4MjxV4JXu4qGo=; b=inYVt6M3FqU89TrZ1fn+XXuZyZQtp3zu1qgOdjYIk1 bHnD51Cv/1wQIVGMf4XrKQjRyzwlbnGDGvvJXskdXCYEru1TdLwat1B/994vncnB lGNFSt/UOGtIOdUvrPfulxtbHUyjCwYW+B88r+maq7xDuke5wFLlUfQ3Zc2MRPWK zQgCQeBWsxMDPAshIamG9VVFAK6BCehM3WUjaReN06KL5+uYN8tMsK8sMPMLOO/z n9d7DmrLIQKrTD2S0AyU3Pl7cWlu60w1OpJn61gbX7/6qEtWt5jpN/Kb9HRe+INg AfRrNiQiS+P2FgBvIspiBXrWpESfXxmKRo81xU8XAVkQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=/Y2i0wkmpuKOZp4lx Db1+tBNwXJzAw4MjxV4JXu4qGo=; b=SnpIsmJFIpfP34TaAkTI5BMwX4/r4zrYh 0qb6XGKhnlMe8luM801Nlgmx6ovs+jgi5Qnfl9W+Mc9BYNWeIPNNJY/rRxo/Yirz J/TxgBDN4vPSS93MYRsOXVyvEMLR+iq3EbTZiB2lb6buGsZrQsdwLpY0ZJD+OL4f GnzdwAJuc+KwMLhvT0HsxwigNgL45omQgqLlsjADndCvZmTwX8XPyZ2M8stVMIdJ TR8dSTIYOtmFgCLzoYJPfNDVgHtNBGERLhethtMUB8oFgyVy+OHdlGSiOuMR/y4I T0pw5tURq8PJKkNG+oZGggQMzBdKvJIxHz49hzKGHQn3VoEow55xQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehgdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepvfgrkhgrshhhihcuufgrkhgrmhhothhouceoohdqthgrkhgrshhh ihesshgrkhgrmhhotggthhhirdhjpheqnecuggftrfgrthhtvghrnhepvddtgeegjeejte ejudffhfduvdefhfevhfelleevfeefhfelhefhgeeufeetvdehnecuffhomhgrihhnpehg ihhthhhusgdrtghomhenucfkphepuddukedrvdegfedrjeekrdehkeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhisehs rghkrghmohgttghhihdrjhhp X-ME-Proxy: Received: from workstation.flets-east.jp (y078058.dynamic.ppp.asahi-net.or.jp [118.243.78.58]) by mail.messagingengine.com (Postfix) with ESMTPA id F1D7F108005B; Fri, 22 Jan 2021 03:20:36 -0500 (EST) From: Takashi Sakamoto To: tiwai@suse.de, perex@perex.cz Subject: [PATCH] ALSA: control: expand limitation on the number of user-defined control element set per card Date: Fri, 22 Jan 2021 17:20:32 +0900 Message-Id: <20210122082032.103066-1-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org 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" ALSA control core allows usespace application to register control element set by call of ioctl(2) with SNDRV_CTL_IOCTL_ELEM_ADD request. The added control elements are called as 'user-defined'. Currently sound card has limitation on the number of the user-defined control element set up to 32. The limitation is inconvenient to drivers in ALSA firewire stack since the drivers expect userspace applications to implement function to control device functionalities such as mixing and routing. As the userspace application, snd-firewire-ctl-services project starts: https://github.com/alsa-project/snd-firewire-ctl-services/ The project supports many devices supported by ALSA firewire stack. The limitation is mostly good since routing and mixing controls can be represented by control element set, which includes multiple control element with the same parameters. Nevertheless, it's actually inconvenient to device which has many varied functionalities. For example, plugin effect such as channel strip and reverb has many parameters. For the case, many control elements are required to configure the parameters and control element set cannot aggregates them for the parameters. At present, the implementations for below models requires more control element sets than 32: * snd-bebob-ctl-service * Apogee Ensemble (31 sets for 34 elements) * snd-dice-ctl-service * TC Electronic Konnekt 24d (78 sets for 94 elements) * TC Electronic Studio Konnekt 48 (98 sets for 114 elements) * TC Electronic Konnekt Live (88 sets for 104 elements) * TC Electronic Impact Twin (70 sets for 86 elements) * Focusrite Liquid Saffire 56 (37 sets for 52 elements) This commit expands the limitation according to requirement from the above applications. As a result, userspace applications can add control element sets up to 150 per sound card. It results in 154,200 user-defined control elements as maximum since one control element set can include 1028 control elements. The new limitation is decided without comprehensive criteria to sound card. It could be changed according to requirement from the other type of userspace applications. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai Signed-off-by: Takashi Iwai --- sound/core/control.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/core/control.c b/sound/core/control.c index 5165741a8400..5a19bde27830 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -18,8 +18,13 @@ #include #include -/* max number of user-defined controls */ -#define MAX_USER_CONTROLS 32 +// The maximum number of control element sets per sound card added by +// userspace applications. The value is decided just to satisfy requirement +// from control service programs in userspace for devices supported by +// drivers in ALSA firewire stack. It's possible to relax the limitation +// according to requirements from the other kind of applications. +#define MAX_USER_CONTROLS 150 + #define MAX_CONTROL_COUNT 1028 struct snd_kctl_ioctl {