Subject: kern/1028: sbpro device number space has holes
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: John Kohl <jtk@kolvir.blrc.ma.us>
List: netbsd-bugs
Date: 05/06/1995 23:05:04
>Number:         1028
>Category:       kern
>Synopsis:       the sbdsp driver tells the user to look at holes in device index space
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May  6 23:05:01 1995
>Originator:     John Kohl
>Organization:
NetBSD Kernel Hackers `R` Us
>Release:        1.0
>Environment:
	
System: NetBSD kolvir 1.0A NetBSD 1.0A (KOLVIR) #316: Sun May 7 01:27:31 EDT 1995 jtk@kolvir:/u1/NetBSD-current/src/sys/arch/i386/compile/KOLVIR i386


>Description:
The sbpro driver has holes in its device index space--if you call the
kernel to scan the space, it will tell you to look at an invalid number
before it gets to the end of all its devices.

Also, the FM synth port is an output class port, as is the DAC port.
(the ADC is implicitly seleted by one of the other input ports,
e.g. SB_LINE_IN_PORT, SB_MIC_PORT)

>How-To-Repeat:
Try to look at all the devices

>Fix:
===================================================================
RCS file: RCS/sbdsp.c,v
retrieving revision 1.1
diff -u -r1.1 sbdsp.c
--- 1.1	1995/05/05 04:12:19
+++ sbdsp.c	1995/05/07 05:45:38
@@ -1575,7 +1575,7 @@
 	    break;
 	case SB_DAC_PORT:
 	    dip->type = AUDIO_MIXER_VALUE;
-	    dip->mixer_class = SB_INPUT_CLASS;
+	    dip->mixer_class = SB_OUTPUT_CLASS;
 	    dip->prev = AUDIO_MIXER_LAST;
 	    dip->next = AUDIO_MIXER_LAST;
 	    strcpy(dip->label.name, AudioNdac);
@@ -1593,7 +1593,7 @@
 	    break;
 	case SB_FM_PORT:
 	    dip->type = AUDIO_MIXER_VALUE;
-	    dip->mixer_class = SB_INPUT_CLASS;
+	    dip->mixer_class = SB_OUTPUT_CLASS;
 	    dip->prev = AUDIO_MIXER_LAST;
 	    dip->next = AUDIO_MIXER_LAST;
 	    strcpy(dip->label.name, "fmsynth");	/* XXX move to audioio.h */
@@ -1604,7 +1604,7 @@
 	    dip->type = AUDIO_MIXER_VALUE;
 	    dip->mixer_class = SB_OUTPUT_CLASS;
 	    dip->prev = AUDIO_MIXER_LAST;
-	    dip->next = SB_OUTPUT_MODE;
+	    dip->next = /*TREBLE, BASS not handled, nor is SB_OUTPUT_MODE*/SB_RECORD_SOURCE;
 	    strcpy(dip->label.name, AudioNvolume);
 	    dip->un.v.num_channels = 2;
 	    strcpy(dip->un.v.units.name, AudioNvolume);
>Audit-Trail:
>Unformatted: