snd_pcm_running(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… snd_pcm_running(9) β€” the "is this thing actually playing rn" check

okay so bestie, welcome to the Kernel API Manual ✨ this one lives in snd_pcm_running(9) and it's literally the vibe check for your PCM substream πŸ”₯


🌸 NAME

snd_pcm_running β€” checks whether the substream is in a running state πŸƒβ€β™€οΈπŸ’¨

✨ SYNOPSIS

int snd_pcm_running (struct snd_pcm_substream *substream );

πŸŽ€ ARGUMENTS

  • substream β€” the substream you wanna check, bestie πŸ‘€ that's the whole thing

🫢 RETURN

It returns true if the substream you handed it is in the state RUNNING, or if it's in the state DRAINING for playback πŸ’–

no cap, DRAINING only counts for playback β€” that's the fine print, don't forget it πŸ™ˆ

🌈 SEE ALSO

Kernel file ./include/sound/pcm.h πŸ“ and honestly the whole friend group is here:

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_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_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, mwah πŸ’‹ it's filed under ./include/sound, dated October 2026 β€” that's the source and the date bestie, and snd_pcm_running(9) is the name of the game πŸ‘‘ go check those substreams, ily, bye πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from