Subject: Re: dev/audiobell.c proposal
To: NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.ORG>
From: Lennart Augustsson <lennart@augustsson.net>
List: tech-kern
Date: 01/14/2004 05:41:41
Greg A. Woods wrote:
> [ On Monday, January 12, 2004 at 00:06:58 (+0100), Lennart Augustsson wrote: ]
> 
>>Subject: Re: dev/audiobell.c proposal
>>
>>The current device driver arch. makes it very difficult to write
>>drivers that support multiple opens.  The problem is that the device
>>open routine as called on every opne, but close is only called on the
>>last close.  So trying to do book keeping on what's in use is hard.
> 
> 
> If that's a problem then you're doing something to the device state in
> your close() routine that you should not be doing, and/or you're trying
> to do too much through one device file.  You shouldn't need to do that
> kind of book keeping inside the driver.

So explain to me how a software mixer that mixes the sounds from all
open()s of /dev/audio is supposed to work without that book keeping.

As has been said, we need clonable device drivers.

	-- Lennart