mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Allow specifying the max number of cards
Add --with-max-cards option to specify the max number of cards in configure script, when the support for more than 32 cards is required. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
14d653d7c3
commit
2f43b66c06
5 changed files with 20 additions and 6 deletions
14
configure.in
14
configure.in
|
|
@ -632,6 +632,20 @@ for t in $CTL_PLUGIN_LIST; do
|
||||||
fi
|
fi
|
||||||
done
|
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
|
dnl Make a symlink for inclusion of alsa/xxx.h
|
||||||
if test ! -L "$srcdir"/include/alsa ; then
|
if test ! -L "$srcdir"/include/alsa ; then
|
||||||
echo "Making a symlink include/alsa"
|
echo "Making a symlink include/alsa"
|
||||||
|
|
|
||||||
|
|
@ -668,7 +668,7 @@ int snd_determine_driver(int card, char **driver)
|
||||||
char *res = NULL;
|
char *res = NULL;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
assert(card >= 0 && card <= 32);
|
assert(card >= 0 && card <= SND_MAX_CARDS);
|
||||||
err = open_ctl(card, &ctl);
|
err = open_ctl(card, &ctl);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
SNDERR("could not open control for card %i", card);
|
SNDERR("could not open control for card %i", card);
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ int snd_card_next(int *rcard)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
card = *rcard;
|
card = *rcard;
|
||||||
card = card < 0 ? 0 : card + 1;
|
card = card < 0 ? 0 : card + 1;
|
||||||
for (; card < 32; card++) {
|
for (; card < SND_MAX_CARDS; card++) {
|
||||||
if (snd_card_load(card)) {
|
if (snd_card_load(card)) {
|
||||||
*rcard = card;
|
*rcard = card;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -134,7 +134,7 @@ int snd_card_get_index(const char *string)
|
||||||
(isdigit(*string) && isdigit(*(string + 1)) && *(string + 2) == 0)) {
|
(isdigit(*string) && isdigit(*(string + 1)) && *(string + 2) == 0)) {
|
||||||
if (sscanf(string, "%i", &card) != 1)
|
if (sscanf(string, "%i", &card) != 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (card < 0 || card > 31)
|
if (card < 0 || card >= SND_MAX_CARDS)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
err = snd_card_load1(card);
|
err = snd_card_load1(card);
|
||||||
if (err >= 0)
|
if (err >= 0)
|
||||||
|
|
@ -143,7 +143,7 @@ int snd_card_get_index(const char *string)
|
||||||
}
|
}
|
||||||
if (string[0] == '/') /* device name */
|
if (string[0] == '/') /* device name */
|
||||||
return snd_card_load2(string);
|
return snd_card_load2(string);
|
||||||
for (card = 0; card < 32; card++) {
|
for (card = 0; card < SND_MAX_CARDS; card++) {
|
||||||
#ifdef SUPPORT_ALOAD
|
#ifdef SUPPORT_ALOAD
|
||||||
if (! snd_card_load(card))
|
if (! snd_card_load(card))
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -382,7 +382,7 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
|
||||||
|
|
||||||
*handle = NULL;
|
*handle = NULL;
|
||||||
|
|
||||||
if (CHECK_SANITY(card < 0 || card >= 32)) {
|
if (CHECK_SANITY(card < 0 || card >= SND_MAX_CARDS)) {
|
||||||
SNDMSG("Invalid card index %d", card);
|
SNDMSG("Invalid card index %d", card);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ int snd_hwdep_hw_open(snd_hwdep_t **handle, const char *name, int card, int devi
|
||||||
|
|
||||||
*handle = NULL;
|
*handle = NULL;
|
||||||
|
|
||||||
if (card < 0 || card >= 32)
|
if (card < 0 || card >= SND_MAX_CARDS)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
sprintf(filename, SNDRV_FILE_HWDEP, card, device);
|
sprintf(filename, SNDRV_FILE_HWDEP, card, device);
|
||||||
fd = snd_open_device(filename, mode);
|
fd = snd_open_device(filename, mode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue