From owner-freebsd-multimedia@FreeBSD.ORG Thu Jan 31 13:19:42 2008 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B03616A419 for ; Thu, 31 Jan 2008 13:19:42 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id AFE2913C447 for ; Thu, 31 Jan 2008 13:19:41 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A554D0.dip.t-dialin.net [84.165.84.208]) by redbull.bpaserver.net (Postfix) with ESMTP id 5BCFB2E34A; Thu, 31 Jan 2008 14:19:10 +0100 (CET) Received: from webmail.leidinger.net (webmail.Leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id E90B98DFB8; Thu, 31 Jan 2008 14:19:03 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.2/8.13.8/Submit) id m0VDJ3Mc049125; Thu, 31 Jan 2008 14:19:03 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde MIME library) with HTTP; Thu, 31 Jan 2008 14:19:03 +0100 Message-ID: <20080131141903.q3lw3nsqf44c0cwg@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Thu, 31 Jan 2008 14:19:03 +0100 From: Alexander Leidinger To: Aragon Gouveia References: <20080131121005.GA62806@phat.za.net> In-Reply-To: <20080131121005.GA62806@phat.za.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.5) / FreeBSD-8.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-13.504, required 6, BAYES_00 -15.00, MIME_QP_LONG_LINE 1.40, RDNS_DYNAMIC 0.10) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: freebsd-multimedia@freebsd.org Subject: Re: Handling of newly attached pcm devices (eg. via uaudio) X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2008 13:19:42 -0000 Quoting Aragon Gouveia (from Thu, 31 Jan 2008 =20 14:10:05 +0200): > Hi, > > On my FreeBSD workstations I frequently use a USB sound device (headphone > amplifier). I typically plug it in and out only when I need it, and expec= t > (or hope!) for my system to use it when it's plugged in, but use the onboa= rd > sound when it is unplugged. > > On FreeBSD 7 I used to set hw.snd.default_unit to 1 (from 0) after pluggin= g > the device in and then set the mixer levels to how I want them. I've > subsequently automated this ala devd and a shell script to do precisely th= e > same thing, except the shell script also calls /etc/rc.d/mixer to restore > the saved mixer settings in /var/db. > > I would like to PR my work in the hope of someone committing it as I think > it might be useful to others. What are people's opinions of this idea, > in particular setting hw.snd.default_unit to make a newly plugged sound > device the default? Can anyone think of a better way to handle newly > attached sound hardware? Not commenting on the fact if this handling itself is ok or not (I =20 have no strong opinion about it), but it should at least be not =20 activated by default. So whatever you submit as a PR should contain =20 something which has a look at rc.conf (and the other config files) and =20 only do something if it is explicitly activated there. It should also =20 be able to not fail if the attached device is the only sound device =20 (so on removal of the only sound device, it should not fall on the =20 nose or spit out a lot of messages). Bye, Alexander. --=20 Why do they call a fast a fast, when it goes so slow? http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137