patch-2.1.63 linux/drivers/sound/sb_audio.c

Next file: linux/drivers/sound/sb_card.c
Previous file: linux/drivers/sound/sb.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.62/linux/drivers/sound/sb_audio.c linux/drivers/sound/sb_audio.c
@@ -15,7 +15,7 @@
 
 #include "sound_config.h"
 
-#if defined(CONFIG_SBDSP)
+#ifdef CONFIG_SBDSP
 
 #include "sb_mixer.h"
 #include "sb.h"
@@ -34,8 +34,9 @@
 
   if (devc->caps & SB_NO_RECORDING && mode & OPEN_READ)
     {
-      printk ("SB: Recording is not possible with this device\n");
-      return -EPERM;
+      printk ("Notice: Recording is not possible with /dev/dsp%d\n", dev);
+      if (mode == OPEN_READ)
+	return -EPERM;
     }
 
   save_flags (flags);
@@ -50,6 +51,7 @@
     {
       if (sound_open_dma (devc->dma16, "Sound Blaster 16 bit"))
 	{
+	  restore_flags (flags);
 	  return -EBUSY;
 	}
     }
@@ -542,8 +544,12 @@
     if (channels != devc->channels)
       {
 	devc->channels = channels;
-	if (devc->model == MDL_SBPRO)
-	  sbpro_audio_set_speed (dev, devc->speed);
+	if (devc->model == MDL_SBPRO && devc->channels == 2)
+	  {
+	    if (devc->speed > 22050)
+	      printk ("OSS: Application error. Wrong ioctl call order.\n");
+	    sbpro_audio_set_speed (dev, devc->speed);
+	  }
       }
   return devc->channels;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov