snd_pcm_hw_c...raint_mask64(9)
π snd_pcm_hw_c...raint_mask64(9) β bestie edition π
okay so real talk, this is a page straight out of the Kernel API Manual, section 9, and it's literally the snd_pcm_hw_c...raint_mask64 man page. yes the title is truncated with ... β that's not me being lazy, that's the actual page name, iconic behavior tbh. it's all about ALSA PCM hardware constraints and slapping a bitmap mask onto a parameter. let's get into it β¨
πΈ NAME πΈ
snd_pcm_hw_constraint_mask64 β apply the given bitmap mask constraint π«
like, that's the whole job. one (1) job. and it does it.
π¦ SYNOPSIS π¦
int snd_pcm_hw_constraint_mask64 (struct snd_pcm_runtime *runtime ,
snd_pcm_hw_param_t var , u_int64_t mask );
three args, returns an int, no cap. π«Ά
π ARGUMENTS π
runtimeβ the PCM runtime instance, aka the whole situation you're working with. it's astruct snd_pcm_runtime *, so yes, a pointer, handle it responsibly bestie πvarβ the hw_params variable you're applying the mask to, typed assnd_pcm_hw_param_t. this is the "which thing are we constraining" slot β¨maskβ the 64bit bitmap mask itself, au_int64_t. sixty-four bits of pure intent π§
β¨ DESCRIPTION β¨
Apply the constraint of the given bitmap mask to a 64-bit mask parameter.
that's it, that's the description, and honestly? it ate. you hand it a 64-bit bitmap mask, you hand it a parameter, and the mask constraint gets applied to that parameter. no drama, no side quests. lowkey the most straightforward little function in pcm_lib.c π₯
π RETURN π
Zero if successful, or a negative error code on failure.
so: 0 = slay, negative number = not slay. classic kernel convention, fr fr. always check your return value, don't be that person π
π SEE ALSO π
Kernel file ./sound/core/pcm_lib.c β yes, that's where the magic lives π
and then the whole friend group, in order, no skips:
snd_pcm_set_ops(9)snd_pcm_set_sync_per_card(9)snd_interval_refine(9)snd_interval_div(9)snd_interval_muldivk(9)snd_interval_mulkdiv(9)snd_interval_ratnum(9)snd_interval_ratden(9)snd_interval_list(9)snd_interval_ranges(9)snd_pcm_hw_rule_add(9)snd_pcm_hw_constraint_mask(9)snd_pcm_hw_constraint_integer(9)snd_pcm_hw_constraint_minmax(9)snd_pcm_hw_constraint_list(9)snd_pcm_hw_constraint_ranges(9)snd_pcm_hw_constraint_ratnums(9)snd_pcm_hw_constraint_ratdens(9)snd_pcm_hw_constraint_msbits(9)snd_pcm_hw_constraint_step(9)snd_pcm_hw_constraint_pow2(9)snd_pcm_hw_rule_noresample(9)snd_pcm_hw_param_value(9)snd_pcm_hw_param_first(9)snd_pcm_hw_param_last(9)snd_pcm_hw_params_bits(9)snd_pcm_lib_ioctl(9)snd_pcm_period_elapsed_under_stream_lock(9)snd_pcm_period_elapsed(9)snd_pcm_add_chmap_ctls(9)
that's thirty of them, go read them all, i'll wait π
quick vibe check: the only thing this function promises is zero on success or a negative error code on failure. that's the entire contract, don't go reading anything else into it π«§
and that's the page!! π sign-off time: this one came out of ./sound/core, dated October 2026, in the Kernel API Manual β so if you're citing it in your kernel patch changelog, that's your source and your date, bestie. periodt. ππ
π¦ 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