Skip to contentSkip to conversation

Sound problem in dosemu 1.1.4

DISCUSSION Stas Sergeev 1 participant 1 message Jan 4, 2003

lore
Share & tools
lore
#0 lore raw

Hello.

Quoted 1 line · Thomas Pallmann

I'm using the sourceforge vortex driver for my Terratec Xlerate (aureal chipset).

Please fix your buggy aureal drivers.
The attached patch will help you to
start doing that.
Third-party drivers are not supported
by dosemu anymore (except the PCSP driver
of course:)

au_audio.c renamed from au_audio.c.old +5 -3
@@ -361,14 +361,13 @@
 		if(!wdev->play_stream.wave)
 			return -EINVAL;
 		PSHOW("au_audio_ioctl() : DSP_POST\n");
-		drain_playback(dev, wdev, (file->f_flags & O_NONBLOCK));
-		stop_wave(dev, &(wdev->play_stream));
+		drain_playback(dev, wdev, 1);
 		return SUCCESS;
 
 	case SNDCTL_DSP_SYNC:
 		if (wdev->play_stream.wave) {
 			PSHOW("au_audio_ioctl() : DSP_SYNC\n");
-			drain_playback(dev, wdev, (file->f_flags & O_NONBLOCK));
+			drain_playback(dev, wdev, 0);
 			stop_wave(dev, &(wdev->play_stream));
 		}
 		if (wdev->record_stream.wave)
@@ -709,6 +708,9 @@
 		spin_lock_irqsave(&dev->irq_lock,flags);
 		AddWaveBuffer(wdev->play_stream.wave, mb->page, mb->count);
 		spin_unlock_irqrestore(&dev->irq_lock,flags);
+		wdev->play_stream.fill_index++;
+		if(wdev->play_stream.fill_index >= wdev->play_stream.num_frags)
+			wdev->play_stream.fill_index = 0;
 	}
 
  	while (wdev->play_stream.total_played < wdev->play_stream.total_sent) {