snd_pcm_hw_param_set(9)
β¨ NAME β¨
snd_pcm_hw_param_set β bestie, this is the little kernel helper that sets an ALSA PCM hardware parameter for you π
(the original page literally leaves the one-liner blank, so we're just vibing with the function name, iykyk)
πΈ SYNOPSIS πΈ
int snd_pcm_hw_param_set (struct snd_pcm_substream *pcm , struct
snd_pcm_hw_params *params , snd_pcm_hw_param_t var , unsigned int val ,
int dir );
π ARGUMENTS π
pcmβ the PCM instance, aka the main character of this whole operation π«Άparamsβ thehw_paramsinstance, where all the config-space lore livesvarβ the parameter to retrieve, no capvalβ the value to set, the moment we've all been waiting for βdirβ pointer to the direction, which is-1,0,1, orNULL(yes,NULLis allowed, she's flexible like that π)
π¦ DESCRIPTION π¦
Okay so picture this: there's a configuration space, and it's defined by PARAMS. Inside that space, this function removes from PAR all the values that are != VAL β literally just yeeting everything that isn't the value you asked for π. The configuration space gets reduced accordingly, which is iconic behaviour honestly.
Then it returns VALβ¦ or -EINVAL if the configuration space ends up empty π (empty config space = no vibes = error, periodt).
Heads up bestie: the original wording here is short and a little cryptic βPARvsPARAMS, and returningVALor-EINVAL. That's exactly what it says, so I'm not gonna invent extra lore. π§
π SEE ALSO π
Kernel file ./sound/core/oss/pcm_oss.c, plus these absolute queens:
snd_pcm_hw_param_value_min(9)snd_pcm_hw_param_value_max(9)snd_pcm_hw_param_min(9)snd_pcm_hw_param_max(9)snd_pcm_hw_param_near(9)
And that's the whole page, bestie β not me finishing up a whole kernel API doc π this one's filed under ./sound/core/oss, dated October 2026, and it's snd_pcm_hw_param_set(9) forever and always πβ¨
π¦ 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