snd_pcm_set_...d_buffer_all(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… snd_pcm_set_...d_buffer_all(9) πŸ’…

okay so this is a page straight out of the Kernel API Manual, bestie β€” yes, the Kernel API Manual, we're in the big leagues now πŸŽ€ β€” and the function's full government name is snd_pcm_set_managed_buffer_all, it's just the header that had to abbreviate it. iykyk.


✨ NAME ✨

snd_pcm_set_managed_buffer_all β€” set up buffer management for all substreams for all substreams

no fr, it says "for all substreams" twice and honestly? she's not wrong, she's just thorough πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int snd_pcm_set_managed_buffer_all (struct snd_pcm *pcm , int type ,
       struct device *data , size_t size , size_t max );

🌸 ARGUMENTS 🌸

  • pcm β€” the pcm instance. the main character, the one we're doing all this for πŸ‘‘
  • type β€” DMA type, and it's one of the SNDRV_DMA_TYPE_* girlies ✨
  • data β€” DMA type dependent data. so like, the data depends on whatever type you picked, bestie 🌈
  • size β€” the requested pre-allocation size in bytes. literally the number of bytes you're asking for upfront πŸ’–
  • max β€” the max. allowed pre-allocation size. the ceiling, the limit, the "don't get too comfortable" 🫢

πŸ’œ DESCRIPTION πŸ’œ

so what does she actually do? she does pre-allocation to all substreams of the given pcm, for the specified DMA type and size πŸ”₯ and then β€” the important part β€” she sets the managed_buffer_alloc flag to each substream. every single one. no substream left behind, periodt 🌟


⭐ RETURN ⭐

  • zero if successful πŸŽ‰
  • or a negative error code 😭 (not me getting a negative error code)

🧚 SEE ALSO 🧚

the kernel file ./sound/core/pcm_memory.c is where the magic lives, plus her whole friendship circle:


and that's the whole page, bestie πŸ’…βœ¨ go off and pre-allocate responsibly β€” this one's from ./sound/core, dated October 2026, all wrapped up in the Kernel API Manual πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from