From owner-freebsd-questions@freebsd.org Sat Feb 3 20:45:07 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CF5FEEB3B3 for ; Sat, 3 Feb 2018 20:45:07 +0000 (UTC) (envelope-from news@mips.inka.de) Received: from mail.inka.de (quechua.inka.de [IPv6:2a04:c9c7:0:1073:217:a4ff:fe3b:e77c]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEB537A24B for ; Sat, 3 Feb 2018 20:45:06 +0000 (UTC) (envelope-from news@mips.inka.de) Received: from mips.inka.de (news@[127.0.0.1]) by mail.inka.de with uucp (rmailwrap 0.5) id 1ei4gL-0001z6-Op; Sat, 03 Feb 2018 21:45:05 +0100 Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.15.2/8.15.2) with ESMTP id w13KiUwA001420 for ; Sat, 3 Feb 2018 21:44:30 +0100 (CET) (envelope-from news@lorvorc.mips.inka.de) Received: (from news@localhost) by lorvorc.mips.inka.de (8.15.2/8.15.2/Submit) id w13KiU1A001419 for freebsd-questions@freebsd.org; Sat, 3 Feb 2018 21:44:30 +0100 (CET) (envelope-from news) To: freebsd-questions@freebsd.org From: Christian Weisgerber Newsgroups: list.freebsd.questions Subject: How to set default pcm device? Date: Sat, 3 Feb 2018 20:44:30 -0000 (UTC) Message-ID: User-Agent: slrn/1.0.3 (FreeBSD) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Feb 2018 20:45:07 -0000 After boot, my /dev/sndstat looks like this: Installed devices: pcm0: (play) pcm1: (play/rec) default pcm2: (play/rec) pcm3: (play) No devices installed from userspace. However, I would like the USB audio device, pcm3, to be the default sound unit. How do I set this persistently across reboots? The traditional solution was to set hw.snd.default_unit=3 in /boot/loader.conf. That worked for FreeBSD 10.x, but with 11.x the USB devices are attached very late and the boot loader setting (which I still have) is effectively ignored. Loading the uaudio module early with snd_uaudio_load=YES doesn't change this. Setting hw.snd.default_unit in /etc/sysctl.conf is unlikely to work either; certainly it's a race. Do I need to define a devd(8) action for when uaudio attaches or is there a better way? -- Christian "naddy" Weisgerber naddy@mips.inka.de