snd_pcm_set_runtime_buffer(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– snd_pcm_set_runtime_buffer(9) πŸ’–

okay bestie, welcome to the Kernel API Manual ✨ β€” this is the page for snd_pcm_set_runtime_buffer, and it's honestly the coziest little helper in the whole PCM saga. let's get into it πŸŽ€


🌸 NAME 🌸

snd_pcm_set_runtime_buffer β€” Set the PCM runtime buffer πŸ’…

like… that's it. that's the job. setting the PCM runtime buffer. iconic behavior fr fr.


✨ SYNOPSIS ✨

void snd_pcm_set_runtime_buffer (struct snd_pcm_substream *substream ,
struct snd_dma_buffer *bufp );

two args, one job, zero drama 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • substream β€” the PCM substream you're setting. this is the main character here, the one getting the glow-up ✨
  • bufp β€” the buffer information. and listen: if you pass NULL here, it clears instead of sets. so NULL is not a bug, it's a feature, it's the "nvm forget it" button πŸ™ˆ

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the whole vibe, no cap:

when bufp is non-NULL, this function copies the buffer information over to runtime->dma_buffer. that's the whole thing β€” copy, done, slay πŸ’…

but when bufp is not non-NULL (aka when it is NULL, bestie, keep up πŸ’€), it clears the current buffer information instead. so it's like:

  • bufp = actual buffer info β†’ copy it into runtime->dma_buffer πŸ“
  • bufp = NULL β†’ wipe the current buffer info, we're done here 🧹

and that's literally the entire function. small, focused, does one thing well. main character energy honestly πŸ‘‘


🌈 SEE ALSO 🌈

okay this is the part where I hold your hand and walk you through the whole friend group, because snd_pcm_set_runtime_buffer rolls DEEP. the kernel file living at ./include/sound/pcm.h is the hangout spot 🏠 and here's everyone:

like I said. deep bench. go read them, they're all worth it, iykyk πŸ’œ


okay that's the page bestie!! πŸŽ€ this one comes to you straight from the source file ./include/sound, stamped October 2026 β€” so go forth, set those runtime buffers, clear them when you must, and remember: NULL is a valid lifestyle choice πŸ¦‹πŸ’– periodt ✨

πŸ“¦ where this page comes from