snd_pcm_set_runtime_buffer(9)
π 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 passNULLhere, it clears instead of sets. soNULLis 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 intoruntime->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:
snd_pcm_stream_linked(9)snd_pcm_stream_lock_irqsave(9)snd_pcm_stream_lock_irqsave_nested(9)snd_pcm_group_for_each_entry(9)snd_pcm_running(9)__snd_pcm_set_state(9)bytes_to_samples(9)bytes_to_frames(9)samples_to_bytes(9)frames_to_bytes(9)frame_aligned(9)snd_pcm_lib_buffer_bytes(9)snd_pcm_lib_period_bytes(9)snd_pcm_playback_avail(9)snd_pcm_capture_avail(9)snd_pcm_playback_hw_avail(9)snd_pcm_capture_hw_avail(9)snd_pcm_playback_ready(9)snd_pcm_capture_ready(9)snd_pcm_playback_data(9)snd_pcm_playback_empty(9)snd_pcm_capture_empty(9)snd_pcm_trigger_done(9)params_channels(9)params_rate(9)params_period_size(9)params_periods(9)params_buffer_size(9)params_buffer_bytes(9)snd_pcm_hw_constraint_single(9)snd_pcm_format_cpu_endian(9)snd_pcm_set_sync(9)snd_pcm_gettime(9)snd_pcm_set_fixed_buffer(9)snd_pcm_set_fixed_buffer_all(9)snd_pcm_sgbuf_get_addr(9)snd_pcm_sgbuf_get_chunk_size(9)snd_pcm_limit_isa_dma_size(9)snd_pcm_direction_name(9)snd_pcm_stream_str(9)snd_pcm_chmap_substream(9)pcm_format_to_bits(9)pcm_for_each_format(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms