diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/sound.c | 24 |
2 files changed, 29 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index da8913ea9ed..67be01f753b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2001-07-09 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * sound.c (toplevel): Include <signal.h> and "syssignal.h". | ||
| 4 | (vox_configure, vox_close) [SIGIO]: Block/unblock SIGIO | ||
| 5 | around ioctls. | ||
| 6 | |||
| 1 | 2001-07-06 Eli Zaretskii <eliz@is.elta.co.il> | 7 | 2001-07-06 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 8 | ||
| 3 | * dosfns.c (syms_of_dosfns): Add \n\ at the end of a line in the | 9 | * dosfns.c (syms_of_dosfns): Add \n\ at the end of a line in the |
diff --git a/src/sound.c b/src/sound.c index 62d6cfb170b..e5c80059656 100644 --- a/src/sound.c +++ b/src/sound.c | |||
| @@ -32,6 +32,8 @@ Boston, MA 02111-1307, USA. */ | |||
| 32 | #include "lisp.h" | 32 | #include "lisp.h" |
| 33 | #include "dispextern.h" | 33 | #include "dispextern.h" |
| 34 | #include "atimer.h" | 34 | #include "atimer.h" |
| 35 | #include <signal.h> | ||
| 36 | #include "syssignal.h" | ||
| 35 | 37 | ||
| 36 | /* FreeBSD has machine/soundcard.h. Voxware sound driver docs mention | 38 | /* FreeBSD has machine/soundcard.h. Voxware sound driver docs mention |
| 37 | sys/soundcard.h. So, let's try whatever's there. */ | 39 | sys/soundcard.h. So, let's try whatever's there. */ |
| @@ -765,7 +767,13 @@ vox_configure (sd) | |||
| 765 | 767 | ||
| 766 | xassert (sd->fd >= 0); | 768 | xassert (sd->fd >= 0); |
| 767 | 769 | ||
| 770 | /* On GNU/Linux, it seems that the device driver doesn't like to be | ||
| 771 | interrupted by a signal. Block the ones we know to cause | ||
| 772 | troubles. */ | ||
| 768 | turn_on_atimers (0); | 773 | turn_on_atimers (0); |
| 774 | #ifdef SIGIO | ||
| 775 | sigblock (sigmask (SIGIO)); | ||
| 776 | #endif | ||
| 769 | 777 | ||
| 770 | val = sd->format; | 778 | val = sd->format; |
| 771 | if (ioctl (sd->fd, SNDCTL_DSP_SETFMT, &sd->format) < 0 | 779 | if (ioctl (sd->fd, SNDCTL_DSP_SETFMT, &sd->format) < 0 |
| @@ -796,6 +804,9 @@ vox_configure (sd) | |||
| 796 | } | 804 | } |
| 797 | 805 | ||
| 798 | turn_on_atimers (1); | 806 | turn_on_atimers (1); |
| 807 | #ifdef SIGIO | ||
| 808 | sigunblock (sigmask (SIGIO)); | ||
| 809 | #endif | ||
| 799 | } | 810 | } |
| 800 | 811 | ||
| 801 | 812 | ||
| @@ -807,10 +818,21 @@ vox_close (sd) | |||
| 807 | { | 818 | { |
| 808 | if (sd->fd >= 0) | 819 | if (sd->fd >= 0) |
| 809 | { | 820 | { |
| 810 | /* Flush sound data, and reset the device. */ | 821 | /* On GNU/Linux, it seems that the device driver doesn't like to |
| 822 | be interrupted by a signal. Block the ones we know to cause | ||
| 823 | troubles. */ | ||
| 824 | #ifdef SIGIO | ||
| 825 | sigblock (sigmask (SIGIO)); | ||
| 826 | #endif | ||
| 811 | turn_on_atimers (0); | 827 | turn_on_atimers (0); |
| 828 | |||
| 829 | /* Flush sound data, and reset the device. */ | ||
| 812 | ioctl (sd->fd, SNDCTL_DSP_SYNC, NULL); | 830 | ioctl (sd->fd, SNDCTL_DSP_SYNC, NULL); |
| 831 | |||
| 813 | turn_on_atimers (1); | 832 | turn_on_atimers (1); |
| 833 | #ifdef SIGIO | ||
| 834 | sigunblock (sigmask (SIGIO)); | ||
| 835 | #endif | ||
| 814 | 836 | ||
| 815 | /* Close the device. */ | 837 | /* Close the device. */ |
| 816 | emacs_close (sd->fd); | 838 | emacs_close (sd->fd); |