snd_hdac_que...upported_pcm(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 the S32_LE format. 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 returns 0 if 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:


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