query_amp_caps(9)
β¨ query_amp_caps β bestie's guide to AMP capabilities β¨
Ok so real talk, this is a page from the Kernel API Manual (yes, the (9) is the manual section, we love a numbered era) and it's about one tiny function that reads one tiny thing. Short page, but every detail matters, so let's go π
πΈ SYNOPSIS πΈ
u32 query_amp_caps (struct hda_codec *codec , hda_nid_t nid , int
direction );
Yeah that's the whole signature. It returns a u32, it takes three things, and the line break in the middle is just the manpage being dramatic. Don't @ me.
π ARGUMENTS π
codecβ the HD-auio codec. (That's literally how it's spelled in the source, bestie, I'm not fixing it, that would be lying to you π)nidβ the NID you wanna query. That's the widget's little ID number, like its @ handle.directionβ either#HDA_INPUTor#HDA_OUTPUT. Pick a lane. That's the whole choice.
π DESCRIPTION π
So what does it actually do? It queries the AMP capabilities for the given widget and the given direction. That's it, that's the gig. It returns the capability bits it got back π
But here's the part that's lowkey iconic: if the cap bits have already been read, this function does not read them again. It just hands you the cached value. It's giving "I already know her, no need to re-introduce us." Efficiency queen. We stan a function that doesn't do unnecessary work β‘
Ngl that caching behaviour is the whole personality of this function. If you were expecting a fresh hardware read every single callβ¦ bestie, no. Cached. Every time after the first. π«Ά
π¦ SEE ALSO π¦
Kernel file ./sound/hda/common/codec.c β that's where the magic lives, go snoop π§
And because this page refuses to be alone, here's the entire friend group chat, in order, 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), 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(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)
That's the whole squad. Seventy-six entries and yes I counted, don't test me π
Ok that's the tea β this page lives over in ./sound/hda/common, stamped October 2026, and the header up top is query_amp_caps(9) from the Kernel API Manual. Bye bestie, go query some caps, ily π
π¦ 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