snd_pcm_get_state(9)
π
snd_pcm_get_state β like, the actual name is snd_pcm_get_state(9) and it lives in the Kernel API Manual, bestie
Okay so picture this: you're deep in kernel-land, you need to know what state the PCM runtime is in, and you also need it to be safe about it. That's the whole gig here. snd_pcm_get_state reads the PCM runtime state with the stream lock held β the way that little detail matters is everything, iykyk. β¨
π SYNOPSIS π
snd_pcm_state_t snd_pcm_get_state (struct snd_pcm_substream *substream);
Yeah. One argument. One return. Clean, iconic, no notes. π
πΈ ARGUMENTS πΈ
substreamβ the PCM substream. That's it, that's the whole parameter. Your main character pointer. π«Ά
β RETURN β
It hands you back the current PCM state, typed as snd_pcm_state_t. So like, return value go brrr and it's a snd_pcm_state_t. Periodt. π₯
π¦ SEE ALSO π¦
The kernel file you're gonna wanna peek at is ./sound/core/pcm_native.c β go be nosy, bestie, it's right there. π
And the whole friend group:
snd_pcm_stream_lock(9)snd_pcm_stream_unlock(9)snd_pcm_stream_lock_irq(9)snd_pcm_stream_unlock_irq(9)snd_pcm_stream_unlock_irqrestore(9)snd_pcm_set_state(9)snd_pcm_hw_params_choose(9)snd_pcm_start(9)snd_pcm_stop(9)snd_pcm_drain_done(9)snd_pcm_stop_xrun(9)snd_pcm_suspend_all(9)snd_pcm_prepare(9)snd_pcm_kernel_ioctl(9)snd_pcm_lib_default_mmap(9)snd_pcm_lib_mmap_iomem(9)
All of them. Every single one. Not me listing the entire friend group chat π
Lowkey important: this thing reads the state with the stream lock β that's literally in the NAME section, so don't come for me. If you're poking at state without respecting the locking situation, that's on you, not on the manpage. π
Alright babe, that's the page! π Mwah π
Kernel file ./sound/core Β· October 2026 Β· snd_pcm_get_state(9) β catch you in the next manpage, bestie, slay responsibly πβ¨π¦
π¦ 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