snd_pcm_rate_mask_intersect(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… snd_pcm_rate_mask_intersect ✨

okay so bestie, you know how there's a kernel API manual? yeah. this is a page from it β€” snd_pcm_rate_mask_intersect(9) β€” and honestly? it's giving "small function, big responsibilities." let me walk you through it 🫢


🌸 NAME 🌸

snd_pcm_rate_mask_intersect β€” literally just computes the intersection between two rate masks. that's it. that's the whole vibe. two masks walk in, one mask walks out πŸ’…


✨ SYNOPSIS ✨

unsigned int snd_pcm_rate_mask_intersect (unsigned int rates_a ,
       unsigned int rates_b );

like, copy that exactly, don't get creative with it 😌


πŸŽ€ ARGUMENTS πŸŽ€

  • rates_a β€” the first rate mask. yes, the first one. we love an opening act πŸ‘‘
  • rates_b β€” the second rate mask. the sequel. the encore. the other half of this whole operation πŸ¦‹

both are unsigned int, both are masks, both matter. no cap.


πŸ’– DESCRIPTION πŸ’–

so here's the tea, bestie: this function computes the rates that are supported by both rate masks passed to the function. it's an intersection, periodt. overlap only. if rates_a stans a rate and rates_b doesn't, that rate is NOT making the cut, sorry not sorry πŸ™ˆ

and the iconique part? it will take care of the special handling of SNDRV_PCM_RATE_CONTINUOUS and SNDRV_PCM_RATE_KNOT. those two get treated differently and this function knows β€” you don't have to do the awkward special-casing yourself. main character energy fr fr ⭐


πŸ”₯ RETURN πŸ”₯

a rate mask containing the rates that are supported by both rates_a and rates_b. that's the whole thing it returns. a mask. a beautiful, intersecting, mutually-agreed-upon mask πŸŒˆπŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./sound/core/pcm_misc.c β€” go read it, iykyk πŸ‘€

and the whole friend group:


🧚 sign-off 🧚

this page lives in ./sound/core, and it was dated October 2026. slay. that's the source and the version and the date, all accounted for, we don't skip the boring bits here πŸ’–βœ¨

k bye bestie, go intersect some masks πŸ’…πŸŽ€

πŸ“¦ where this page comes from