From alsa-devel-owner@alsa.jcu.cz  Fri Nov 27 00:42:47 1998
Received: from smtp2.xs4all.nl (smtp2.xs4all.nl [194.109.6.52])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id AAA27857
	for <alsa-devel@jcu.cz>; Fri, 27 Nov 1998 00:39:46 +0100
Received: from mazur.xs4all.nl (root@mazur.xs4all.nl [194.109.83.90])
	by smtp2.xs4all.nl (8.8.8/8.8.8) with ESMTP id AAA18178
	for <alsa-devel@jcu.cz>; Fri, 27 Nov 1998 00:39:42 +0100 (CET)
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Message-ID: <XFMail.981127003620.mazur@xs4all.nl>
In-Reply-To: <Pine.LNX.3.96.981126185312.4393E-100000@entry.jcu.cz>
Date: Fri, 27 Nov 1998 00:39:38 +0100 (CET)
From: Stefan Linnemann <mazur@xs4all.nl>
To: alsa-devel@jcu.cz
Subject: RE: MINOR numbers - READ PLEASE!!!
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list


On 26-Nov-98 Jaroslav Kysela wrote:
>       I used little bit strong subject due to major thing for all kernel
> drivers.

So I'll put in my 2 cents.  :-)

> OK. Bellow is new minor number allocation proposal. Please, read this
> carefully and if you have some other ideas or changes - reply, please...
> This thing is very important (due to future limits).

> 0             1 sequencer
> 1-23          reserved
> 24-31         8 * 1 control interface
> 32-63         8 * 4 mixer devices
> 64-95         8 * 4 rawmidi devices
> 96-103                8 * 1 raw FM devices
> 104-127               reserved
> 128-255               8 * 16 PCM devices

> Y * X -> Y is max number of soundcards (always 8)
>        X is max number of devices per soundcard

> I prefer continuous regions for devices. Maybe we can use OSS-like
> mapping scheme - use 32 minors for one soundcard (0-31 = first soundcard, 
> 32-63 = second soundcard etc...).

As an old Unix hand I'd say: allocate first ranges among soundcards, then
within.  This is the usual way and makes for far easier programming.  Which
is probably why it is the usual way.  This would make, for instance:

0                       1 sequencer
32,64,96,128,160,192,224 unused? For 1 card at least it's the sequencer.
 1-31                   soundcard 1
33-63                   soundcard 2
65-95                   soundcard 3
(etc.)

Witin a soundcard:
1               control interface
2-5             4 mixer devices
6-9             4 rawmidi devices
10              1 raw FM devices
11-26           16 PCM devices
27-31           reserved

The actual device minor would become:
(soundcard_numner - 1) + 32 + device_nr_within

Or you could make the sequencer number 255 if you want to start with a 0 within
a soundcard.  The order of devices within is, of course, subject to taste. 
Since I don't program sound device drivers or clients, yet, I'll keep my mouth
closed on that.

Thanks for all the good work,
Stefan.
[Listening to Tanita Tikaram through his ALSA driven Yamaha OPL3-SA3.  :-) ]
---
Stefan Linnemann                Work:    mazur@sara.nl
Systems programmer Unix         Private: mazur@xs4all.nl
                                http://www.xs4all.nl/~mazur/

