snd_jack_new(9)
π snd_jack_new(9) β the Kernel API Manual, bestie edition β¨
okay so you found a (9) page, which means it's kernel API and you're officially in the big-girl leagues now π this one lives in the Kernel API Manual, and it's about making a jack. no, not the thing in your headphones cord (wellβ¦ actually yes, kinda, that's the vibe π). stay with me.
β¨ NAME β¨
snd_jack_new β Create a new jack π§β¨
π¦ SYNOPSIS π¦
int snd_jack_new (struct snd_card *card , const char *id , int type ,
struct snd_jack **jjack , bool initial_kctl , bool phantom_jack );
likeβ¦ six arguments. she's high maintenance and she's worth it π
πΈ ARGUMENTS πΈ
cardβ the card instance π³ that's your sound card babe, the whole reason we're hereidβ an identifying string for this jack π·οΈ give her a name, she deserves onetypeβ a bitmask ofenum snd_jack_typevalues that can be detected by this jack π so like, what flavours of plugging-in can she even noticejjackβ Used to provide the allocated jack object to the caller. π«Ά that's your out-param, she hands the shiny new jack back to you through thisinitial_kctlβ if true, create a kcontrol and add it to the jack list. β true means yes please, make the kcontrol and add it to the listphantom_jackβ Don't create a input device for phantom jacks. π»π phantom jacks don't get an input device, that's the whole point of the flag
π DESCRIPTION π
Creates a new jack object. that's it, that's the description, she's a simple girl with a simple purpose β¨ literally just makes the jack. iconic behaviour, no notes π
π₯ RETURN π₯
Zero if successful, or a negative error code on failure. π so <0 means something went wrong, 0 means slay. and on success jjack will be initialised β so bestie please do not touch that pointer before you get the zero back, iykyk π
π SEE ALSO π
- Kernel file
./sound/core/jack.cπ the source, go read it, it's giving main character energy snd_jack_add_new_kctl(9)snd_jack_set_key(9)snd_jack_report(9)
all your little jack besties, go say hi π«Ά
β friendly reminder: negative return code = check it, don't ignore it, that's not cute π
okay that's the page!! π§ this one comes from the ./sound/core part of the tree, dated October 2026, and it's snd_jack_new(9) in the Kernel API Manual β go build something that goes click π§ππ
π¦ 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