snd_hda_codec_amp_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… snd_hda_codec_amp_init β€” initialize the AMP value ✨

okay so bestie, welcome to the Kernel API Manual section of the group chat 🫢 this one is a little function with a very big "don't touch it twice" personality, and honestly? iconic. it lives in snd_hda_codec_amp_init(9), it deals with HDA codec AMP values, and it's giving first-come, first-served main character energy πŸ‘‘


🌸 NAME 🌸

snd_hda_codec_amp_init β€” initialize the AMP value

no cap, that's literally the whole vibe: it initializes the AMP value πŸ’–


✨ SYNOPSIS ✨

int snd_hda_codec_amp_init (struct hda_codec *codec , hda_nid_t nid ,
int ch , int dir , int idx , int mask , int val );

look at all those args, she's thorough πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • codec β€” the HDA codec. your whole world for the duration of this call πŸ¦‹
  • nid β€” the NID to read the AMP value from
  • ch β€” channel, and it's strictly left=0 or right=1
  • dir β€” #HDA_INPUT or #HDA_OUTPUT
  • idx β€” the index value (only for input direction, iykyk)
  • mask β€” bit mask to set
  • val β€” the bits value to set

that's it, that's the lineup, no notes πŸ”₯


🌈 DESCRIPTION 🌈

so here's the tea πŸ“: this works exactly like snd_hda_codec_amp_update, but β€” and this is the whole personality β€” it writes the value only at the first access.

translation for the besties: if the amp was already initialized / updated beforehand, this does nothing. literally nothing. it just sits there like πŸ’€

ok but fr fr, that's a feature not a bug β€” the first touch claims the value, and every call after that is a polite little no-op. don't come for her for not writing twice πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

ma'am, the friend group is huge. the kernel file is ./sound/hda/common/codec.c and here is every single one of her siblings, no cap, nobody left out:

like I said. huge friend group. ate and left no crumbs πŸ§šπŸ’œ


and that's the page bestie!! πŸŽ€ source for all this is ./sound/hda/common, dated October 2026, brought to you by the Kernel API Manual β€” mwah, go init exactly one amp and then leave her alone πŸ’…βœ¨

πŸ“¦ where this page comes from