From alsa-devel-owner@alsa.jcu.cz  Mon Mar 23 04:04:31 1998
Received: from sunu450.rz.ruhr-uni-bochum.de (sunu450.rz.ruhr-uni-bochum.de [134.147.222.33])
	by marvin.jcu.cz (8.8.8/8.8.8) with SMTP id EAA26171
	for <alsa-devel@jcu.cz>; Mon, 23 Mar 1998 04:03:04 +0100
Received: (qmail 28906 invoked from network); 23 Mar 1998 03:03:02 -0000
Received: from dialppp-1-45.rz.ruhr-uni-bochum.de (HELO localhost) (root@134.147.1.45)
  by mailhost.rz.ruhr-uni-bochum.de with SMTP; 23 Mar 1998 03:03:02 -0000
Received: by ruhr-uni-bochum.de
	via sendmail with stdio
	id <m0yGxVZ-000NLmC@localhost> (Debian Smail3.2.0.101)
	for alsa-devel@jcu.cz; Mon, 23 Mar 1998 04:02:41 +0100 (CET) 
Message-ID: <19980323040241.64574@flora>
Date: Mon, 23 Mar 1998 04:02:41 +0100
From: Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>
To: alsa-devel@jcu.cz
Subject: Re: C++ API premises...
References: <19980322022441.64619@flora> <Pine.LNX.3.96.980322110125.14568C-100000@entry.jcu.cz>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
In-Reply-To: <Pine.LNX.3.96.980322110125.14568C-100000@entry.jcu.cz>; from Jaroslav Kysela on Sun, Mar 22, 1998 at 11:24:27AM +0100
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Sun, Mar 22, 1998 at 11:24:27AM +0100, Jaroslav Kysela wrote:

> Note that PCM device is exclusively locked when you use PCM interface
> (not control interface)!!! Same situation maybe for future devices, too...
> Classes for all interfaces should be separated. You can assume that
> static info structures can't be changed while appropriate interface is
> opened. This affects all info structures:
> 
> snd_ctl_hw_info
> snd_mixer_info_t, snd_mixer_channel_info_t
> snd_pcm_info_t, snd_pcm_playback_info_t, snd_pcm_record_info_t

I thought about this. It seems that playback & record info require a valid
pcm handle. Jaroslav, is it possbile to move the playback & record info out
of the pcm code and in the control code? Another possibility (probably
easier to implement, if it is at all possible) would be a fourth open mode
SND_PCM_OPEN_INFO, that is non-blocking and allows only snd_pcm*info to be
called.

Thank you for implementing the snd_mixer_exact_mode() function. This is
all I needed to implement all three ways to set/get volume (exact,
percentage, decibel).

Another feature on my wishlist would be a more usable information field in
the structure snd_ctl_hw_info. I get "card1" as the id and
"Sound Blaster 16 at 0x220, irq 5, dma 1&5" as the name. Both are not very
useful for applications to display. If it is assured that the info part of
the name is always introduced by "at", this would probably be sufficient
(as this can be filtered).

A probably cleaner solution would be a char* array (similar to the error
messages) that is referenced by the type of the card (as defined in
sounddetect.h). the kernel driver code could reference this, too (I found 12
literal copies of "Sound Blaster 16" spreaded over the kernel code, namely
cards/sb16.c, detect/sb.c, lowlevel/sb/sb16.c, lowlevel/sb/sb.c, although
some of them have been suplemented by device names ("DSP")).

A second char* array could be provided with abbreviated names ("SB16").

I would volunteer for the boring work to replace all occurences of the
strings with references to the array (so you could keep going with the
important work).

Let me know how you think about it,
Marcus

-- 
"Rhubarb is no Egyptian god."        Debian GNU/Linux        finger brinkmd@ 
Marcus Brinkmann                   http://www.debian.org    master.debian.org
Marcus.Brinkmann@ruhr-uni-bochum.de                        for public  PGP Key
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       PGP Key ID 36E7CD09

