From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 23:12:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64BFA106566C; Wed, 9 Dec 2009 23:12:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52FDF8FC12; Wed, 9 Dec 2009 23:12:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB9NCERw043597; Wed, 9 Dec 2009 23:12:14 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9NCEq1043595; Wed, 9 Dec 2009 23:12:14 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092312.nB9NCEq1043595@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 23:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200337 - stable/8/sys/dev/sound/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 23:12:14 -0000 Author: thompsa Date: Wed Dec 9 23:12:14 2009 New Revision: 200337 URL: http://svn.freebsd.org/changeset/base/200337 Log: MFC r199576 remove volume alignment (was previously not correctly implemented) Modified: stable/8/sys/dev/sound/usb/uaudio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Wed Dec 9 23:11:27 2009 (r200336) +++ stable/8/sys/dev/sound/usb/uaudio.c Wed Dec 9 23:12:14 2009 (r200337) @@ -118,7 +118,6 @@ struct uaudio_mixer_node { int32_t maxval; #define MIX_MAX_CHAN 8 int32_t wValue[MIX_MAX_CHAN]; /* using nchan */ - uint32_t mod; /* modulus */ uint32_t mul; uint32_t ctl; @@ -1318,6 +1317,11 @@ uaudio_chan_init(struct uaudio_softc *sc ch->pcm_cap.minspeed = ch->sample_rate; ch->pcm_cap.maxspeed = ch->sample_rate; + /* setup mutex and PCM channel */ + + ch->pcm_ch = c; + ch->pcm_mtx = c->lock; + if (ch->p_asf1d->bNrChannels >= 2) ch->pcm_cap.fmtlist[0] = SND_FORMAT(ch->p_fmt->freebsd_fmt, 2, 0); @@ -1391,8 +1395,6 @@ uaudio_chan_init(struct uaudio_softc *sc ch->start = ch->buf; ch->end = ch->buf + buf_size; ch->cur = ch->buf; - ch->pcm_ch = c; - ch->pcm_mtx = c->lock; ch->pcm_buf = b; if (ch->pcm_mtx == NULL) { @@ -1570,9 +1572,7 @@ uaudio_mixer_add_ctl(struct uaudio_softc if (mc->type == MIX_ON_OFF) { mc->minval = 0; mc->maxval = 1; - mc->mod = 1; } else if (mc->type == MIX_SELECTOR) { - mc->mod = 1; } else { /* determine min and max values */ @@ -1600,11 +1600,8 @@ uaudio_mixer_add_ctl(struct uaudio_softc /* compute value alignment */ res = uaudio_mixer_get(sc->sc_udev, GET_RES, mc); - if (res == 0) - res = 1; - mc->mod = mc->mul / res; - if (mc->mod == 0) - mc->mod = 1; + + DPRINTF("Resolution = %d\n", (int)res); } uaudio_mixer_add_ctl_sub(sc, mc); @@ -3097,9 +3094,6 @@ uaudio_mixer_bsd2value(struct uaudio_mix /* compute actual volume */ val = (val * mc->mul) / 255; - /* align volume level */ - val = val - (val % mc->mod); - /* add lower offset */ val = val + mc->minval;