Josef “Jeff” Sipek

FreeBSD Sound: ALSA & Qt

Sound in FreeBSD is somewhat complicated because of the various portability and compatibility shims. Last week, I hit an annoying to diagnose situation: I plugged in a USB sound card and while the kernel and some applications detected it just fine, other applications didn’t seem to notice it at all.

At first, I thought it was a Qt issue since only Qt applications appeared broken. But then, mere minutes before emailing a FreeBSD mailing list, I managed to find a hint that it was likely an ALSA on FreeBSD issue. Some searching later, I learned that in order for ALSA to see the device, it needed a mapping to the actual OSS device.

So, after adding the following to ~/.asoundrc, any ALSA application (and therefore any Qt application) that tries to list the sound devices will see a “ft991a” device:

pcm.ft991a {
	type oss
	device /dev/dsp3
}

To make it more explicit, without adding the above stanza to .asoundrc:

  1. OSS applications work fine.
  2. PortAudio applications work fine.
  3. ALSA applications did not see the device.

With the stanza, everything seems to work.

2 Comments »

  1. How to do that for /all/ users (centrally within /etc or /usr/local/etc)?

    Comment by Walter von Entferndt — September 1, 2020 @ 14:04

  2. Yeah, I believe the correct place is /usr/local/etc/asound.conf. Since my laptop is a single-user system, I find it more convenient to keep a symlink in my $HOME to a file in my "environment repository". (I version my dotfiles.)

    Comment by JeffPC — September 15, 2020 @ 13:05

Atom feed for comments on this post.

Leave a comment

Powered by blahgd