# HG changeset patch # User Gerd Moellmann # Date 993633756 0 # Node ID b9fdde642b13fe98d826b9e98c26323e804ac2a5 # Parent a4de79556592c1dd6533c6282266a55d0496c794 (vox_configure, vox_close): Turn off atimers around ioctls. diff -r a4de79556592 -r b9fdde642b13 src/sound.c --- a/src/sound.c Tue Jun 26 17:10:56 2001 +0000 +++ b/src/sound.c Wed Jun 27 09:22:36 2001 +0000 @@ -31,6 +31,7 @@ #include #include #include +#include /* FreeBSD has machine/soundcard.h. Voxware sound driver docs mention sys/soundcard.h. So, let's try whatever's there. */ @@ -411,7 +412,7 @@ { /* Open the sound file. */ s.fd = openp (Fcons (Vdata_directory, Qnil), - attrs[SOUND_FILE], "", &file, 0); + attrs[SOUND_FILE], "", &file, 0); if (s.fd < 0) sound_perror ("Open sound file"); @@ -764,6 +765,8 @@ xassert (sd->fd >= 0); + turn_on_atimers (0); + val = sd->format; if (ioctl (sd->fd, SNDCTL_DSP_SETFMT, &sd->format) < 0 || val != sd->format) @@ -791,6 +794,8 @@ /* This may fail if there is no mixer. Ignore the failure. */ ioctl (sd->fd, SOUND_MIXER_WRITE_PCM, &volume); } + + turn_on_atimers (1); } @@ -803,7 +808,9 @@ if (sd->fd >= 0) { /* Flush sound data, and reset the device. */ + turn_on_atimers (0); ioctl (sd->fd, SNDCTL_DSP_SYNC, NULL); + turn_on_atimers (1); /* Close the device. */ emacs_close (sd->fd);