snd_hdac_que...upported_pcm(9)
β¨ snd_hdac_query_supported_pcm π
okay so bestie, this is a page from the Kernel API Manual (yes, that kernel manual, the 9-section one) and we're talking about snd_hdac_query_supported_pcm β the little function that goes "hey codec, what audio rates and formats do you actually support??" and comes back with answers. it's giving detective energy πβ¨
πΈ SYNOPSIS πΈ
int snd_hdac_query_supported_pcm (struct hdac_device *codec , hda_nid_t
nid , u32 *ratesp , u64 *formatsp , u32 *subformatsp , unsigned int
*bpsp );
that's the whole signature, no cap β copy it exactly, she does not accept substitutions π
π ARGUMENTS π
so there's six things you gotta hand her, and every single one matters:
codecβ the codec object itself. like, the actual device you're interrogating. main character of this function tbh πnidβ the NID you want to query. that's the node ID, iykyk.ratespβ a pointer where she'll drop the detected rate bitflags. yes, bitflags. it's a bitmask situation π©formatspβ pointer, stores the detected formats.subformatspβ pointer, stores the detected subformats β and heads up, these are specifically the subformats for theS32_LEformat. very specific, very demure.bpspβ pointer, stores the detected format widths. (bit depths, basically β but the page says widths, so: widths π«Ά)
π DESCRIPTION π
she queries the supported PCM rates and formats. that's the whole vibe. you ask, she goes and finds out, she reports back. iconic behavior honestly π
and here's the cute part β the NULL ratesp, formatsp, subformatsp or bpsp argument is ignored. don't have a place to put one of the answers? no worries bestie, just pass NULL and she'll skip it. flexible queen π§
return value check: she returns0if it all worked out. otherwise you get a negative error code β so like,if (ret < 0)and go deal with it π don't just ignore the negative, fr fr.
π¦ SEE ALSO π¦
the kernel file lives at ./sound/hda/core/device.c β that's where the source is, go look if you're curious π
and here's the whole friend group, every single one, do not skip anybody they'll notice:
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_make_cmd(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_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)
anyway that's the page!! this one ships out of ./sound/hda/core and it's dated October 2026 β so yeah, from the future apparently, we love a time traveler π°οΈβ¨ go query those PCM formats bestie, you're gonna slay π
π
π¦ 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