From alsa-devel-owner@alsa.jcu.cz  Thu Jan 28 16:15:02 1999
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 QAA02340;
	Thu, 28 Jan 1999 16:13:10 +0100
Date: Thu, 28 Jan 1999 16:13:09 +0100 (CET)
From: Jaroslav Kysela <perex@jcu.cz>
To: Magnus Norddahl <mbn@dark.x.dtu.dk>
cc: alsa-devel@alsa.jcu.cz, Harald Kirsch <kir@iitb.fhg.de>
Subject: Re: alsa driver forgets settings between close and open
In-Reply-To: <19990128011914.C12308@dark.x.dtu.dk>
Message-ID: <Pine.LNX.3.96.990128160649.4780U-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 Thu, 28 Jan 1999, Magnus Norddahl wrote:

> Quoting Jaroslav Kysela (perex@jcu.cz):
> > > 
> > >  !!! every program interacting with the device must do its own setup !!!
> > > 
> > > On the other hand, if setting would be persistent after a close and a
> > > subsequent open by another program, it would be possible to have just
> > > one single program to set driver settings. After they are set as
> > > necessary, playback as well as recording could proceed with just cat, dd 
> > > or, in my own program, with a simple sequence of open/read,write/close.
> > > 
> > > Do you think it will be possible in the future to have pesistent
> > > settings in alsa?
> > 
> > No, I don't see any improvement of driver with this way.
> > Any comments from others?
> 
> I agree. It would be bad. Normally an application only changes the freq and
> the sample format (8 bit, 16 bit, stereo/mono). Therefore they expect all
> the other available parameters to have "logical default values" - so it has
> no reason to set these values.
> 
> If the driver didn't reset its settings, it could very easily happen, that
> an application forgets to set a parameter that is rarely used. The way it is
> right now, the application can be sure everything should sound like it was
> supposed to do.
> 
> Should such a feature be available, I recommend it is applied only to
> explicit selected applications, eg:
> 
> echo "NoReset cat cp" > /proc/asound/0/pcm0o

You are speaking about OSS emulation then this feature will break
compatibility with OSS. If we are speaking about ALSA native PCM
interface, I don't see any reason why implement this. I think that there
isn't any problem create some simple program which sets specific playback
or record parameters and write or read some data from or to stream.

To default ALSA parameters (when PCM device is open):

/dev/dsp		8-bit, 8000Hz, mono
/dev/dsp16		16-bit, 8000Hz, mono
/dev/audio		mu-Law, 8000Hz, mono
/dev/adsp		mu-Law, 8000Hz, mono

/dev/snd/pcmX		mu-Law, 8000Hz, mono

						Jaroslav

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


