Selecting sound output device?

José M. Fandiño freebsd at
Mon Dec 12 06:42:58 PST 2005

Jesse Sheidlower wrote:
> Now I'd like to know how to use pcm1 as the output device any time
> the USB speakers are plugged in, or at least how to control this
> manually. Both devices are present:
> $ cat /dev/sndstat
> FreeBSD Audio Driver (newpcm)
> Installed devices:
> pcm0: <Intel ICH3 (82801CA)> at io 0x1c00, 0x18c0 irq 11 bufsz 16384 kld snd_ich (1p/1r/4v channels duplex default)
> pcm1: <USB Audio> at addr ? (1p/0r/1v channels duplex)
>         mode 1:(output) 1ch, 16/16bit, pcm, 6400-48000Hz
>         mode 2:(output) 2ch, 16/16bit, pcm, 6400-48000Hz
> So, if I'm not selecting it in XMMS--if I want to use it for
> all output--how do I either automatically or explicitly select
> pcm1 as my sound output device? (I'm using the speakers with a
> laptop, so I expect to be plugging and unplugging them at other
> times than boot, if that matters.)

I haven't you hardware but I'd say that the solution involves 
playing with devd and devd.conf in such way that when the 
spakers are pluggled a softlink must be created pointing the
proper device (ln -s /dev/pcm1 /dev/pcm on attach)

Version: 3.1
GCS/IT d- s+:+() a31 C+++ UBL+++$ P+ L+++ E--- W++ N+ o++ K- w---
O+ M+ V- PS+ PE+ Y++ PGP+>+++ t+ 5 X+$ R- tv-- b+++ DI D++>+++
G++ e- h+(++) !r !z

More information about the freebsd-multimedia mailing list