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 {