Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 03 Feb 2018 19:43:28 -0800
From:      Ashley Chase <erisianash@gmail.com>
To:        freebsd-questions@freebsd.org,Christian Weisgerber <naddy@mips.inka.de>
Subject:   Re: How to set default pcm device?
Message-ID:  <F58AE467-36AD-4702-9DFF-AE9645B515D4@gmail.com>
In-Reply-To: <slrnp7c7pe.13p.naddy@lorvorc.mips.inka.de>
References:  <slrnp7c7pe.13p.naddy@lorvorc.mips.inka.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Typing this on my phone=2E Sorry if the formatting  isn't right=2E

On February 3, 2018 12:44:30 PM PST, Christian Weisgerber <naddy@mips=2Ein=
ka=2Ede> wrote:
>After boot, my /dev/sndstat looks like this:
>
>Installed devices:
>pcm0: <ATI R6xx (HDMI)> (play)
>pcm1: <Realtek ALC280 (Analog 2=2E0+HP/2=2E0)> (play/rec) default
>pcm2: <Realtek ALC280 (Rear Analog)> (play/rec)
>pcm3: <USB audio> (play)
>No devices installed from userspace=2E
>
>However, I would like the USB audio device, pcm3, to be the default
>sound unit=2E  How do I set this persistently across reboots?
>
>The traditional solution was to set hw=2Esnd=2Edefault_unit=3D3 in
>/boot/loader=2Econf=2E  That worked for FreeBSD 10=2Ex, but with 11=2Ex t=
he
>USB devices are attached very late and the boot loader setting
>(which I still have) is effectively ignored=2E  Loading the uaudio
>module early with snd_uaudio_load=3DYES doesn't change this=2E  Setting
>hw=2Esnd=2Edefault_unit in /etc/sysctl=2Econf is unlikely to work either;
>certainly it's a race=2E
>

hw=2Esnd=2Edefault_unit is actually a sysctl and should go in /etc/sysctl=
=2Econf

You night also consider setting hw=2Esnd=2Edefault_auto=3D2 to automatical=
ly select the most recently attached device=2E

This is documented in the sound(4) man page=2E

>Do I need to define a devd(8) action for when uaudio attaches or
>is there a better way?

--=20
Ashley Chase



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F58AE467-36AD-4702-9DFF-AE9645B515D4>