Subject: Re: Time to fix a 25 year old misdesign
To: NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.ORG>
From: Lennart Augustsson <email@example.com>
Date: 10/18/2000 09:09:41
"Greg A. Woods" wrote:
> [ On Tuesday, October 17, 2000 at 23:16:33 (+0200), Lennart Augustsson wrote: ]
> > Subject: Re: Time to fix a 25 year old misdesign
> > I repeat again: I'm not interested in SIGIO and I don't know if Linux
> > emulation requires it.
> OK, then it was a really bad example.
I don't think so. It show something that's hard to get right in the
> However the audio driver is
> currently one of the abusers of SIGIO.
It sure is. :)
> > But Linux emulation does seem to require that
> > you can open a device independently for read and write. This cannot
> > be implemented with the current device driver API.
> Why not?
> A colleague suggested just forcing the device to be completely closed
> before allowing it to open again.
That's simply not good enough for all devices. I want to use this for
wsmux as well, and in the wsmux case requiring this would mean that
you could not switch from a virtual console running X to another and
then back (since X closes the mouse when you switch out and opens
it when you switch back in.)
> Fundamentally I don't see why the audio driver should try to force
> exclusive opens anyway -- if the user does something stupid and sends
> two incompatible streams to the same driver then a horrible noise will
> spew from the speakers and the user will learn his lesson. In a truly
> sane system something like NAS would be used to mediate access to such
> devices, just as the X11 server mediates access to keyboards, mice,
> frame buffers, and such. The current way audio is handled in many
> unix-like systems seems very primitive to me (my systems use NAS!).
Feel free to improve it. An alternative to NAS and similar programs
is to allow multiple opens of the audio device and let the kernel mix
the audio streams.