snd_pcm_playback_data(9)
π snd_pcm_playback_data β Kernel API Manual, bestie edition π
Okay so this is a page from the Kernel API Manual (snd_pcm_playback_data(9), section 9, kernel docs energy) and it's literally just one tiny helper function that answers one very important question: is there anything in the playback buffer rn? That's it. That's the whole vibe. Let's get into it β¨
πΈ NAME πΈ
snd_pcm_playback_data β check whether any data exists on the playback buffer π
π¦ SYNOPSIS π¦
int snd_pcm_playback_data (struct snd_pcm_substream *substream );
π ARGUMENTS π
substreamβ the pcm substream instance π (yes, that's the one, the pcm substream, you got it)
β¨ DESCRIPTION β¨
So what does it do? It checks whether any data exists on the playback buffer. That's the whole thing, no cap. Is there data in there or not, that's the question, and this function is the one answering it π«Ά
π₯ RETURN π₯
- Non-zero if any data exists π
- Zero if not π
But wait, there's a lil plot twist: ifstop_thresholdis bigger or equal toboundary, then this function returns always non-zero. Periodt. So don't come for it asking for a zero in that case, it's not happening π
π SEE ALSO π
Kernel file ./include/sound/pcm.h and its whole friend group, like the most iconic group chat in the kernel:
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_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)
Okay that's the whole page, you ate that π
Signing off from the ./include/sound corner of the kernel, October 2026 edition, brought to you by the Kernel API Manual β mwah, love u, go read pcm.h π
π¦ 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