From 866919579f1fc2bbaee386c07c015a42184b8e61 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Sun, 4 Jan 2004 16:35:32 +0000 Subject: [PATCH] Force DSP_RESET on AudioExit() so that we don't get "clicks" (?). --- BasiliskII/src/Unix/audio_oss_esd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BasiliskII/src/Unix/audio_oss_esd.cpp b/BasiliskII/src/Unix/audio_oss_esd.cpp index 22eac593..9aa63fe1 100644 --- a/BasiliskII/src/Unix/audio_oss_esd.cpp +++ b/BasiliskII/src/Unix/audio_oss_esd.cpp @@ -323,11 +323,6 @@ static void close_audio(void) // Close dsp or ESD socket if (audio_fd >= 0) { - if (is_dsp_audio) { - // Stop the device immediately. Otherwise, close() sends - // SNDCTL_DSP_SYNC, which may hang - ioctl(audio_fd, SNDCTL_DSP_RESET, 0); - } close(audio_fd); audio_fd = -1; } @@ -337,6 +332,11 @@ static void close_audio(void) void AudioExit(void) { + // Stop the device immediately. Otherwise, close() sends + // SNDCTL_DSP_SYNC, which may hang + if (is_dsp_audio) + ioctl(audio_fd, SNDCTL_DSP_RESET, 0); + // Close audio device close_audio();