All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: tiwai@suse.de, perex@perex.cz
Cc: alsa-devel@alsa-project.org
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	[thread overview]
Message-ID: <20210122082032.103066-1-o-takashi@sakamocchi.jp> (raw)

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 <o-takashi@sakamocchi.jp>
---
 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 <sound/info.h>
 #include <sound/control.h>
 
-/* 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 {
-- 
2.27.0


             reply	other threads:[~2021-01-22  8:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22  8:20 Takashi Sakamoto [this message]
2021-01-22 14:04 ` [PATCH] ALSA: control: expand limitation on the number of user-defined control element set per card Takashi Iwai
2021-01-23  3:10   ` Takashi Sakamoto
2021-01-23  9:10     ` Takashi Iwai
2021-01-23 10:25       ` Jaroslav Kysela
2021-01-24  5:52       ` Takashi Sakamoto
2021-01-24  7:49         ` Takashi Iwai
2021-01-25  0:56           ` Takashi Sakamoto
2021-01-25  7:09             ` Takashi Iwai
2021-01-26 15:57               ` Takashi Iwai
2021-01-26 16:25                 ` Jaroslav Kysela
2021-01-26 16:41                   ` Takashi Iwai
2021-01-26 17:02                     ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210122082032.103066-1-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.