From b5cb1ada6a97e1a6d3eb28145608c183678f9784 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Wed, 27 Jun 2001 09:23:06 +0000 Subject: [PATCH] (vox_configure, vox_close): Turn off atimers around ioctls. --- src/ChangeLog | 5 +++++ src/sound.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 46986d2fb5a..2773553d7a5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-06-27 Gerd Moellmann + + * sound.c (vox_configure, vox_close): Turn off atimers + around ioctls. + 2001-06-26 Gerd Moellmann * keyboard.c (read_char) : Record the previous idle diff --git a/src/sound.c b/src/sound.c index 4e61a1f8f25..67d12bf36a9 100644 --- a/src/sound.c +++ b/src/sound.c @@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA. */ #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 @@ a system-dependent default device name is used.") { /* 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 @@ vox_configure (sd) 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 @@ vox_configure (sd) /* 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 @@ vox_close (sd) 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); -- 2.39.5