From alsa-devel-owner@alsa.jcu.cz  Thu Jan 28 03:40:36 1999
Received: from dark.x.dtu.dk (IDENT:qmailr@dark.x.dtu.dk [130.225.92.246])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id DAA09677
	for <alsa-devel@alsa.jcu.cz>; Thu, 28 Jan 1999 03:38:55 +0100
Received: (qmail 15242 invoked by uid 506); 28 Jan 1999 02:38:45 -0000
Date: Thu, 28 Jan 1999 03:38:45 +0100
From: Magnus Norddahl <mbn@dark.x.dtu.dk>
To: alsa-devel@alsa.jcu.cz
Subject: Re: alsa driver forgets settings between close and open
Message-ID: <19990128033845.A14935@dark.x.dtu.dk>
References: <19990128020152.A13252@dark.x.dtu.dk> <Pine.GSO.4.05.9901280231080.25583-100000@galjas.cs.vu.nl>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
In-Reply-To: <Pine.GSO.4.05.9901280231080.25583-100000@galjas.cs.vu.nl>; from Andy Lo A Foe on Thu, Jan 28, 1999 at 02:33:13AM +0100
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

Quoting Andy Lo A Foe (arloafoe@cs.vu.nl):

> > Don't be too sure about that. I doubt must applications would reset eg. the
> > fragment size or count after a game has been run.
> 
> Aren't those programs then "broken"? :)

No, I don't think so. Normally the fragment size and count are set to values
that is good for the sound driver. Therefore an application should not change
these values unless it has a good reason to do so. I mention games because
they need a very low latency when playing data - unlike most other
applications.

Also remember that it is impossible for applications to set the default
values of settings that are not yet available in the API. Imagine we of some
odd reason made an API extension that doubled the playback speed, older
applications cannot set this new API value to something logical, simply
because it didn't exist when application was written.

> But seriously, is there a default state documented somewhere?

The default state is 8 kHz and 8 bit sample resolution. According to the
OSS documentation (http://www.opensound.com/pguide/audio.html):

---
Explicitly set all parameters your program depends on. There are default
values for all parameters but it is possible that some (future) devices may
not support them. For example the default sampling speed (8 kHz) or sampling
resolution (8 bits) may not be supported by some high end professional
devices.
---

In general I think you can be quite sure all application set these:

 * sample format
 * mono/stereo
 * sample rate

But when dealing with more advanced features, the applications only touch
the settings if they are not satisfied with the defaults.

-- 
Magnus Norddahl
ClanSoft

