snd_hda_codec_amp_init(9)
π 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 fromchβ channel, and it's strictlyleft=0orright=1dirβ#HDA_INPUTor#HDA_OUTPUTidxβ the index value (only for input direction, iykyk)maskβ bit mask to setvalβ 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:
snd_hda_sequence_write(9)snd_hda_get_conn_list(9)snd_hda_get_connections(9)snd_hda_override_conn_list(9)snd_hda_get_conn_index(9)snd_hda_get_num_devices(9)snd_hda_get_devices(9)snd_hda_get_dev_select(9)snd_hda_set_dev_select(9)snd_hda_codec_set_pincfg(9)snd_hda_codec_get_pincfg(9)snd_hda_codec_set_pin_target(9)snd_hda_codec_get_pin_target(9)snd_hda_shutup_pins(9)snd_hda_codec_cleanup_for_unbind(9)snd_hda_codec_register(9)snd_hda_codec_unregister(9)snd_hda_codec_device_init(9)snd_hda_codec_new(9)snd_hda_codec_update_widgets(9)snd_hda_codec_setup_stream(9)__snd_hda_codec_cleanup_stream(9)query_amp_caps(9)snd_hda_check_amp_caps(9)snd_hda_override_amp_caps(9)snd_hda_codec_amp_update(9)snd_hda_codec_amp_stereo(9)snd_hda_codec_amp_init_stereo(9)snd_hda_mixer_amp_volume_info(9)snd_hda_mixer_amp_volume_get(9)snd_hda_mixer_amp_volume_put(9)snd_hda_mixer_amp_tlv(9)snd_hda_set_vmaster_tlv(9)snd_hda_find_mixer_ctl(9)snd_hda_ctl_add(9)snd_hda_ctls_clear(9)snd_hda_lock_devices(9)snd_hda_unlock_devices(9)snd_hda_codec_reset(9)__snd_hda_add_vmaster(9)snd_hda_add_vmaster_hook(9)snd_hda_sync_vmaster_hook(9)snd_hda_mixer_amp_switch_info(9)snd_hda_mixer_amp_switch_get(9)snd_hda_mixer_amp_switch_put(9)snd_hda_create_dig_out_ctls(9)snd_hda_spdif_out_of_nid(9)snd_hda_spdif_ctls_unassign(9)snd_hda_spdif_ctls_assign(9)snd_hda_create_spdif_share_sw(9)snd_hda_create_spdif_in_ctls(9)snd_hda_codec_set_power_to_all(9)snd_hda_codec_eapd_power_filter(9)snd_hda_codec_prepare(9)snd_hda_codec_cleanup(9)snd_hda_add_new_ctls(9)snd_hda_codec_set_power_save(9)snd_hda_set_power_save(9)snd_hda_check_amp_list_power(9)snd_hda_input_mux_info(9)snd_hda_input_mux_put(9)snd_hda_enum_helper_info(9)snd_hda_multi_out_dig_open(9)snd_hda_multi_out_dig_prepare(9)snd_hda_multi_out_dig_cleanup(9)snd_hda_multi_out_dig_close(9)snd_hda_multi_out_analog_open(9)snd_hda_multi_out_analog_prepare(9)snd_hda_multi_out_analog_cleanup(9)snd_hda_get_default_vref(9)snd_hda_correct_pin_ctl(9)_snd_hda_set_pin_ctl(9)snd_hda_add_imux_item(9)snd_hda_bus_reset_codecs(9)snd_hda_codec_set_gpio(9)snd_print_pcm_bits(9)
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
- 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