Subject: Bugs in audio.c
To: None <tech-kern@netbsd.org>
From: Cliff Wright <cliff@snipe444.org>
List: tech-kern
Date: 02/02/2006 13:00:09
I just finished making patches to the Internet phone software minisip,
linphone, and asterisk(from pkgsrc for record) to get audio to work in oss emulation. I had
trouble at first getting the record to activate (it takes either a first
read, or setting pause to 0). The file audio.c has some clear bugs.
For example the ioctl AUDIO_FLUSH starts with:
rbus = sc->sc_rbus;
then later with no changes to either variable:
sc->sc_mode & AUMODE_RECORD) && !sc->sc_rbus && rbus /do activate record
Note that to cause activate to occur rbus must be the oppisite of sc->sc_rbus
but since they were set equal this is impossible. Similar code can be seen
in the audiosetinfo area (e.g. set block size). So the question arises
what was the intent, and what should the code do?
	Cliff Wright