fi
done
+dnl Max number of cards
+AC_MSG_CHECKING(for max number of cards)
+AC_ARG_WITH(max-cards,
+ AS_HELP_STRING([--with-max-cards], [Specify the max number of cards (default = 32)]),
+ [ max_cards="$withval" ], [ max_cards="32" ])
+AC_MSG_RESULT([$max_cards])
+
+if test "$max_cards" -lt 1; then
+ AC_ERROR([Invalid max cards $max_cards])
+elif test "$max_cards" -gt 256; then
+ AC_ERROR([Invalid max cards $max_cards])
+fi
+AC_DEFINE_UNQUOTED(SND_MAX_CARDS, $max_cards, [Max number of cards])
+
dnl Make a symlink for inclusion of alsa/xxx.h
if test ! -L "$srcdir"/include/alsa ; then
echo "Making a symlink include/alsa"
char *res = NULL;
int err;
- assert(card >= 0 && card <= 32);
+ assert(card >= 0 && card <= SND_MAX_CARDS);
err = open_ctl(card, &ctl);
if (err < 0) {
SNDERR("could not open control for card %i", card);
return -EINVAL;
card = *rcard;
card = card < 0 ? 0 : card + 1;
- for (; card < 32; card++) {
+ for (; card < SND_MAX_CARDS; card++) {
if (snd_card_load(card)) {
*rcard = card;
return 0;
(isdigit(*string) && isdigit(*(string + 1)) && *(string + 2) == 0)) {
if (sscanf(string, "%i", &card) != 1)
return -EINVAL;
- if (card < 0 || card > 31)
+ if (card < 0 || card >= SND_MAX_CARDS)
return -EINVAL;
err = snd_card_load1(card);
if (err >= 0)
}
if (string[0] == '/') /* device name */
return snd_card_load2(string);
- for (card = 0; card < 32; card++) {
+ for (card = 0; card < SND_MAX_CARDS; card++) {
#ifdef SUPPORT_ALOAD
if (! snd_card_load(card))
continue;
*handle = NULL;
- if (CHECK_SANITY(card < 0 || card >= 32)) {
+ if (CHECK_SANITY(card < 0 || card >= SND_MAX_CARDS)) {
SNDMSG("Invalid card index %d", card);
return -EINVAL;
}
*handle = NULL;
- if (card < 0 || card >= 32)
+ if (card < 0 || card >= SND_MAX_CARDS)
return -EINVAL;
sprintf(filename, SNDRV_FILE_HWDEP, card, device);
fd = snd_open_device(filename, mode);