Re: sb16 duplex for 2.1.125

Mikael Pettersson (mikpe@csd.uu.se)
Tue, 3 Nov 1998 11:14:37 +0100 (MET)


Simon Kirby writes:
> I believe this may be related to the same problem that happened in ALSA
> when a "fix" was applied to the driver that made full duplex work. Quake
> opens the sound port as O_RDWR, when it just needs O_WRONLY, and some
> sound cards (like my GUS classic) can't do 16 bit sampling (only 16 bit
> playback), so the initialization fails. I believe the workaround was to
> only initialize and open the record channel when it's actually used.

I just want to clarify one misconception I've seen in linux-kernel
several times: Quake _DOES_ need to open /dev/dsp O_RDWR.
The reason is that Quake does an mmap MAP_SHARED PROT_WRITE on the
file descriptor from opening /dev/dsp, and Linux' mmap requires
the file descriptor to admit reading, even when PROT_READ or
PROT_EXEC aren't set. (See mm/mmap.c around line 209.)

/Mikael

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/