SND_UAUDIO(4)
π SND_UAUDIO(4) β USB audio and MIDI device driver π
okay bestie, welcome to the Kernel Interfaces Manual page for snd_uaudio β literally the USB audio + MIDI device driver moment. Itβs giving βplug in your interface and let the kernel handle itβ energy, no cap. π§β¨
πΈ NAME πΈ
snd_uaudio β USB audio and MIDI device driver. π«Ά
π SYNOPSIS π
Build it into your kernel with these lines, bestie:
device sound
device usb
device snd_uaudio
Then in rc.conf(5):
kld_list="snd_uaudio"
And in sysctl.conf(5), these are the names to know:
hw.usb.uaudio.buffer_ms
hw.usb.uaudio.default_bits
hw.usb.uaudio.default_channels
hw.usb.uaudio.default_rate
hw.usb.uaudio.handle_hid
hw.usb.uaudio.debug
π¦ DESCRIPTION π¦
A USB audio device consists of a number of components: input terminals (e.g. USB digital input), output terminals (e.g. speakers), and a number of units in between (e.g. volume control). Itβs basically a tiny little audio chain living on your USB bus, and the kernel is the main character holding it together. π
If the device supports multiple configurations, and there have been no user-supplied values specified through the sysctl(8) interface, the driver will select the best matching configuration supported by the device during attach. βBestβ means the configuration with the most channels and highest quality in sample rate and sample size. Obsessed with a driver that picks the glow-up config for you. β¨
Refer to the βUSB Audio Class Specificationβ for more information.
π HARDWARE π
The snd_uaudio driver provides support for USB audio class devices and USB MIDI class devices. Thatβs the whole vibe check: audio class and MIDI class, handled. πΉπ§
π₯ SYSCTL VARIABLES π₯
The following settings can be entered at the loader(8) prompt or in loader.conf(5) and can also be changed at runtime with the sysctl(8) command. For a change to take effect during runtime, the device has to be re-attached. Like, literally re-attach it β the runtime glow-up doesnβt happen until you do. π«
hw.usb.uaudio.buffer_msβ Period of audio data processed at once, in milliseconds, from 1 to 8 (default is 4). Lower values mean less latency, but this can result in audible gaps due to frequent CPU wakeups. So yes, low latency is cute, but not if your audio starts glitching like a bad video call. πhw.usb.uaudio.default_bitsβ Preferred sample size in bits, from 0 to 32 (default is 0). A value of 0 sets the sample size to the maximum supported sample size. Set this to select a smaller sample size if the device supports multiple sample sizes. Tiny-bit energy when you want it, bestie. ποΈhw.usb.uaudio.default_channelsβ Preferred number of sample channels, from 0 to 64 (default is 0). USB 1.1 devices are limited to 4 channels due to bandwidth constraints, unless a higher value is explicitly requested. A value of 0 sets the sample channels to the maximum supported channel number. Set this to select a smaller channel number if the device supports multiple channel configurations. Channel count realness, but make it configurable. πhw.usb.uaudio.default_rateβ Preferred sample rate in Hz (default is 0). If set to 0, the deviceβs highest supported sample rate will be used. Note that if VCHANs are enabled, the sample rate will be overridden bydev.pcm.%d.[play|rec].vchanrate(seesound(4)), which can also be used to adjust the sample rate during runtime. Ifhw.usb.uaudio.default_rateis non-zero,dev.pcm.%d.[play|rec].vchanratewill use it as its maximum allowed value. Rate logic is doing the absolute most, but itβs documented so we move. πhw.usb.uaudio.handle_hidβ Letsnd_uaudiohandle HID volume keys, if any (default is 1).0β Disabled.1β Enabled.
If usb(4) has been compiled with USB_DEBUG on, the following setting is also available:
hw.usb.uaudio.debugβ Debug output level (default is 0). Debug girlies, this oneβs for you. π
π SEE ALSO π
sound(4)usb(4)loader.conf(5)loader(8)sysctl(8)- USB Audio Class Specifications,
http://www.usb.org/developers/docs/devclass_docs/
β HISTORY β
The snd_uaudio driver first appeared in FreeBSD 4.7. Iconic behavior since FreeBSD 4.7, periodt. π
π AUTHORS π
This manual page was adopted from NetBSD 1.6 and modified for FreeBSD by Hiten Pandya <hmp@FreeBSD.org>. Credit where credit is due, bestie. π«Ά
π BUGS π
The PCM framework in FreeBSD currently does not support the full set of USB audio mixer controls. Some mixer controls are only available as dev.pcm.%d.mixer sysctls. Not me finding out the mixer controls are lowkey sysctl-only right now β but thatβs the documented tea. π΅
xoxo bestie π this page is sourced/versioned as Debian, dated July 17, 2025, and itβs the SND_UAUDIO(4) page. mwah πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- π the page's license: BSD-2-Clause
- Copyright (c) 1999 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms