From owner-svn-src-all@FreeBSD.ORG Fri Jan 22 11:30:32 2010 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 C816D106566B; Fri, 22 Jan 2010 11:30:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5E458FC16; Fri, 22 Jan 2010 11:30:32 +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 o0MBUWMh055106; Fri, 22 Jan 2010 11:30:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MBUWaw055104; Fri, 22 Jan 2010 11:30:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001221130.o0MBUWaw055104@svn.freebsd.org> From: Alexander Motin Date: Fri, 22 Jan 2010 11:30:32 +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: r202800 - stable/8/sys/dev/sound/pcm 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: Fri, 22 Jan 2010 11:30:32 -0000 Author: mav Date: Fri Jan 22 11:30:32 2010 New Revision: 202800 URL: http://svn.freebsd.org/changeset/base/202800 Log: MFC r202166: Make default recording source choosing more intelligent. Change default recording level from 0 to 75. It should increase chances for things to work just out of the box. Modified: stable/8/sys/dev/sound/pcm/mixer.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/pcm/mixer.c ============================================================================== --- stable/8/sys/dev/sound/pcm/mixer.c Fri Jan 22 11:16:46 2010 (r202799) +++ stable/8/sys/dev/sound/pcm/mixer.c Fri Jan 22 11:30:32 2010 (r202800) @@ -87,7 +87,7 @@ static u_int16_t snd_mixerdefaults[SOUND [SOUND_MIXER_IGAIN] = 0, [SOUND_MIXER_LINE1] = 75, [SOUND_MIXER_VIDEO] = 75, - [SOUND_MIXER_RECLEV] = 0, + [SOUND_MIXER_RECLEV] = 75, [SOUND_MIXER_OGAIN] = 50, [SOUND_MIXER_MONITOR] = 75, }; @@ -352,7 +352,13 @@ mixer_setrecsrc(struct snd_mixer *mixer, dropmtx = 0; src &= mixer->recdevs; if (src == 0) - src = SOUND_MASK_MIC; + src = mixer->recdevs & SOUND_MASK_MIC; + if (src == 0) + src = mixer->recdevs & SOUND_MASK_MONITOR; + if (src == 0) + src = mixer->recdevs & SOUND_MASK_LINE; + if (src == 0 && mixer->recdevs != 0) + src = (1 << (ffs(mixer->recdevs) - 1)); /* It is safe to drop this mutex due to Giant. */ MIXER_SET_UNLOCK(mixer, dropmtx); recsrc = MIXER_SETRECSRC(mixer, src); @@ -716,7 +722,7 @@ mixer_init(device_t dev, kobj_class_t cl mixer_set(m, i, v | (v << 8)); } - mixer_setrecsrc(m, SOUND_MASK_MIC); + mixer_setrecsrc(m, 0); /* Set default input. */ unit = device_get_unit(dev); devunit = snd_mkunit(unit, SND_DEV_CTL, 0);