snd_interval_mulkdiv(9)
πΈ snd_interval_mulkdiv(9) πΈ
okay bestie, welcome to the Kernel API Manual β yes the Kernel API Manual, we're in the big leagues now π this one's a lil' helper from the ALSA interval math corner and it's honestly lowkey iconic for how much it does with so few words β¨
β¨ NAME β¨
snd_interval_mulkdiv β refine the interval value π
like, it takes an interval and makes it more itself. main character energy fr fr.
π¦ SYNOPSIS π¦
void snd_interval_mulkdiv (const struct snd_interval *a , unsigned int k
, const struct snd_interval *b , struct snd_interval *c );
no cap, that's the whole signature. void return, four params, we move π
π ARGUMENTS π
aβ dividend 1 π (the first thing getting divided, yes there's a second one, stay with me)kβ dividend 2 (as integer) π₯ it's a dividend and it's anunsigned int, she contains multitudesbβ divisor π the one doing the dividingcβ result β¨ this is where the answer goes, she's the output param and she's serving
π DESCRIPTION π
ok so the actual math is literally:
c = a * k / b
that's it. that's the vibe. you multiply a by k, then divide by b, and the answer lands in c π
aaaand the return value: Returns non-zero if the value is changed, zero if not changed. π«Ά so like, check it if you care whether anything actually moved. iykyk.
πΈ SEE ALSO πΈ
bestie there are so many siblings, this family is huge π all of these live in the Kernel file ./sound/core/pcm_lib.c:
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_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_mask64(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)
ngl if you're reading this at 3am in a kernel tree, drink some water and go to bed after π the intervals will still be there tomorrow.
and that's the whole page, periodt π brought to you straight out of ./sound/core, dated October 2026 β catch you in the next manpage, bestie π§ββοΈβ¨
π¦ 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