From alsa-devel-owner@alsa.jcu.cz  Sun Nov 29 11:02:52 1998
Received: from entry.jcu.cz (IDENT:perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id KAA07673;
	Sun, 29 Nov 1998 10:53:48 +0100
Date: Sun, 29 Nov 1998 10:53:48 +0100 (CET)
From: Jaroslav Kysela <perex@jcu.cz>
To: Stefan Linnemann <mazur@xs4all.nl>
cc: alsa-devel@jcu.cz
Subject: RE: MINOR numbers - READ PLEASE!!!
In-Reply-To: <XFMail.981127003620.mazur@xs4all.nl>
Message-ID: <Pine.LNX.3.96.981129104118.3605A-100000@entry.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Fri, 27 Nov 1998, Stefan Linnemann wrote:

> 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.

OK. I will accept this recommendation, althrough I'm not still sure with
this thing:

What we can do if soundcard hardware reach above per card limits? I mean
for example: Card can have 8 rawmidi devices (some special hardware
for MIDI), but we can acess only first four. Is somewhere precedens for
Linux how can be this problem solved by elegant way?

This way should work, but I'm not sure if is optimal:

open()			--> prepare for open, device will be open later
ioctl(SELECT_DEVICE, device);	--> here is real device open
... work with device ...
close()

Please, I welcome any feedback... These things are very important for
future.

							Jaroslav

-----
Jaroslav Kysela <perex@jcu.cz>
Academic Computer Centre, University of South Bohemia
Branisovska 31, C. Budejovice, CZ-370 05 Czech Republic


