All of lore.kernel.org
 help / color / mirror / Atom feed
* max SNDRV_CARDS bug ? questions ....
@ 2003-12-03 19:00 Benno Senoner
  2003-12-03 13:05 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Benno Senoner @ 2003-12-03 19:00 UTC (permalink / raw)
  To: alsa-devel

Hi,
(I'm using alsa-driver-1.0.0rc1)

I have a question about the SNDRV_CARDS.
normally it is defined as 8
./alsa-kernel/core/memalloc.c: #define SNDRV_CARDS     8

Does that mean we can have a maximum of 8 soundcards
in the PC or is this simply how many instances a certain module supports ?
(eg I could have 8 emu10k instances, 8 sb16 instances etc ?).

Plus I noticed something in

./alsa-kernel/core/memalloc.c: static int enable[8] = {[0 ... 
(SNDRV_CARDS-1)] = 1};

shouldn't that be:
static int enable[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};     ?

is this a bug ? what happens if we set SNDRV_CARDS to a value > 8 ?
Does this generate memory corruption problems ?
(keep in mind I'm not familiar with the alsa-driver sourcebase so I 
could say nonsense)

I grepped the entire source for 'enable[' and the only place where I 
found enable[8] was
in the ./alsa-kernel/core/memalloc.c file.

Basically the reason why I wrote this mail is to ask if I can use more than
8 snd-serialmidi devices.
Takashi gave me the module parameter options to make it work.
(BTWthanks Takashi ! :-) )

options snd-serialmidi enable=1,1,1,1 
sdev=/dev/ttyS2,/dev/ttyS3,/dev/ttyS4,/dev/ttyS5

but if you look at the drivers/serialmidi.c source
....
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;static char 
*sdev[SNDRV_CARDS] = {"/dev/ttyS0", [1 ... (SNDRV_CARDS - 1)] = ""};
....

all arrays are of size SNDRV_CARDS this means that I can have max 8 
serial devices.
So what do you suggest to allow for example 12 serial midi devices ? 
(via multi port serial card).
just set SNDRV_CARDS to 12 and fix the enable[8] statement in memalloc.c ?

Or should I simply use a local SNDRV_CARDS in serialmidi.c ? (eg #define 
SERIAL_SNDRV_CARDS 12) ?
(the latter is a hack so I guess it's more convenient to change the 
global SNDRV_CARDS define  right ?).

I posted this mail just to be sure that alsa does not becomes unstable 
or something breaks because of the
define change.

Let me know please.

thanks,
Benno
http://www.linuxsampler.org






-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-12-03 22:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-03 19:00 max SNDRV_CARDS bug ? questions Benno Senoner
2003-12-03 13:05 ` Takashi Iwai
2003-12-03 22:25   ` Max # of cards, pcm devices, midi devices Was: " Benno Senoner

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.