aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2001-06-27 09:23:06 +0000
committerGerd Moellmann2001-06-27 09:23:06 +0000
commitb5cb1ada6a97e1a6d3eb28145608c183678f9784 (patch)
treece268c46a49a39f00a706abd64d7153a4eb73ef8 /src
parent7994d91a523be9058c62178d0f40d42ce860e2e4 (diff)
downloademacs-b5cb1ada6a97e1a6d3eb28145608c183678f9784.tar.gz
emacs-b5cb1ada6a97e1a6d3eb28145608c183678f9784.zip
(vox_configure, vox_close): Turn off atimers
around ioctls.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/sound.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 46986d2fb5a..2773553d7a5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12001-06-27 Gerd Moellmann <gerd@gnu.org>
2
3 * sound.c (vox_configure, vox_close): Turn off atimers
4 around ioctls.
5
12001-06-26 Gerd Moellmann <gerd@gnu.org> 62001-06-26 Gerd Moellmann <gerd@gnu.org>
2 7
3 * keyboard.c (read_char) <non_reread>: Record the previous idle 8 * keyboard.c (read_char) <non_reread>: 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. */
31#include <sys/types.h> 31#include <sys/types.h>
32#include <dispextern.h> 32#include <dispextern.h>
33#include <errno.h> 33#include <errno.h>
34#include <atimer.h>
34 35
35/* FreeBSD has machine/soundcard.h. Voxware sound driver docs mention 36/* FreeBSD has machine/soundcard.h. Voxware sound driver docs mention
36 sys/soundcard.h. So, let's try whatever's there. */ 37 sys/soundcard.h. So, let's try whatever's there. */
@@ -411,7 +412,7 @@ a system-dependent default device name is used.")
411 { 412 {
412 /* Open the sound file. */ 413 /* Open the sound file. */
413 s.fd = openp (Fcons (Vdata_directory, Qnil), 414 s.fd = openp (Fcons (Vdata_directory, Qnil),
414 attrs[SOUND_FILE], "", &file, 0); 415 attrs[SOUND_FILE], "", &file, 0);
415 if (s.fd < 0) 416 if (s.fd < 0)
416 sound_perror ("Open sound file"); 417 sound_perror ("Open sound file");
417 418
@@ -764,6 +765,8 @@ vox_configure (sd)
764 765
765 xassert (sd->fd >= 0); 766 xassert (sd->fd >= 0);
766 767
768 turn_on_atimers (0);
769
767 val = sd->format; 770 val = sd->format;
768 if (ioctl (sd->fd, SNDCTL_DSP_SETFMT, &sd->format) < 0 771 if (ioctl (sd->fd, SNDCTL_DSP_SETFMT, &sd->format) < 0
769 || val != sd->format) 772 || val != sd->format)
@@ -791,6 +794,8 @@ vox_configure (sd)
791 /* This may fail if there is no mixer. Ignore the failure. */ 794 /* This may fail if there is no mixer. Ignore the failure. */
792 ioctl (sd->fd, SOUND_MIXER_WRITE_PCM, &volume); 795 ioctl (sd->fd, SOUND_MIXER_WRITE_PCM, &volume);
793 } 796 }
797
798 turn_on_atimers (1);
794} 799}
795 800
796 801
@@ -803,7 +808,9 @@ vox_close (sd)
803 if (sd->fd >= 0) 808 if (sd->fd >= 0)
804 { 809 {
805 /* Flush sound data, and reset the device. */ 810 /* Flush sound data, and reset the device. */
811 turn_on_atimers (0);
806 ioctl (sd->fd, SNDCTL_DSP_SYNC, NULL); 812 ioctl (sd->fd, SNDCTL_DSP_SYNC, NULL);
813 turn_on_atimers (1);
807 814
808 /* Close the device. */ 815 /* Close the device. */
809 emacs_close (sd->fd); 816 emacs_close (sd->fd);