snd_pcm_playback_avail(9)
π snd_pcm_playback_avail(9) π
okay so bestie, we're deep in the Kernel API Manual today β yes, that manual β and this little function is genuinely one of the cutest ones in the whole PCM family. no cap.
β¨ NAME β¨
snd_pcm_playback_avail β Get the available (writable) space for playback
like. it literally tells you how much room you've got to write into. main character energy fr fr π
πΈ SYNOPSIS πΈ
snd_pcm_uframes_t snd_pcm_playback_avail (struct snd_pcm_runtime
*runtime );
that's the whole signature, copy it exactly bestie, don't be cute with it π
π¦ ARGUMENTS π¦
runtimeβ PCM runtime instance. that's your girl, the runtime struct, the one carrying all the state. you hand her over and she does the math.
π DESCRIPTION π
okay so the result it gives you? it's always between 0 ... (boundary - 1).
that's it. that's the whole description. lowkey iconic that it's that short. no extra lore, no plot twists, just a range check vibe. β¨
π₯ RETURN π₯
available frame size π
(so like, a count of frames, and it's the available ones β the writable space β not the total, not the hardware one, just avail. iykyk)
π SEE ALSO π
Kernel file ./include/sound/pcm.h β and honestly the whole friend group showed up, so let's go:
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_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_set_runtime_buffer(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)
π that's a lot of cross-references and yes you should actually go read them, they're all doing real work. not me being a nerd about it. okay maybe a little.
okay that's the page!! it's giving "short and correct," which is honestly the best combo π«Ά
signed, sealed, delivered from source ./include/sound, dated October 2026, version snd_pcm_playback_avail(9) β slay, go write some frames bestie πβ¨πΈπ
π¦ 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