snd_pcm_stream_lock(9)
π NAME π
Okay so this is snd_pcm_stream_lock from the Kernel API Manual, and its whole job is literally: Lock the PCM stream πβ¨
π SYNOPSIS π
void snd_pcm_stream_lock (struct snd_pcm_substream *substream );
π ARGUMENTS π
substreamβ the PCM substream, bestie. That's the one thing you pass in. π«Ά
πΈ DESCRIPTION πΈ
So the way this works: it locks the PCM stream's spinlock or mutex, depending on the nonatomic flag of the given substream. Like, it checks that flag and picks the lock vibe accordingly. π
It also takes the global link rw lock (or rw sem), too, for avoiding the race with linked streams. No cap, it's doing that extra locking so linked-stream chaos doesn't sneak in. π
It's giving βdo the lock, move onβ energy β the synopsis says void, so there's no return value to catch. Periodt. π
π¦ SEE ALSO π¦
Kernel file ./sound/core/pcm_native.c says go check these besties:
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_get_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)
source/version: ./sound/core Β· date: October 2026 Β· page: snd_pcm_stream_lock(9) β mwah, bye 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