Subject: Re: audio open()/close() inconsistency
To: Aymeric Vincent <>
From: Quentin Garnier <>
List: tech-kern
Date: 09/16/2007 18:57:54
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Sep 16, 2007 at 06:52:04PM +0200, Aymeric Vincent wrote:
> Aymeric Vincent <> writes:
> > Quentin Garnier <> writes:
> >
> >> While I don't deny there might be a bug, your analysis is incorrect:
> >> the close() function from the cdevsw structure is called only once, wh=
> >> there is no remaining file descriptor using the device.
> >
> > Ah, you're right. Even if the device is opened once on /dev/audio0 and
> > once on /dev/sound0?
> Eh, actually, I think close() will be called anyway. I'm speaking of
> two completely different processes: they don't have file descriptors
> pointing to the same file description.
> Close() has to be called when either process quits otherwise recording
> or playing would still be active, although playing silence or dropping
> recorded data.

I'm not saying anything about what _should_ happen.  The fact is that
specfs code only calls the close() function for a given dev_t when the
device is actually meant to fall unused.

Granted, audio0 and sound0 are different nodes from specfs's POV.

Quentin Garnier - -
"You could have made it, spitting out benchmarks
Owe it to yourself not to fail"
Amplifico, Spitting Out Benchmarks, Hometakes Vol. 2, 2005.

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.6 (NetBSD)