Sound Blaster USB?

Kazuhito HONDA kazuhito at ph.noda.tus.ac.jp
Wed Feb 21 12:04:52 UTC 2007


I made mute knobs controlled by volume controllers.
When the volume is 0, the mute knob is on.
When the volume isn't 0, the mute knob is off.  
So the mute is canceled when the volume is changed.
In the case of `SB Live! 24-bit External',
the mute is canceled when the volume for `speaker' is changed.

I looked through the new OSS v4 API.
But I guess that the mixer controller isn't 
corresponded to the new OSS v4 API yet.

Sincerely yours,
Kazuhito HONDA
-------------- next part --------------
--- sys/dev/sound/usb/uaudio.c.orig	Fri Feb  2 19:13:56 2007
+++ sys/dev/sound/usb/uaudio.c	Wed Feb 21 20:09:04 2007
@@ -1482,7 +1482,7 @@ uaudio_add_feature(struct uaudio_softc *
 		case MUTE_CONTROL:
 			mix.type = MIX_ON_OFF;
 #if defined(__FreeBSD__)
-			mix.ctl = SOUND_MIXER_NRDEVICES;
+			mix.ctl = mixernumber;
 #else
 			mix.ctlunit = "";
 			snprintf(mix.ctlname, sizeof(mix.ctlname),
@@ -4370,6 +4370,13 @@ uaudio_mixer_set(device_t dev, unsigned 
 	for (i=0; i < sc->sc_nctls; i++) {
 		mc = &sc->sc_ctls[i];
 		if (mc->ctl == type) {
+			if (mc->type == MIX_ON_OFF) { /* mute, probably */
+				if (left == 0)
+					uaudio_ctl_set(sc, SET_CUR, mc, 0, 1);
+				else
+					uaudio_ctl_set(sc, SET_CUR, mc, 0, 0);
+				continue;
+			}
 			if (mc->nchan == 2) {
 				/* set Right */
 				uaudio_ctl_set(sc, SET_CUR, mc, 1, (int)(right*255)/100);


More information about the freebsd-multimedia mailing list