From owner-freebsd-multimedia@FreeBSD.ORG Thu Jan 31 12:26:55 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 9C34C16A420 for ; Thu, 31 Jan 2008 12:26:55 +0000 (UTC) (envelope-from aragon@phat.za.net) Received: from mail.geek.sh (decoder.geek.sh [196.36.198.81]) by mx1.freebsd.org (Postfix) with ESMTP id EA62113C455 for ; Thu, 31 Jan 2008 12:26:54 +0000 (UTC) (envelope-from aragon@phat.za.net) Received: by mail.geek.sh (Postfix, from userid 1000) id D1E7C24D2C; Thu, 31 Jan 2008 14:10:05 +0200 (SAST) Date: Thu, 31 Jan 2008 14:10:05 +0200 From: Aragon Gouveia To: freebsd-multimedia@freebsd.org Message-ID: <20080131121005.GA62806@phat.za.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 4.10-RELEASE-p2 i386 Subject: 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 12:26:55 -0000 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 expect (or hope!) for my system to use it when it's plugged in, but use the onboard sound when it is unplugged. On FreeBSD 7 I used to set hw.snd.default_unit to 1 (from 0) after plugging 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 the 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? Thanks, Aragon