From owner-svn-src-all@FreeBSD.ORG Wed Jun 8 00:10:25 2011 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 B7665106564A; Wed, 8 Jun 2011 00:10:25 +0000 (UTC) (envelope-from skipford9@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 3FD768FC08; Wed, 8 Jun 2011 00:10:24 +0000 (UTC) Received: by qyk35 with SMTP id 35so1934747qyk.13 for ; Tue, 07 Jun 2011 17:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=dsMVsTsSd5DYA6Xq7tZ+tvTvvrPfHYWjOxkTw2cGMOs=; b=EICpFKyyZ1jXJKDhSIzMTcTfQEVKz/w4f/fzYJUtMUoDnt10gxHw8Ue/wLNWfrVBp5 9e4oAFbzuPKLCHyyWDLKfS2AM/W34E7/5Q9iKSpG3DuPfuGZMFb8YQbbIOkYyE4UZVoP gdnRaXCQz8Uqh2eoGi/Es1D0oWMz020vHkCwk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=R/9ucl1kmcEHml1AE1xhf/weGHwKcKpOdtPE30LbZwNMIf5DVURVeXwKtSxAXjHls/ KXCOF9lFuoTYgfuUj/MFNh6Hx33ZZvuDAMlS8GuxBJ0qUsCijbhElrntIbS/GVVVRbn7 t00Cv04NVJSN6/grDd8DUIUp/tWZ+22ZSWRQE= Received: by 10.224.105.139 with SMTP id t11mr3487830qao.282.1307490439261; Tue, 07 Jun 2011 16:47:19 -0700 (PDT) Received: from ws.menantico.com (pool-71-168-248-198.cmdnnj.east.verizon.net [71.168.248.198]) by mx.google.com with ESMTPS id j18sm4001616qck.15.2011.06.07.16.47.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Jun 2011 16:47:18 -0700 (PDT) Date: Tue, 7 Jun 2011 19:47:16 -0400 From: Skip Ford To: Alexander Motin Message-ID: <20110607234715.GA62676@ws.menantico.com> References: <201106071701.p57H1qvN092370@svn.freebsd.org> <201106071930.49724.hselasky@c2i.net> <4DEE6434.5030406@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DEE6434.5030406@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky Subject: Re: svn commit: r222826 - head/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: Wed, 08 Jun 2011 00:10:25 -0000 On Tue, Jun 07, 2011 at 08:47:32PM +0300, Alexander Motin wrote: > Hans Petter Selasky wrote: > > On Tuesday 07 June 2011 19:01:52 Alexander Motin wrote: > >> Author: mav > >> Date: Tue Jun 7 17:01:52 2011 > >> New Revision: 222826 > >> URL: http://svn.freebsd.org/changeset/base/222826 > >> > >> Log: > >> Make automatic hw.snd.default_unit choice a bit more intelligent. Instead > >> of just setting it to the first registered device, reevaluate it for each > >> device registered, trying to choose best candidate, unless one was > >> forced. For now use such preference order: play&rec, play, rec. > >> > >> As side effect, this should workaround the situation when HDMI audio > >> output of the video card, usually not connected to anything, becomes > >> default, that requires manual user intervention to make sound working. If > >> at some point this won't be enough, we can try to fetch some additional > >> priority flags from the device driver. > > > > Idea: I would be cool if some GTK mixer apps can set this value. > > Definitely. This patch only tries to set more or less reasonable initial > default, which later may need to be tuned. I am personally using two > different playback devices depending on situation: digital (SPDIF) pcm1 > at home and analog pcm0 when out. Now I am switching it via sysctl, but > obviously it is not the "right way". I switch back and forth between a soundcard and wireless headphones, and have always felt that the sysctl is misnamed. It really acts as a combination of default_unit and current_unit. If I set the default_unit to my wireless headphones, then unplug the usb dongle, the kernel changes my default_unit setting since my preferred device disappears. The kernel changing my default setting is contrary to what I'd expect. It would seem more natural if the kernel maintained its own currently_active_unit variable and just used default_unit as a hint for when to switch back and forth. Just feels like it shouldn't overwrite, and lose, a setting that I've specified. -- Skip