snd_pcm_new_internal(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… snd_pcm_new_internal(9) β€” the Kernel API Manual, bestie edition ✨

okay so picture this: you're deep in kernel-land, the snd_pcm_new_internal(9) page is open, and you just need someone to explain it like a friend. that's me. hi. 🫢


🌸 NAME 🌸

snd_pcm_new_internal β€” literally creates a brand new internal PCM instance. that's the whole vibe. πŸ’–


✨ SYNOPSIS ✨

int snd_pcm_new_internal (struct snd_card *card , const char *id , int
device , int playback_count , int capture_count , struct snd_pcm **rpcm
);

no cap, that's the full signature. copy it exactly, don't @ me. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • card β€” the card instance. yes, the whole card. iconic.
  • id β€” the id string, aka the name tag of this PCM 🏷️
  • device β€” the device index, and it's zero based β€” plus it's shared with normal PCMs, which lowkey matters, so remember that πŸ’€
  • playback_count β€” the number of substreams for playback πŸ”Š
  • capture_count β€” the number of substreams for capture 🎀
  • rpcm β€” the pointer where the new pcm instance gets stored. that's your output, bestie, hold onto it πŸ’…

πŸ‘‘ DESCRIPTION πŸ‘‘

so what does it actually do? it creates a new internal PCM instance β€” and here's the main character detail: it has no userspace device or procfs entries. none. zero. the door is locked. 😭

who's this for? ASoC Back End PCMs use it to make a PCM that's only used internally by kernel drivers. i.e. β€” and this is a direct quote from the lore β€” it cannot be opened by userspace. fr fr. this is a kernel-only situation πŸ™ˆ

the way it works is it provides existing ASoC component drivers with a substream and access to any private data. so the components get their substream, they get their private data, everyone's happy. 🌈

⚠️ big heads up: the pcm operators have to be set afterwards on the new instance, via snd_pcm_set_ops. don't forget, bestie, or your PCM is gonna be sitting there with no ops and that's giving unfinished business πŸ’€

⭐ RETURN ⭐

Zero if it worked, or a negative error code on failure. that's it, that's the rule 🎯


πŸ”₯ SEE ALSO πŸ”₯

like, go read them, they're all so valid πŸ’œ


and that's a wrap on snd_pcm_new_internal(9), brought to you by the fine people over at ./sound/core πŸ’– this edition's date stamp is October 2026 β€” so yes, we're being cute about kernel docs and time traveling. slay. πŸ§šβœ¨πŸŽ€

πŸ“¦ where this page comes from