virtsnd_pcm_find_or_create(9)
π virtsnd_pcm_find_or_create β the "find it or make it" queen π
okay so bestie, welcome to the Kernel API Manual entry for virtsnd_pcm_find_or_create(9) β the function that literally goes "do we already have a PCM device for this node ID? no? bet, making one β¨". It's giving lookup plus creation in one iconic little call, and honestly? We stan a multitasker.
πΈ NAME πΈ
virtsnd_pcm_find_or_create β find or create the PCM device for the specified node ID. that's it, that's the whole vibe π
π¦ SYNOPSIS π¦
struct virtio_pcm * virtsnd_pcm_find_or_create (struct virtio_snd *snd ,
u32 nid );
it hands you back a struct virtio_pcm * β a pointer to the PCM device, or an error in disguise (more on that below, don't panic) π
β¨ ARGUMENTS β¨
sndβ the VirtIO sound device. like, the actual sound hardware situation you're working with π§nidβ the function node ID. the little number that says which node we're talking about π
π CONTEXT π
Any context that permits to sleep. yes bestie, sleep is allowed here β so no calling this from somewhere that can't block, m'kay? π΄π€
π RETURN π
a pointer to the PCM device, or ERR_PTR(-errno) if things went sideways π«Ά
ngl, always run the vibe check on the return value β IS_ERR() exists for a reason, and unchecked error pointers are not the main character energy you want π
π SEE ALSO π
Kernel file ./sound/virtio/virtio_pcm.c β go read the source, iykyk π§
virtsnd_pcm_build_hw(9)virtsnd_pcm_find(9)virtsnd_pcm_validate(9)virtsnd_pcm_period_elapsed(9)virtsnd_pcm_parse_cfg(9)virtsnd_pcm_build_devs(9)virtsnd_pcm_event(9)
that's the whole friend group fr fr β go say hi π
π and that's the page!! π this little gem lives over in ./sound/virtio and the version stamp says October 2026 β so yeah, mark your calendar bestie, the source is ./sound/virtio, the date is October 2026, and virtsnd_pcm_find_or_create(9) is officially slaying in the manual. periodt ππ¦β¨
π¦ 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