rem: Disable();
add: AHIsub_Disable((struct AHIAudioCtrlDrv *) iounit->AudioCtrl);
context: static void PlayRequest(int channel, struct AHIRequest *ioreq,    struct AHIDevUnit *iounit, struct AHIBase *AHIBase){#ifdef DEBUG  KPrintF("PlayRequest(%ld, 0x%08lx)\n", channel, ioreq);#endif  // Start the sound  GetExtras(ioreq)->Channel = channel;  if(ioreq->ahir_Link)  {    struct Voice        *v = &iounit->Voices[channel];    struct AHIRequest   *r = ioreq->ahir_Link;#ifdef DEBUG    KPrintF("It has a link! 0x%08lx\n", ioreq->ahir_Link);#endif    v->NextSound     = GetExtras(r)->Sound;    v->NextVolume    = r->ahir_Volume;    v->NextPan       = r->ahir_Position;    v->NextFrequency = r->ahir_Frequency;    v->NextOffset    = r->ahir_Std.io_Actual;    v->NextLength    = r->ahir_Std.io_Length                     - r->ahir_Std.io_Actual;    v->NextRequest   = r;  }  else  {    iounit->Voices[channel].NextOffset  = PLAY;    iounit->Voices[channel].NextRequest = NULL;  }#ifdef DEBUG  KPrintF("Starting it\n");#endif  Disable();  iounit->Voices[channel].PlayingRequest = NULL;  iounit->Voices[channel].QueuedRequest = ioreq;  iounit->Voices[channel].Flags &= ~VF_STARTED;  AHI_Play(iounit->AudioCtrl,      AHIP_BeginChannel,  channel,      AHIP_Freq,          ioreq->ahir_Frequency,      AHIP_Vol,           ioreq->ahir_Volume,      AHIP_Pan,           ioreq->ahir_Position,      AHIP_Sound,         GetExtras(ioreq)->Sound,      AHIP_Offset,        ioreq->ahir_Std.io_Actual,      AHIP_Length,        ioreq->ahir_Std.io_Length-ioreq->ahir_Std.io_Actual,      AHIP_EndChannel,    NULL,      TAG_DONE);  Enable();  // This is a workaround for a race condition.  // The problem can occur if a delayed request follows immediately after  // this one, before the sample interrupt routine has been called, and  // overwrites QueuedRequest. The result is that this sound is never  // marked as finished, and the application will wait forever on the  // IO Request. Quite ugly, no?  while((iounit->Voices[channel].Flags & VF_STARTED) == 0);#ifdef DEBUG  KPrintF("Exiting PlayRequest()\n");#endif}