Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2007 21:04:49 +0900 (JST)
From:      Kazuhito HONDA <kazuhito@ph.noda.tus.ac.jp>
To:        imp@bsdimp.com
Cc:        Alexander Leidinger <Alexander@Leidinger.net>, multimedia@freebsd.org
Subject:   Re: Sound Blaster USB?
Message-ID:  <20070221.210449.343186396.kazuhito@ph.noda.tus.ac.jp>
In-Reply-To: <20070217.100629.-1297660600.imp@bsdimp.com>
References:  <20070216.151321.43011330.imp@bsdimp.com> <20070217.205042.835831436.kazuhito@ph.noda.tus.ac.jp> <20070217.100629.-1297660600.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
----Next_Part(Wed_Feb_21_21:04:49_2007_524)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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(Wed_Feb_21_21:04:49_2007_524)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="uaudio.patch"

--- 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);

----Next_Part(Wed_Feb_21_21:04:49_2007_524)----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070221.210449.343186396.kazuhito>