snd_pcm_hw_params_choose(9)
π snd_pcm_hw_params_choose(9) β a Kernel API Manual moment
okay so bestie, welcome to the glow-up of snd_pcm_hw_params_choose(9) from the Kernel API Manual β it's a whole function that picks a config for you and honestly it's giving "let the kernel decide" main character energy π
β¨ NAME β¨
snd_pcm_hw_params_choose β choose a configuration defined by @params
πΈ SYNOPSIS πΈ
int snd_pcm_hw_params_choose (struct snd_pcm_substream *pcm , struct
snd_pcm_hw_params *params );
π¦ ARGUMENTS π¦
pcmβ the PCM instance, aka the whole vibe you're working with πparamsβ thehw_paramsinstance, aka the config list it's gonna pick from
π₯ DESCRIPTION π₯
So here's the tea: this function chooses one configuration out of the configuration space that params defines. Just one. It's picking its outfit for the day π
And the way it picks? It's not random, bestie, it's ordered. The configuration chosen is the one you get by fixing things in exactly this order:
- first access
- first format
- first subformat
- min channels
- min rate
- min period time
- max buffer size
- min tick time
Like literally in that order, no skipping, no swapping. Periodt. π
β RETURN β
Zero if successful (slay), or a negative error code on failure (not slay π).
π SEE ALSO π
Kernel file ./sound/core/pcm_native.c β and the whole friend group:
snd_pcm_stream_lock(9)snd_pcm_stream_unlock(9)snd_pcm_stream_lock_irq(9)snd_pcm_stream_unlock_irq(9)snd_pcm_stream_unlock_irqrestore(9)snd_pcm_set_state(9)snd_pcm_get_state(9)snd_pcm_start(9)snd_pcm_stop(9)snd_pcm_drain_done(9)snd_pcm_stop_xrun(9)snd_pcm_suspend_all(9)snd_pcm_prepare(9)snd_pcm_kernel_ioctl(9)snd_pcm_lib_default_mmap(9)snd_pcm_lib_mmap_iomem(9)
k bye ily, this page lives in ./sound/core and it's stamped October 2026 β go forth and pick your first access, first format, first subformat, min channels, min rate, min period time, max buffer size, min tick time, in that order, 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