virtsnd_pcm_find_or_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 🧚

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