snd_pcm_capture_empty(9)
π snd_pcm_capture_empty(9) β the Kernel API Manual, but make it make sense β¨
okay bestie, welcome to the snd_pcm_capture_empty(9) page of the Kernel API Manual πΈ this one is tiny but it's lowkey a little icon, and honestly it does exactly what it says on the tin. no cap. let's get into it π
π NAME π
snd_pcm_capture_empty β check whether the capture buffer is empty π
like, that's the whole personality. it checks. is the capture buffer empty? yes or no. iconic behavior fr fr.
β¨ SYNOPSIS β¨
int snd_pcm_capture_empty (struct snd_pcm_substream *substream );
that's it, that's the call π«Ά one function, one pointer, zero drama.
π ARGUMENTS π
substreamβ the pcm substream instance π literally the thing you're asking about. hand over your substream and she'll tell you what's up.
π¦ DESCRIPTION π¦
Checks whether the capture buffer is empty. π yes that's really the whole description, the manpage is not beating the "short and sweet" allegations.
so like, you pass in your substream, and it goes and takes a peek at that capture buffer and tells you if there's nothing in it. vibe check for your audio buffer, basically. no extra lore, no hidden mechanics, i'm not gonna invent any because that's not the vibe π
β RETURN β
Non-zero if empty, or zero if not. π₯
read that twice bestie, because it's the one place people trip: non-zero means EMPTY, zero means not empty. yes it's backwards from what your brain wants at 2am. that's just how she is. π
π SEE ALSO π
Kernel file ./include/sound/pcm.h π and the whole squad of friends, in the exact order the page lists them, because we do NOT skip the crew:
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_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)
like genuinely go read snd_pcm_capture_ready(9) and snd_pcm_playback_empty(9) next, they're the sibling energy π§
π‘ friendly reminder: don't mix upsnd_pcm_capture_empty(9)withsnd_pcm_playback_empty(9)β capture and playback are different girlies and they are NOT interchangeable. π
and that's the page!! mwah π this one lives under ./include/sound, dated October 2026, and it's filed as snd_pcm_capture_empty(9) in the Kernel API Manual β stay hydrated, lock your irqsave properly, and slay your audio buffers 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