snd_pcm_new_internal(9)
π 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 π₯
- Kernel file
./sound/core/pcm.c snd_pcm_format_name(9)snd_pcm_new_stream(9)snd_pcm_new(9)snd_pcm_notify(9)
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
- 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