SNDCTL(8)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’– SNDCTL πŸ’–

okay so bestie, you know how your sound card has a whole vibe going on and you're just sitting there like "what is even happening in there"? yeah. that's what this is for. from the System Manager's Manual, this is the sndctl utility β€” and it's literally about to be your new fave.


✨ NAME ✨

sndctl β€” list and modify soundcard properties πŸŽ›οΈ


πŸ¦‹ SYNOPSIS πŸ¦‹

sndctl [--libxo] [-f device] [-hov] [control[=value] ...]

🌸 DESCRIPTION 🌸

The sndctl utility is used to set and display sound card properties, using a control-driven interface, in order to filter and/or set specific properties.

no cap, it's giving "I have control issues but make it cute" energy. the whole thing is control-driven, which means you talk to it in properties and it just gets it. iykyk πŸ’…

The options are as follows:

πŸŽ€ OPTIONS πŸŽ€

  • --libxo β€” Generate output via libxo(3) in a selection of different human and machine readable formats. See xo_options(7) for details on command line arguments. ✨ (yes bestie, machine readable too, she's versatile)
  • -f device β€” Choose a specific audio device (see β€œFILES”). Userland devices (e.g those registered by virtual_oss(8)) can also be selected. 🫢 pick your fave.
  • -h β€” Print a help message. the classic "help me help you" moment.
  • -o β€” Print values in a format suitable for use inside scripts. πŸ”₯ script girlies rise up.
  • -v β€” Run in verbose mode. This option will print all of the device's channel properties. like the full lore drop. πŸ’€

πŸ‘‘ THE DEVICE CONTROLS πŸ‘‘

okay so these are the device-level controls. read/write status is right there so you know what you can actually touch. πŸ‘‡

  • name β€” String, Read β€” Device name
  • desc β€” String, Read β€” Device description
  • status β€” String, Read β€” Device status
  • devnode β€” String, Read β€” Device node
  • from_user β€” Boolean, Read β€” Userland device
  • unit β€” Number, Read β€” Device unit
  • caps β€” String, Read β€” Device OSS capabitilies
  • bitperfect β€” Boolean, Read/Write β€” Bit-perfect mode enabled
  • autoconv β€” Boolean, Read/Write β€” Auto-conversions enabled
  • realtime β€” Boolean, Read/Write β€” Real-time mode enabled

🎡 play β€” Group, Read β€” Playback properties

  • play.format β€” String, Read/Write β€” Playback format
  • play.rate β€” Number, Read/Write β€” Playback sample rate
  • play.vchans β€” Boolean, Read/Write β€” Playback VCHANs (virtual channels) enabled
  • play.min_rate β€” Number, Read β€” Minimum playback sample rate
  • play.max_rate β€” Number, Read β€” Maximum playback sample rate
  • play.min_chans β€” Number, Read β€” Natively supported minimum playback sample channels
  • play.max_chans β€” Number, Read β€” Natively supported maximum playback sample channels
  • play.formats β€” String, Read β€” Natively supported playback formats

πŸŽ™οΈ rec β€” Group, Read β€” Recording properties

  • rec.format β€” String, Read/Write β€” Recording format
  • rec.rate β€” Number, Read/Write β€” Recording sample rate
  • rec.vchans β€” Boolean, Read/Write β€” Recording VCHANs (virtual channels) enabled
  • rec.min_rate β€” Number, Read β€” Minimum recording sample rate
  • rec.max_rate β€” Number, Read β€” Maximum recording sample rate
  • rec.min_chans β€” Number, Read β€” Natively supported minimum recording sample channels
  • rec.max_chans β€” Number, Read β€” Natively supported maximum recording sample channels
  • rec.formats β€” String, Read β€” Natively supported recording formats
⚠️ heads up bestie: the play.format, play.rate, rec.format and rec.rate controls will be read-only if VCHANs are disabled. so if you're like "why can't I set this" β€” that's why. πŸ™ˆ

πŸ’… THE DEVICE CHANNEL CONTROLS πŸ’…

these ones are per-channel, so they're like the main characters of the actual audio stream. ⭐

  • name β€” String, Read β€” Channel name
  • parentchan β€” String, Read β€” Parent (primary) channel name
  • unit β€” Number, Read β€” Channel unit
  • caps β€” String, Read β€” Channel OSS capabilities
  • latency β€” Number, Read β€” Channel latency
  • format β€” String, Read β€” Channel format
  • rate β€” Number, Read β€” Channel sample rate
  • pid β€” Number, Read β€” PID of process consuming channel
  • proc β€” String, Read β€” Name of process consuming channel
  • interrupts β€” Number, Read β€” Number of interrupts since channel was opened
  • xruns β€” Number, Read β€” Number of playback underruns/recoring overruns
  • feedcount β€” Number, Read β€” Number of bytes fed to channel
  • volume β€” Volume, Read β€” Channel left-right volume in normalized form (0.00 to 1.00). like a little slider from zero to full send. 🎚️

πŸ”Š hwbuf β€” Group, Read β€” Hardware buffer properties

  • hwbuf.format β€” String, Read β€” Hardware buffer format
  • hwbuf.rate β€” String, Read β€” Hardware buffer sample rate
  • hwbuf.size_bytes β€” Number, Read β€” Hardware buffer size in bytes
  • hwbuf.size_frames β€” Number, Read β€” Hardware buffer size in frames
  • hwbuf.blksz β€” Number, Read β€” Hardware buffer block size
  • hwbuf.blkcnt β€” Number, Read β€” Hardware buffer block count
  • hwbuf.free β€” Number, Read β€” Hardware buffer free space in bytes
  • hwbuf.ready β€” Number, Read β€” Hardware buffer ready space in bytes

🌊 swbuf β€” Group, Read β€” Software buffer properties

  • swbuf.format β€” String, Read β€” Software buffer format
  • swbuf.rate β€” String, Read β€” Software buffer sample rate
  • swbuf.size_bytes β€” Number, Read β€” Software buffer size in bytes
  • swbuf.size_frames β€” Number, Read β€” Software buffer size in frames
  • swbuf.blksz β€” Number, Read β€” Software buffer block size
  • swbuf.blkcnt β€” Number, Read β€” Software buffer block count
  • swbuf.free β€” Number, Read β€” Software buffer free space in bytes
  • swbuf.ready β€” Number, Read β€” Software buffer ready space in bytes
  • feederchain β€” String, Read β€” Channel feeder chain 🌈 (the whole pipeline aesthetic)

πŸ—‚οΈ FILES πŸ—‚οΈ

  • /dev/dsp β€” The default audio device. the one that's just there for you. πŸ’–
  • /dev/dspX β€” The audio device file, where X is the unit of the device, for example /dev/dsp0. pick your fighter. πŸ₯Š

🌟 EXAMPLES 🌟

Disable auto-conversions and enable realtime mode to get as low latencies as possible:

$ sndctl autoconv=0 realtime=1

lowkey the "no thoughts just vibes but make it fast" setup. πŸ”₯

Set the playback sample format to 2-channel signed 24-bit low endian, and sample rate to 48000 Hz:

$ sndctl play.format=s24le:2.0 play.rate=48000

she's specific. she's iconic. periodt. πŸ’…

List the PIDs and process names of all channels for /dev/dsp1:

$ sndctl -f /dev/dsp1 pid proc

who is consuming the channel? we simply must know. πŸ‘€

Dump /dev/dsp0 information to a file and retrieve back later:

$ sndctl -f /dev/dsp0 -o > info
...
$ sndctl -f /dev/dsp0 `cat info`

save the lore for later and reload it. the way that works is genuinely so satisfying. 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

sndstat(4), sound(4), xo_options(7), mixer(8), sysctl(8)


πŸŽ€ AUTHORS πŸŽ€

The sndctl utility was implemented by Christos Margiolis <christos@FreeBSD.org> under sponsorship from the FreeBSD Foundation. absolute icon behavior. πŸ‘‘


πŸ’Œ and that's the whole page bestie β€” this version lives under the Debian umbrella, dated December 2, 2025, stamped as part of the System Manager's Manual as SNDCTL(8). slay. βœ¨πŸ’–
πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ“œ the page's license: BSD-2-Clause
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms