From: Andrew Robinson <robinson@cnj.digex.com>
Newsgroups: comp.os.linux.announce
Subject: gus_wave patch
Date: 14 Dec 1993 15:58:36 +0200
Approved: linux-announce@tc.cornell.edu (Lars Wirzenius)
Message-ID: <2ekgqc$eah@klaava.Helsinki.FI>

I have uploaded a patch to the GUS sequencer driver to the /pub/Linux/Incoming
directory of sunsite.unc.edu.  For those of you without ftp access, I have
included the Readme and diff files below.

     -- Andrew

This patch corrects a problem in the gus_wave.c file included with the
Linux patchlevel 14 kernel.  Apply the gus_wave.diff file using the 'patch'
command, and re-compile the kernel.

Problem description:
	The compute_and_set_volume function never selects the GUS voice to
	use, but is sometimes called without first selecting the voice.

Problem fix:
	The compute_and_set_volume function disables interrupts, selects
	the proper voice, and then re-enables interrupts before returning.

Patch provided by:
	Andrew J. Robinson
	robinson@cnj.digex.com

-- cut here --
*** gus_wave.bak	Mon Dec 13 01:26:43 1993
--- gus_wave.c	Mon Dec 13 01:26:43 1993
***************
*** 927,936 ****
--- 927,939 ----
  compute_and_set_volume (int voice, int volume, int ramp_time)
  {
    int             current, target, rate;
+   long int        flags;
  
    compute_volume (voice, volume);
    voices[voice].current_volume = voices[voice].initial_volume;
  
+   DISABLE_INTR(flags);
+   gus_select_voice(voice);
    current = gus_read16 (0x09) >> 4;
    target = voices[voice].initial_volume;
  
***************
*** 938,943 ****
--- 941,947 ----
      {
        gus_rampoff ();
        gus_voice_volume (target);
+       RESTORE_INTR(flags);
        return;
      }
  
***************
*** 951,956 ****
--- 955,961 ----
      {
        gus_rampoff ();
        gus_voice_volume (target);
+       RESTORE_INTR(flags);
        return;
      }
  
***************
*** 969,974 ****
--- 974,980 ----
        gus_ramp_range (target, current);
        gus_rampon (0x40);	/* Ramp down, once, no irq */
      }
+   RESTORE_INTR(flags);
  }
  
  static void
-- cut here --

--
Mail submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
PLEASE remember Keywords: and a short description of the software.
