snd_hdac_make_cmd(9)
π snd_hdac_make_cmd β the Kernel API Manual, bestie edition π
Hii so this is a page from the Kernel API Manual (snd_hdac_make_cmd(9)) and it's genuinely the most underrated little helper in the HD-audio core, no cap. Sit down, grab a strawberry drink π, and let's get into it.
β¨ NAME β¨
snd_hdac_make_cmd β compose a 32bit command word to be sent to the HD-audio controller. That's it, that's the whole gig. It builds the word, you send it. Main character energy π₯
π¦ SYNOPSIS π¦
unsigned int snd_hdac_make_cmd (struct hdac_device *codec , hda_nid_t
nid , unsigned int verb , unsigned int parm );
Four things in, one unsigned int out. Iconic signature tbh π
πΈ ARGUMENTS πΈ
codecβ the codec object. This is the whole vibe, the device you're talking about π«Άnidβ the NID to encode. Yes, that NID. The node id. It goes in the command. Slay.verbβ the verb to encode. The actual thing you're asking the codec to do.parmβ the parameter to encode. The lil extra detail that rides along with the verb.
π DESCRIPTION π
Return an encoded command verb or -1 for error.
That's literally it, bestie β that's the entire description on this page. It makes the word, it hands it back to you, or it hands you -1 if something went sideways. Not me being obsessed with a function that just returns a number π
Heads up: -1 here is the error signal. If you get that back, the command did not get composed properly, so don't go yeeting it at the controller. π
π SEE ALSO π
Kernel file ./sound/hda/core/device.c, plus the whole friend group:
snd_hdac_device_init(9)snd_hdac_device_exit(9)snd_hdac_device_register(9)snd_hdac_device_unregister(9)snd_hdac_device_set_chip_name(9)snd_hdac_codec_modalias(9)snd_hdac_exec_verb(9)snd_hdac_read(9)_snd_hdac_read_parm(9)snd_hdac_read_parm_uncached(9)snd_hdac_override_parm(9)snd_hdac_get_sub_nodes(9)snd_hdac_refresh_widgets(9)snd_hdac_get_connections(9)snd_hdac_power_up(9)snd_hdac_power_down(9)snd_hdac_power_up_pm(9)snd_hdac_power_down_pm(9)snd_hdac_stream_format_bits(9)snd_hdac_stream_format(9)snd_hdac_spdif_stream_format(9)snd_hdac_query_supported_pcm(9)snd_hdac_is_supported_format(9)snd_hdac_codec_read(9)snd_hdac_codec_write(9)snd_hdac_check_power_state(9)snd_hdac_sync_power_state(9)
Like, the whole squad is here. Go read them too, iykyk π
β and that's the page!! β This one comes from the source dir ./sound/hda/core, dated October 2026, and the whole thing lives under the title snd_hdac_make_cmd(9) β go compose some commands, bestie, you've got this ππ§
π¦ 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