Using USB sound card with FreeBSD

256 views
Skip to first unread message

Olivier

unread,
Oct 25, 2021, 5:35:39 AM10/25/21
to freebsd-...@freebsd.org
Hi,

I have a system with no sound interface. I have tried to install a USB
sound card, but so far, I don't see how to use it.

What is the device (/dev/xvz) that I should be sending my sound to? In
the past I had devices like /dev/dspW0.0 but I see nothing with that USB
sound card.

TIA,

Olivier

--

Tomasz CEDRO

unread,
Oct 25, 2021, 8:06:08 AM10/25/21
to Olivier, FreeBSD Questions Mailing List
Hey Olivier, I assume you are using RELEASE / GENERIC kernel, so
modules / drivers should be already in the system, you need to load
them if they do not auto-load. Then using USB Audio card looks exactly
the same as built-in audio card.

As root execute:
kldload snd_uaudio

This will load the USB Audio module. After that attach USB Audio card
and /dev/dspXX should show up.

If you want this module auto-loaded at boot time put
`snd_uaudio_load="YES"` in `/boot/loader.conf`.

Make sure your card is recognised and supported. See `dmesg` output or
watch first console after connecting the USB Audio card (Ctrl+Alt+F1
to go there from X). If you do not have /dev/dsp despite loaded
`snd_uaudio` try `usbconfig` to see if the card is attached and
visible to the computer among other USB devices. If usb subsystem does
not see the card then audio also won't see the card. In that case you
may want to try different USB port, cable, check if that card works on
another computer / os, etc.

The simplest way to test if sound card works is to `cat /dev/random >
/dev/dspXX` providing the device of interest you should hear random
noise in the speakers. Also make sure with mixer that output is not
muted.

If you haven't read yet there is a Handbook section dedicated to Multimedia:

https://docs.freebsd.org/en/books/handbook/multimedia/

Good luck and have fun! :-)

--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info

Waitman Gobble

unread,
Oct 25, 2021, 10:53:59 AM10/25/21
to FreeBSD Questions Mailing List
Also, I usually have to

# sysctl hw.snd.default_unit=4

( # of your device, might not be 4, in /dev/dsp* )

To set the USB device as the default. Setting the default permanently
may cause problems if the device is not plugged in on a reboot.

If you're not getting sound out of your web browser after plugging in
USB audio and setting hw.snd.default, there are two things you might
check - If you're using pulse audio you might have to run pulseaudio
with -k switch on command line, as the logged in user (probably not
root). You may have to restart the web browser depending on what sound
abstraction api you're using (SNDIO, pulse, etc).

--
Waitman Gobble

Reply all
Reply to author
Forward
0 new messages